|
| 1 | +const ignoreExports = [ |
| 2 | + '.eslintrc.js', |
| 3 | + 'app/script.js', |
| 4 | + 'app/script.test.js', |
| 5 | + 'commitlint.config.js', |
| 6 | + 'test/About.test.js', |
| 7 | + 'truffle-config.js', |
| 8 | + // TODO: Fix index exports |
| 9 | + '**/index.js', |
| 10 | +] |
| 11 | + |
1 | 12 | module.exports = {
|
2 | 13 | env: {
|
3 | 14 | browser: true,
|
| 15 | + commonjs: true, |
4 | 16 | es6: true,
|
5 | 17 | node: true,
|
6 |
| - commonjs: true, |
7 | 18 | },
|
8 | 19 | extends: [
|
| 20 | + 'standard', 'standard-react', |
9 | 21 | 'eslint:recommended',
|
10 | 22 | 'plugin:import/errors',
|
11 |
| - 'plugin:react/recommended', |
| 23 | + 'plugin:react/recommended', // will import plugin and enable jsx in parser options |
12 | 24 | 'plugin:jsx-a11y/recommended',
|
13 | 25 | ],
|
14 | 26 | parser: 'babel-eslint',
|
15 | 27 | parserOptions: {
|
16 |
| - ecmaFeatures: { |
17 |
| - jsx: true |
18 |
| - }, |
19 | 28 | ecmaVersion: 2018,
|
20 |
| - sourceType: 'module' |
21 | 29 | },
|
22 |
| - plugins: ['react'], |
| 30 | + plugins: [ 'react-hooks', 'sort-keys-fix' ], |
23 | 31 | rules: {
|
24 |
| - 'arrow-parens': ["error", "as-needed"], |
25 |
| - indent: ['error', 2], |
26 |
| - 'linebreak-style': ['error', 'unix'], |
27 |
| - quotes: ['error', 'single'], |
28 |
| - 'react/no-typos': 1, |
29 |
| - semi: ['error', 'never'], |
30 |
| - 'array-bracket-spacing': [ |
31 |
| - 'error', |
32 |
| - 'always', |
33 |
| - { |
34 |
| - objectsInArrays: false, |
35 |
| - arraysInArrays: false, |
36 |
| - singleValue: false |
37 |
| - } |
38 |
| - ], |
39 |
| - 'func-style': ["warn", "declaration", { "allowArrowFunctions": true }], |
40 |
| - 'object-curly-spacing': ['error', 'always'], |
41 |
| - // "import/no-unused-modules": [ |
42 |
| - // "warn", |
43 |
| - // { |
44 |
| - // unusedExports: true, |
45 |
| - // missingExports: true, |
46 |
| - // ignoreExports: [], |
47 |
| - // } |
48 |
| - // ], |
49 |
| - "no-undef": "error", |
50 |
| - "no-unused-vars": ["warn", { "vars": "all", "args": "after-used", "ignoreRestSiblings": false }], |
51 |
| - 'no-console': ['warn', { allow: ['warn', 'error'] }], |
52 |
| - "react/jsx-uses-react": "warn", |
53 |
| - "react/jsx-uses-vars": "warn", |
54 |
| - "react/jsx-filename-extension": "off", |
55 |
| - "react/no-unused-prop-types": "warn", |
56 |
| - "react/self-closing-comp": ["error", {"component": true, "html": true}], |
57 |
| - "sort-imports": ["warn", { "ignoreDeclarationSort": true }] |
| 32 | + 'array-bracket-spacing': [ 'error', 'always', { singleValue: false } ], |
| 33 | + 'arrow-parens': [ 'error', 'as-needed' ], |
| 34 | + 'comma-dangle': [ 'error', 'always-multiline' ], |
| 35 | + 'comma-spacing': ['error'], |
| 36 | + 'func-style': [ 'warn', 'declaration', { 'allowArrowFunctions': true } ], |
| 37 | + 'import/no-unresolved': ['error'], |
| 38 | + 'import/no-unused-modules': [ 'error', { ignoreExports, missingExports: true, unusedExports: true } ], |
| 39 | + 'indent': [ 'error', 2 ], |
| 40 | + 'linebreak-style': [ 'error', 'unix' ], |
| 41 | + 'no-console': [ 'warn', { allow: [ 'warn', 'error' ] } ], |
| 42 | + 'no-multi-spaces': 'error', |
| 43 | + 'no-trailing-spaces': ['error'], |
| 44 | + 'no-undef': 'error', |
| 45 | + 'no-unused-vars': [ 'warn', { 'args': 'after-used', 'ignoreRestSiblings': false, 'vars': 'all' } ], |
| 46 | + 'object-curly-spacing': [ 'error', 'always' ], |
| 47 | + 'quotes': [ 'error', 'single' ], |
| 48 | + 'react-hooks/exhaustive-deps': 'error', |
| 49 | + 'react-hooks/rules-of-hooks': 'error', |
| 50 | + 'react/default-props-match-prop-types': ['error'], |
| 51 | + 'react/destructuring-assignment': [ 'error', 'always' ], |
| 52 | + 'react/forbid-prop-types': ['warn'], |
| 53 | + 'react/function-component-definition': [ 'error', { 'namedComponents': 'arrow-function', 'unnamedComponents': 'function-expression' } ], |
| 54 | + 'react/no-array-index-key': 'warn', |
| 55 | + 'react/no-danger': 'error', |
| 56 | + 'react/no-typos': 'error', |
| 57 | + 'react/no-unused-prop-types': 'warn', |
| 58 | + 'react/require-default-props': ['error'], |
| 59 | + 'react/self-closing-comp': [ 'error', { 'component': true, 'html': true } ], |
| 60 | + 'react/sort-comp': ['error'], |
| 61 | + 'react/sort-prop-types': [ 'error', { 'ignoreCase': true, 'sortShapeProp': 'true' } ], |
| 62 | + 'react/void-dom-elements-no-children': 'error', |
| 63 | + 'semi': [ 'error', 'never' ], |
| 64 | + 'sort-imports': [ 'error', { 'ignoreDeclarationSort': true } ], |
| 65 | + 'sort-keys-fix/sort-keys-fix': 'error', |
58 | 66 | },
|
59 | 67 | settings: {
|
60 |
| - react: { |
61 |
| - version: 'detect', |
62 |
| - } |
63 |
| - } |
| 68 | + react: { version: 'detect' }, |
| 69 | + }, |
64 | 70 | }
|
65 | 71 |
|
0 commit comments