|
| 1 | +module.exports = { |
| 2 | + root: true, |
| 3 | + env: { |
| 4 | + browser: true, |
| 5 | + node: true, |
| 6 | + amd: true, |
| 7 | + es6: true, |
| 8 | + es2020: true, |
| 9 | + jquery: false |
| 10 | + }, |
| 11 | + extends: [ |
| 12 | + 'eslint:recommended', |
| 13 | + 'react-app', |
| 14 | + 'plugin:react/recommended', |
| 15 | + 'plugin:react-hooks/recommended', |
| 16 | + 'plugin:jsx-a11y/recommended' |
| 17 | + ], |
| 18 | + parser: '@babel/eslint-parser', |
| 19 | + parserOptions: { |
| 20 | + babelOptions: { |
| 21 | + presets: ['@babel/preset-react'] |
| 22 | + }, |
| 23 | + requireConfigFile: false, |
| 24 | + sourceType: 'module' |
| 25 | + }, |
| 26 | + plugins: ['@babel', 'import', 'react', 'react-hooks', 'jest', 'jsx-a11y', 'prettier'], |
| 27 | + settings: { |
| 28 | + 'import/core-modules': [], |
| 29 | + 'import/ignore': ['node_modules', '\\.(coffee|scss|css|less|hbs|svg|json)$'], |
| 30 | + react: { |
| 31 | + pragma: 'React', // Pragma to use, default to "React" |
| 32 | + version: 'detect' // React version. "detect" automatically picks the version you have installed. |
| 33 | + }, |
| 34 | + jest: { |
| 35 | + // version: require('jest/package.json').version, |
| 36 | + } |
| 37 | + }, |
| 38 | + rules: { |
| 39 | + 'no-confusing-arrow': ['error', {allowParens: true}], |
| 40 | + 'no-console': 'warn', |
| 41 | + 'no-var': 'warn', |
| 42 | + 'object-shorthand': 'error', |
| 43 | + 'prefer-const': 'warn', |
| 44 | + 'prefer-template': 'warn', |
| 45 | + 'prettier/prettier': 'error', |
| 46 | + 'react/react-in-jsx-scope': 'off', |
| 47 | + 'react-hooks/rules-of-hooks': 'error', |
| 48 | + 'react-hooks/exhaustive-deps': 'off', |
| 49 | + quotes: ['error', 'single', {avoidEscape: true}], |
| 50 | + 'comma-dangle': [ |
| 51 | + 'off', |
| 52 | + { |
| 53 | + arrays: 'always-multiline', |
| 54 | + objects: 'always-multiline', |
| 55 | + imports: 'always-multiline', |
| 56 | + exports: 'always-multiline', |
| 57 | + functions: 'ignore' |
| 58 | + } |
| 59 | + ], |
| 60 | + 'react/jsx-sort-props': [ |
| 61 | + 2, |
| 62 | + { |
| 63 | + callbacksLast: true, |
| 64 | + shorthandFirst: true, |
| 65 | + reservedFirst: true |
| 66 | + } |
| 67 | + ], |
| 68 | + 'prefer-destructuring': [ |
| 69 | + 'warn', |
| 70 | + { |
| 71 | + object: true, |
| 72 | + array: false |
| 73 | + } |
| 74 | + ], |
| 75 | + 'jsx-a11y/click-events-have-key-events': 'off', |
| 76 | + 'jsx-a11y/no-static-element-interactions': 'off' |
| 77 | + } |
| 78 | +}; |
0 commit comments