|
| 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 | + extends: ['airbnb', 'prettier', 'prettier/react'], |
| 9 | + plugins: ['prettier', 'redux-saga', 'react', 'react-hooks', 'jsx-a11y'], |
| 10 | + env: { |
| 11 | + jest: true, |
| 12 | + browser: true, |
| 13 | + node: true, |
| 14 | + es6: true, |
| 15 | + }, |
| 16 | + parserOptions: { |
| 17 | + ecmaVersion: 6, |
| 18 | + sourceType: 'module', |
| 19 | + ecmaFeatures: { |
| 20 | + jsx: true, |
| 21 | + }, |
| 22 | + }, |
| 23 | + rules: { |
| 24 | + 'prettier/prettier': ['error', prettierOptions], |
| 25 | + 'arrow-body-style': [2, 'as-needed'], |
| 26 | + 'class-methods-use-this': 0, |
| 27 | + 'import/imports-first': 0, |
| 28 | + 'import/newline-after-import': 0, |
| 29 | + 'import/no-dynamic-require': 0, |
| 30 | + 'import/no-extraneous-dependencies': 0, |
| 31 | + 'import/no-named-as-default': 0, |
| 32 | + 'import/no-unresolved': 2, |
| 33 | + 'import/no-webpack-loader-syntax': 0, |
| 34 | + 'import/prefer-default-export': 0, |
| 35 | + indent: [ |
| 36 | + 2, |
| 37 | + 2, |
| 38 | + { |
| 39 | + SwitchCase: 1, |
| 40 | + }, |
| 41 | + ], |
| 42 | + 'jsx-a11y/aria-props': 2, |
| 43 | + 'jsx-a11y/heading-has-content': 0, |
| 44 | + 'jsx-a11y/label-has-associated-control': [ |
| 45 | + 2, |
| 46 | + { |
| 47 | + // NOTE: If this error triggers, either disable it or add |
| 48 | + // your custom components, labels and attributes via these options |
| 49 | + // See https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/label-has-associated-control.md |
| 50 | + controlComponents: ['Input'], |
| 51 | + }, |
| 52 | + ], |
| 53 | + 'jsx-a11y/label-has-for': 0, |
| 54 | + 'jsx-a11y/mouse-events-have-key-events': 2, |
| 55 | + 'jsx-a11y/role-has-required-aria-props': 2, |
| 56 | + 'jsx-a11y/role-supports-aria-props': 2, |
| 57 | + 'max-len': 0, |
| 58 | + 'newline-per-chained-call': 0, |
| 59 | + 'no-confusing-arrow': 0, |
| 60 | + 'no-console': 1, |
| 61 | + 'no-unused-vars': 2, |
| 62 | + 'no-use-before-define': 0, |
| 63 | + 'prefer-template': 2, |
| 64 | + 'react/destructuring-assignment': 0, |
| 65 | + 'react-hooks/rules-of-hooks': 'error', |
| 66 | + 'react/jsx-closing-tag-location': 0, |
| 67 | + 'react/forbid-prop-types': 0, |
| 68 | + 'react/jsx-first-prop-new-line': [2, 'multiline'], |
| 69 | + 'react/jsx-filename-extension': 0, |
| 70 | + 'react/jsx-no-target-blank': 0, |
| 71 | + 'react/jsx-uses-vars': 2, |
| 72 | + 'react/require-default-props': 0, |
| 73 | + 'react/require-extension': 0, |
| 74 | + 'react/self-closing-comp': 0, |
| 75 | + 'react/sort-comp': 0, |
| 76 | + 'redux-saga/no-yield-in-race': 2, |
| 77 | + 'redux-saga/yield-effects': 2, |
| 78 | + 'require-yield': 0, |
| 79 | + }, |
| 80 | + settings: { |
| 81 | + 'import/resolver': { |
| 82 | + webpack: { |
| 83 | + config: './internals/webpack/webpack.prod.babel.js', |
| 84 | + }, |
| 85 | + }, |
| 86 | + }, |
| 87 | +} |
0 commit comments