|
| 1 | +module.exports = { |
| 2 | + plugins: [ |
| 3 | + 'import', |
| 4 | + 'react' |
| 5 | + ], |
| 6 | + extends: [ |
| 7 | + 'eslint:recommended', |
| 8 | + 'plugin:react/recommended', |
| 9 | + 'plugin:import/errors', |
| 10 | + 'plugin:import/warnings' |
| 11 | + ], |
| 12 | + env: { |
| 13 | + browser: true, |
| 14 | + commonjs: true, |
| 15 | + node: true, |
| 16 | + es6: true, |
| 17 | + }, |
| 18 | + parser: 'babel-eslint', |
| 19 | + parserOptions: { |
| 20 | + ecmaVersion: '2018', |
| 21 | + sourceType: 'module', |
| 22 | + ecmaFeatures: { |
| 23 | + impliedStrict: true, |
| 24 | + jsx: true, |
| 25 | + }, |
| 26 | + }, |
| 27 | + rules: { |
| 28 | + 'brace-style': ['error', 'stroustrup', { allowSingleLine: true }], |
| 29 | + camelcase: ["error", { allow: ['^UNSAFE_'] }], |
| 30 | + 'capitalized-comments': [ |
| 31 | + 'error', |
| 32 | + 'always', |
| 33 | + { |
| 34 | + line: { |
| 35 | + ignorePattern: '.', |
| 36 | + ignoreConsecutiveComments: true, |
| 37 | + }, |
| 38 | + block: { |
| 39 | + ignoreInlineComments: true, |
| 40 | + ignorePattern: 'ignored', |
| 41 | + }, |
| 42 | + }, |
| 43 | + ], |
| 44 | + curly: ["error", "multi-line", "consistent"], |
| 45 | + indent: [ |
| 46 | + 'error', |
| 47 | + 'tab', |
| 48 | + { |
| 49 | + SwitchCase: 1, // indent 'case' statements 1-tab |
| 50 | + MemberExpression: 'off' // eg: .then(...) |
| 51 | + } |
| 52 | + ], |
| 53 | + 'linebreak-style': ['error', 'unix'], |
| 54 | + 'no-alert': 'error', |
| 55 | + 'no-caller': 'error', |
| 56 | + 'no-console': 0, |
| 57 | + 'no-invalid-this': 'error', |
| 58 | + 'no-param-reassign': 'error', |
| 59 | + 'no-shadow': 'error', |
| 60 | + 'no-use-before-define': ['error', { functions: false, classes: true }], |
| 61 | + 'no-useless-return': 'error', |
| 62 | + 'no-with': 'error', |
| 63 | + quotes: [ |
| 64 | + 'error', |
| 65 | + 'single', |
| 66 | + { allowTemplateLiterals: true, avoidEscape: true }, |
| 67 | + ], |
| 68 | + semi: ['error', 'never'], |
| 69 | + strict: ['error', 'global'], |
| 70 | + 'vars-on-top': 'warn', |
| 71 | + }, |
| 72 | + overrides: [ |
| 73 | + { |
| 74 | + files: ['.eslintrc.js'], |
| 75 | + excludedFiles: [], |
| 76 | + rules: { |
| 77 | + 'comma-dangle': ['error', 'never'], |
| 78 | + }, |
| 79 | + }, |
| 80 | + ], |
| 81 | +} |
0 commit comments