|
| 1 | +const fs = require('fs') |
| 2 | +const path = require('path') |
| 3 | + |
| 4 | +const prettierOptions = JSON.parse(fs.readFileSync(path.resolve(__dirname, '.prettierrc'), 'utf8')) |
| 5 | + |
| 6 | +module.exports = { |
| 7 | + parser: 'babel-eslint', |
| 8 | + env: { |
| 9 | + browser: true, |
| 10 | + amd: true, |
| 11 | + es6: true, |
| 12 | + node: true, |
| 13 | + }, |
| 14 | + extends: [ |
| 15 | + 'eslint:recommended', |
| 16 | + 'plugin:react/recommended', |
| 17 | + 'plugin:jest/recommended', |
| 18 | + 'plugin:cypress/recommended', |
| 19 | + 'plugin:import/warnings', |
| 20 | + ], |
| 21 | + parserOptions: { |
| 22 | + ecmaFeatures: { |
| 23 | + jsx: true, |
| 24 | + }, |
| 25 | + ecmaVersion: 2018, |
| 26 | + sourceType: 'module', |
| 27 | + }, |
| 28 | + plugins: ['react', 'import', 'jest', 'jsx-a11y', 'prettier', 'cypress'], |
| 29 | + rules: { |
| 30 | + 'prettier/prettier': ['error', prettierOptions], |
| 31 | + 'arrow-body-style': [2, 'as-needed'], |
| 32 | + 'comma-dangle': [2, 'always-multiline'], |
| 33 | + quotes: [ |
| 34 | + 1, |
| 35 | + 'single', |
| 36 | + { |
| 37 | + avoidEscape: true, |
| 38 | + }, |
| 39 | + ], |
| 40 | + 'no-undef': 2, |
| 41 | + 'global-strict': 0, |
| 42 | + 'no-extra-semi': 2, |
| 43 | + semi: ['error', 'never'], |
| 44 | + 'no-underscore-dangle': 0, |
| 45 | + 'no-shadow': 0, |
| 46 | + 'no-unused-expressions': 0, |
| 47 | + 'consistent-return': 0, |
| 48 | + 'prefer-destructuring': 0, |
| 49 | + 'no-useless-constructor': 0, |
| 50 | + 'prefer-const': 0, |
| 51 | + 'no-trailing-spaces': [ |
| 52 | + 1, |
| 53 | + { |
| 54 | + skipBlankLines: true, |
| 55 | + }, |
| 56 | + ], |
| 57 | + 'no-unreachable': 1, |
| 58 | + 'no-alert': 1, |
| 59 | + 'max-len': 0, |
| 60 | + 'newline-per-chained-call': 0, |
| 61 | + 'no-confusing-arrow': 0, |
| 62 | + 'no-console': 1, |
| 63 | + 'no-unused-vars': 2, |
| 64 | + 'no-use-before-define': 0, |
| 65 | + 'import/imports-first': 0, |
| 66 | + 'import/newline-after-import': 0, |
| 67 | + 'import/no-dynamic-require': 0, |
| 68 | + 'import/no-extraneous-dependencies': 0, |
| 69 | + 'import/no-named-as-default': 0, |
| 70 | + 'import/no-unresolved': 2, |
| 71 | + 'import/no-webpack-loader-syntax': 0, |
| 72 | + 'import/prefer-default-export': 0, |
| 73 | + indent: [ |
| 74 | + 2, |
| 75 | + 2, |
| 76 | + { |
| 77 | + SwitchCase: 1, |
| 78 | + }, |
| 79 | + ], |
| 80 | + 'react/destructuring-assignment': 0, |
| 81 | + 'react/jsx-closing-tag-location': 0, |
| 82 | + 'react/forbid-prop-types': 0, |
| 83 | + 'react/jsx-first-prop-new-line': [2, 'multiline'], |
| 84 | + 'react/jsx-filename-extension': 0, |
| 85 | + 'react/jsx-no-target-blank': 0, |
| 86 | + 'react/jsx-uses-vars': 2, |
| 87 | + 'react/require-default-props': 0, |
| 88 | + 'react/require-extension': 0, |
| 89 | + 'react/self-closing-comp': 0, |
| 90 | + 'react/sort-comp': 0, |
| 91 | + 'jsx-a11y/aria-props': 2, |
| 92 | + 'jsx-a11y/heading-has-content': 0, |
| 93 | + 'jsx-a11y/label-has-for': 0, |
| 94 | + 'jsx-a11y/mouse-events-have-key-events': 2, |
| 95 | + 'jsx-a11y/role-has-required-aria-props': 2, |
| 96 | + 'jsx-a11y/role-supports-aria-props': 2, |
| 97 | + }, |
| 98 | + settings: { |
| 99 | + react: { |
| 100 | + version: '16.5.2', |
| 101 | + }, |
| 102 | + 'import/resolver': { |
| 103 | + alias: { |
| 104 | + map: [ |
| 105 | + ['src', path.resolve(__dirname, './src/')], |
| 106 | + ['components', path.resolve(__dirname, './src/components')], |
| 107 | + ['containers', path.resolve(__dirname, './src/containers')], |
| 108 | + ['hoc', path.resolve(__dirname, './src/hoc')], |
| 109 | + ['style', path.resolve(__dirname, './src/style')], |
| 110 | + ['libs', path.resolve(__dirname, './src/libs')], |
| 111 | + ['assets', path.resolve(__dirname, './src/assets')], |
| 112 | + ['vendor', path.resolve(__dirname, './src/vendor')], |
| 113 | + ['store', path.resolve(__dirname, './src/store')], |
| 114 | + ['actions', path.resolve(__dirname, './src/store/actions')], |
| 115 | + ['reducers', path.resolve(__dirname, './src/store/reducers')], |
| 116 | + ], |
| 117 | + extensions: ['.js', '.json'], |
| 118 | + }, |
| 119 | + }, |
| 120 | + }, |
| 121 | +} |
0 commit comments