|
| 1 | +module.exports = { |
| 2 | + ignorePatterns: ['**/*.css'], |
| 3 | + env: { |
| 4 | + browser: true, |
| 5 | + es6: true, |
| 6 | + node: true, |
| 7 | + }, |
| 8 | + settings: { |
| 9 | + react: { |
| 10 | + version: 'detect', |
| 11 | + }, |
| 12 | + 'import/resolver': { |
| 13 | + node: { |
| 14 | + paths: ['src'], |
| 15 | + extensions: ['.js', '.jsx'], |
| 16 | + }, |
| 17 | + }, |
| 18 | + }, |
| 19 | + extends: [ |
| 20 | + 'airbnb', |
| 21 | + 'plugin:react/recommended', // Uses the recommended rules from @eslint-plugin-react |
| 22 | + 'plugin:react-hooks/recommended', |
| 23 | + 'plugin:react/jsx-runtime', |
| 24 | + 'plugin:import/recommended', |
| 25 | + 'prettier/react', |
| 26 | + 'plugin:prettier/recommended', // use prettier as a eslint rule |
| 27 | + ], |
| 28 | + globals: { |
| 29 | + Atomics: 'readonly', |
| 30 | + SharedArrayBuffer: 'readonly', |
| 31 | + }, |
| 32 | + parser: 'babel-eslint', |
| 33 | + parserOptions: { |
| 34 | + ecmaFeatures: { |
| 35 | + jsx: true, |
| 36 | + }, |
| 37 | + ecmaVersion: 2018, |
| 38 | + sourceType: 'module', |
| 39 | + }, |
| 40 | + plugins: ['react', 'testing-library', 'prettier'], |
| 41 | + rules: { |
| 42 | + 'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }], |
| 43 | + 'no-underscore-dangle': 'off', |
| 44 | + 'react/prop-types': 'off', |
| 45 | + 'react-hooks/exhaustive-deps': 'off', |
| 46 | + 'react/jsx-key': 'off', |
| 47 | + 'react/jsx-uses-react': 'off', |
| 48 | + 'react/display-name': 'off', |
| 49 | + 'react/no-direct-mutation-state': 'off', |
| 50 | + 'react/no-unknown-property': 'off', |
| 51 | + 'react/destructuring-assignment': 'off', |
| 52 | + 'react/react-in-jsx-scope': 'off', |
| 53 | + 'import/no-duplicates': 'off', |
| 54 | + 'import/no-named-as-default': 'off', |
| 55 | + 'jsx-a11y/label-has-associated-control': 'off', |
| 56 | + 'jsx-a11y/no-static-element-interactions': 'off', |
| 57 | + 'jsx-a11y/click-events-have-key-events': 'off', |
| 58 | + 'jsx-a11y/control-has-associated-label': 'off', |
| 59 | + 'no-alert': 'error', |
| 60 | + 'no-console': 'error', |
| 61 | + 'import/no-extraneous-dependencies': ['error', { devDependencies: true }], |
| 62 | + }, |
| 63 | + overrides: [ |
| 64 | + { |
| 65 | + files: ['**/*.test.js', '**/*.test.jsx'], |
| 66 | + env: { |
| 67 | + jest: true, |
| 68 | + }, |
| 69 | + }, |
| 70 | + ], |
| 71 | +}; |
0 commit comments