Merge pull request #5 from ianmiller347/development
update linter and settings
This commit is contained in:
commit
f63e0ffab8
243
.eslintrc
243
.eslintrc
@ -1,180 +1,81 @@
|
||||
{
|
||||
root: true,
|
||||
parser: 'babel-eslint',
|
||||
plugins: [/*'import', */'jsx-a11y', 'react'],
|
||||
env: {
|
||||
browser: true,
|
||||
commonjs: true,
|
||||
es6: true,
|
||||
jest: true,
|
||||
node: true
|
||||
"env": {
|
||||
"browser": true,
|
||||
"commonjs": true,
|
||||
"es6": true,
|
||||
"jest": true,
|
||||
"node": true
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 6,
|
||||
sourceType: 'module',
|
||||
ecmaFeatures: {
|
||||
jsx: true,
|
||||
generators: true,
|
||||
experimentalObjectRestSpread: true
|
||||
"extends": [
|
||||
"eslint:recommended",
|
||||
"plugin:react/recommended"
|
||||
],
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 2018,
|
||||
"sourceType": "module",
|
||||
"ecmaFeatures": {
|
||||
"jsx": true
|
||||
}
|
||||
},
|
||||
settings: {
|
||||
'import/ignore': [
|
||||
'node_modules',
|
||||
'\\.(json|css|jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$',
|
||||
"parser": "babel-eslint",
|
||||
"plugins": ["jsx-a11y", "react"],
|
||||
"rules": {
|
||||
"semi": "error",
|
||||
"no-array-constructor": "warn",
|
||||
"react/jsx-closing-bracket-location": 1,
|
||||
"react/jsx-curly-spacing": "warn",
|
||||
"react/jsx-equals-spacing": ["warn", "never"],
|
||||
"react/jsx-first-prop-new-line": ["warn", "multiline"],
|
||||
"react/jsx-handler-names": "warn",
|
||||
"react/jsx-indent": ["warn", 2],
|
||||
"react/jsx-indent-props": ["warn", 2],
|
||||
"react/jsx-key": "warn",
|
||||
"react/jsx-max-props-per-line": "warn",
|
||||
"react/jsx-no-bind": ["warn", {"allowArrowFunctions": true}],
|
||||
"react/jsx-no-comment-textnodes": "warn",
|
||||
"react/jsx-no-duplicate-props": ["warn", { "ignoreCase": true }],
|
||||
"react/jsx-no-undef": "warn",
|
||||
"react/jsx-pascal-case": ["warn", {
|
||||
"allowAllCaps": true,
|
||||
"ignore": []
|
||||
}],
|
||||
"react/jsx-sort-props": 0,
|
||||
"react/jsx-tag-spacing": "warn",
|
||||
"react/jsx-uses-react": "warn",
|
||||
"react/jsx-uses-vars": "warn",
|
||||
"react/jsx-wrap-multilines": "warn",
|
||||
"react/no-deprecated": "warn",
|
||||
"react/no-direct-mutation-state": "warn",
|
||||
"react/no-is-mounted": "warn",
|
||||
"react/no-unused-prop-types": "warn",
|
||||
"react/prefer-es6-class": "warn",
|
||||
"react/prefer-stateless-function": 0,
|
||||
"react/prop-types": "warn",
|
||||
"react/react-in-jsx-scope": "warn",
|
||||
"react/require-render-return": "warn",
|
||||
"react/self-closing-comp": "warn",
|
||||
"react/sort-comp": "warn",
|
||||
"react/sort-prop-types": 0,
|
||||
"react/style-prop-object": "warn",
|
||||
"react/void-dom-elements-no-children": "warn",
|
||||
"jsx-a11y/aria-role": "warn",
|
||||
"jsx-a11y/no-access-key": "warn"
|
||||
},
|
||||
"settings": {
|
||||
"import/ignore": [
|
||||
"node_modules",
|
||||
"\\.(json|css|jpg|png|gif|eot|otf|webp|svg|ttf|woff|woff2|mp4|webm)$",
|
||||
],
|
||||
'import/extensions': ['.js'],
|
||||
'import/resolver': {
|
||||
node: {
|
||||
extensions: ['.js', '.json']
|
||||
}
|
||||
"import/extensions": [".js"],
|
||||
"import/resolver": {
|
||||
"node": {
|
||||
"extensions": [".js", ".json"]
|
||||
}
|
||||
},
|
||||
rules: {
|
||||
// http://eslint.org/docs/rules/
|
||||
'array-callback-return': 'warn',
|
||||
'camelcase': 'warn',
|
||||
'curly': 'warn',
|
||||
'default-case': ['warn', { commentPattern: '^no default$' }],
|
||||
'dot-location': ['warn', 'property'],
|
||||
'eol-last': 'warn',
|
||||
'eqeqeq': ['warn', 'always'],
|
||||
'indent': ['warn', 2, { "SwitchCase": 1 }],
|
||||
'guard-for-in': 'warn',
|
||||
'keyword-spacing': 'warn',
|
||||
'new-parens': 'warn',
|
||||
'no-array-constructor': 'warn',
|
||||
'no-caller': 'warn',
|
||||
'no-cond-assign': ['warn', 'always'],
|
||||
'no-const-assign': 'warn',
|
||||
'no-control-regex': 'warn',
|
||||
'no-delete-var': 'warn',
|
||||
'no-dupe-args': 'warn',
|
||||
'no-dupe-class-members': 'warn',
|
||||
'no-dupe-keys': 'warn',
|
||||
'no-duplicate-case': 'warn',
|
||||
'no-empty-character-class': 'warn',
|
||||
'no-empty-pattern': 'warn',
|
||||
'no-eval': 'warn',
|
||||
'no-ex-assign': 'warn',
|
||||
'no-extend-native': 'warn',
|
||||
'no-extra-bind': 'warn',
|
||||
'no-extra-label': 'warn',
|
||||
'no-fallthrough': 'warn',
|
||||
'no-func-assign': 'warn',
|
||||
'no-global-assign': 'warn',
|
||||
'no-implied-eval': 'warn',
|
||||
'no-invalid-regexp': 'warn',
|
||||
'no-iterator': 'warn',
|
||||
'no-label-var': 'warn',
|
||||
'no-labels': ['warn', { allowLoop: false, allowSwitch: false }],
|
||||
'no-lone-blocks': 'warn',
|
||||
'no-loop-func': 'warn',
|
||||
'no-mixed-operators': ['warn', {
|
||||
groups: [
|
||||
['&', '|', '^', '~', '<<', '>>', '>>>'],
|
||||
['==', '!=', '===', '!==', '>', '>=', '<', '<='],
|
||||
['&&', '||'],
|
||||
['in', 'instanceof']
|
||||
],
|
||||
allowSamePrecedence: false
|
||||
}],
|
||||
'no-multi-str': 'warn',
|
||||
'no-new-func': 'warn',
|
||||
'no-new-object': 'warn',
|
||||
'no-new-symbol': 'warn',
|
||||
'no-new-wrappers': 'warn',
|
||||
'no-obj-calls': 'warn',
|
||||
'no-octal': 'warn',
|
||||
'no-octal-escape': 'warn',
|
||||
'no-redeclare': 'warn',
|
||||
'no-regex-spaces': 'warn',
|
||||
'no-restricted-syntax': [
|
||||
'warn',
|
||||
'LabeledStatement',
|
||||
'WithStatement',
|
||||
],
|
||||
'no-script-url': 'warn',
|
||||
'no-self-assign': 'warn',
|
||||
'no-self-compare': 'warn',
|
||||
'no-sequences': 'warn',
|
||||
'no-shadow-restricted-names': 'warn',
|
||||
'no-sparse-arrays': 'warn',
|
||||
'no-template-curly-in-string': 'warn',
|
||||
'no-this-before-super': 'warn',
|
||||
'no-throw-literal': 'warn',
|
||||
'no-undef': 'warn',
|
||||
'no-unexpected-multiline': 'warn',
|
||||
'no-unreachable': 'warn',
|
||||
'no-unsafe-negation': 'warn',
|
||||
'no-unused-expressions': 'warn',
|
||||
'no-unused-labels': 'warn',
|
||||
'no-unused-vars': ['warn', { vars: 'local', args: 'none' }],
|
||||
'no-use-before-define': ['warn', 'nofunc'],
|
||||
'no-useless-computed-key': 'warn',
|
||||
'no-useless-concat': 'warn',
|
||||
'no-useless-constructor': 'warn',
|
||||
'no-useless-escape': 'warn',
|
||||
'no-useless-rename': ['warn', {
|
||||
ignoreDestructuring: false,
|
||||
ignoreImport: false,
|
||||
ignoreExport: false,
|
||||
}],
|
||||
'no-with': 'warn',
|
||||
'no-whitespace-before-property': 'warn',
|
||||
'object-curly-spacing': ['warn', 'always'],
|
||||
'operator-assignment': ['warn', 'always'],
|
||||
radix: 'warn',
|
||||
'require-yield': 'warn',
|
||||
'rest-spread-spacing': ['warn', 'never'],
|
||||
'semi': 'warn',
|
||||
strict: ['warn', 'never'],
|
||||
'unicode-bom': ['warn', 'never'],
|
||||
'use-isnan': 'warn',
|
||||
'valid-typeof': 'warn',
|
||||
'react/jsx-boolean-value': 'warn',
|
||||
'react/jsx-closing-bracket-location': 'warn',
|
||||
'react/jsx-curly-spacing': 'warn',
|
||||
'react/jsx-equals-spacing': ['warn', 'never'],
|
||||
'react/jsx-first-prop-new-line': ['warn', 'multiline'],
|
||||
'react/jsx-handler-names': 'warn',
|
||||
'react/jsx-indent': ['warn', 2],
|
||||
'react/jsx-indent-props': ['warn', 2],
|
||||
'react/jsx-key': 'warn',
|
||||
'react/jsx-max-props-per-line': 'warn',
|
||||
'react/jsx-no-bind': ['warn', {'allowArrowFunctions': true}],
|
||||
'react/jsx-no-comment-textnodes': 'warn',
|
||||
'react/jsx-no-duplicate-props': ['warn', { ignoreCase: true }],
|
||||
'react/jsx-no-undef': 'warn',
|
||||
'react/jsx-pascal-case': ['warn', {
|
||||
allowAllCaps: true,
|
||||
ignore: [],
|
||||
}],
|
||||
'react/jsx-sort-props': 'warn',
|
||||
'react/jsx-tag-spacing': 'warn',
|
||||
'react/jsx-uses-react': 'warn',
|
||||
'react/jsx-uses-vars': 'warn',
|
||||
'react/jsx-wrap-multilines': 'warn',
|
||||
'react/no-deprecated': 'warn',
|
||||
'react/no-did-mount-set-state': 'warn',
|
||||
'react/no-did-update-set-state': 'warn',
|
||||
'react/no-direct-mutation-state': 'warn',
|
||||
'react/no-is-mounted': 'warn',
|
||||
'react/no-unused-prop-types': 'warn',
|
||||
'react/prefer-es6-class': 'warn',
|
||||
'react/prefer-stateless-function': 'warn',
|
||||
'react/prop-types': 'warn',
|
||||
'react/react-in-jsx-scope': 'warn',
|
||||
'react/require-render-return': 'warn',
|
||||
'react/self-closing-comp': 'warn',
|
||||
'react/sort-comp': 'warn',
|
||||
'react/sort-prop-types': 'warn',
|
||||
'react/style-prop-object': 'warn',
|
||||
'react/void-dom-elements-no-children': 'warn',
|
||||
// https://github.com/evcohen/eslint-plugin-jsx-a11y/tree/master/docs/rules
|
||||
'jsx-a11y/aria-role': 'warn',
|
||||
'jsx-a11y/img-has-alt': 'warn',
|
||||
'jsx-a11y/img-redundant-alt': 'warn',
|
||||
'jsx-a11y/no-access-key': 'warn'
|
||||
"react": {
|
||||
"createClass": "createReactClass",
|
||||
"pragma": "React",
|
||||
"version": "detect"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
22
package.json
22
package.json
@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "feather-icons-react",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"description": "Feather Icons as a React component.",
|
||||
"main": "build/index.js",
|
||||
"scripts": {
|
||||
"test": "npm run test",
|
||||
"build": "babel src -d build",
|
||||
"lint": "eslint src/**; exit 0",
|
||||
"build": "npm run lint && babel src -d build",
|
||||
"lint": "eslint src",
|
||||
"lint:watch": "esw -w lib/**",
|
||||
"prepare": "npm run build"
|
||||
},
|
||||
@ -33,14 +33,14 @@
|
||||
"@babel/preset-env": "^7.3.4",
|
||||
"@babel/preset-react": "^7.0.0",
|
||||
"babel-eslint": "^10.0.1",
|
||||
"eslint": "^4.19.1",
|
||||
"eslint-plugin-import": "^2.12.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.0.3",
|
||||
"eslint-plugin-react": "^7.9.1",
|
||||
"eslint-watch": "^3.1.5",
|
||||
"prop-types": "^15.6.1",
|
||||
"react": "^16.4.1",
|
||||
"react-dom": "^16.4.1"
|
||||
"eslint": "^5.15.3",
|
||||
"eslint-plugin-import": "^2.16.0",
|
||||
"eslint-plugin-jsx-a11y": "^6.2.1",
|
||||
"eslint-plugin-react": "^7.12.4",
|
||||
"eslint-watch": "^5.0.1",
|
||||
"prop-types": "^15.7.2",
|
||||
"react": "^16.8.4",
|
||||
"react-dom": "^16.8.4"
|
||||
},
|
||||
"dependencies": {
|
||||
"dompurify": "^1.0.5",
|
||||
|
||||
@ -17,7 +17,8 @@ class FeatherIcon extends Component {
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
className={`feather feather-${icon} ${className}`}
|
||||
{...otherProps}>
|
||||
{...otherProps}
|
||||
>
|
||||
<IconInner icon={icon} />
|
||||
</svg>
|
||||
);
|
||||
@ -28,11 +29,11 @@ FeatherIcon.propTypes = {
|
||||
icon: PropTypes.string.isRequired,
|
||||
size: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
|
||||
className: PropTypes.string
|
||||
}
|
||||
};
|
||||
|
||||
FeatherIcon.defaultProps = {
|
||||
size: 24,
|
||||
className: ''
|
||||
}
|
||||
};
|
||||
|
||||
export default FeatherIcon;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user