|
| 1 | +/** |
| 2 | + * Copyright (c) Facebook, Inc. and its affiliates. |
| 3 | + * |
| 4 | + * This source code is licensed under the MIT license found in the |
| 5 | + * LICENSE file in the root directory of this source tree. |
| 6 | + */ |
| 7 | + |
| 8 | +const OFF = 0; |
| 9 | +const WARNING = 1; |
| 10 | +const ERROR = 2; |
| 11 | + |
| 12 | +module.exports = { |
| 13 | + root: true, |
| 14 | + env: { |
| 15 | + browser: true, |
| 16 | + commonjs: true, |
| 17 | + jest: true, |
| 18 | + node: true, |
| 19 | + }, |
| 20 | + parser: '@typescript-eslint/parser', |
| 21 | + parserOptions: { |
| 22 | + allowImportExportEverywhere: true, |
| 23 | + }, |
| 24 | + globals: { |
| 25 | + testStylelintRule: true, |
| 26 | + }, |
| 27 | + extends: [ |
| 28 | + 'eslint:recommended', |
| 29 | + 'plugin:@typescript-eslint/eslint-recommended', |
| 30 | + 'plugin:@typescript-eslint/recommended', |
| 31 | + 'plugin:react-hooks/recommended', |
| 32 | + 'airbnb', |
| 33 | + 'prettier', |
| 34 | + ], |
| 35 | + settings: { |
| 36 | + 'import/resolver': { |
| 37 | + node: { |
| 38 | + extensions: ['.js', '.jsx', '.ts', '.tsx'], |
| 39 | + }, |
| 40 | + }, |
| 41 | + }, |
| 42 | + plugins: ['react-hooks'], |
| 43 | + rules: { |
| 44 | + 'import/extensions': OFF, |
| 45 | + 'no-use-before-define': OFF, |
| 46 | + 'react/jsx-filename-extension': OFF, |
| 47 | + 'jsx-a11y/anchor-is-valid': OFF, |
| 48 | + 'no-console': OFF, |
| 49 | + 'global-require': WARNING, |
| 50 | + 'react/jsx-props-no-spreading': OFF, |
| 51 | + 'import/no-unresolved': [ |
| 52 | + ERROR, |
| 53 | + { |
| 54 | + ignore: [ |
| 55 | + '^@lib', |
| 56 | + '^@hooks', |
| 57 | + '^@/hooks', |
| 58 | + '^@/components', |
| 59 | + '@/lib', |
| 60 | + '@/utils', |
| 61 | + '@/types', |
| 62 | + ], |
| 63 | + }, |
| 64 | + ], |
| 65 | + 'react/react-in-jsx-scope': OFF, |
| 66 | + 'no-param-reassign': [WARNING, { props: false }], |
| 67 | + 'no-undef': OFF, |
| 68 | + '@typescript-eslint/no-namespace': OFF, |
| 69 | + 'import/no-extraneous-dependencies': OFF, |
| 70 | + 'jsx-a11y/label-has-associated-control': OFF, |
| 71 | + 'react/no-array-index-key': OFF, |
| 72 | + '@typescript-eslint/no-explicit-any': OFF, // for now... |
| 73 | + 'react/require-default-props': [ERROR, { ignoreFunctionalComponents: true }], |
| 74 | + '@typescript-eslint/ban-ts-comment': OFF, |
| 75 | + 'react/function-component-definition': [ |
| 76 | + WARNING, |
| 77 | + { |
| 78 | + namedComponents: 'function-declaration', |
| 79 | + unnamedComponents: 'arrow-function', |
| 80 | + }, |
| 81 | + ], |
| 82 | + }, |
| 83 | +}; |
0 commit comments