|
| 1 | +/** @type {import('eslint').ESLint.ConfigData} */ |
| 2 | +module.exports = { |
| 3 | + root: true, |
| 4 | + overrides: [ |
| 5 | + { |
| 6 | + files: ['*.ts', '*.tsx'], |
| 7 | + parser: '@typescript-eslint/parser', |
| 8 | + parserOptions: { |
| 9 | + project: true, |
| 10 | + tsconfigRootDir: __dirname, |
| 11 | + }, |
| 12 | + plugins: ['tsdoc'], |
| 13 | + extends: [ |
| 14 | + 'plugin:@typescript-eslint/recommended-type-checked', |
| 15 | + 'plugin:prettier/recommended', |
| 16 | + ], |
| 17 | + rules: { |
| 18 | + '@typescript-eslint/no-unsafe-call': 'off', |
| 19 | + '@typescript-eslint/no-unsafe-member-access': 'off', |
| 20 | + '@typescript-eslint/no-unsafe-return': 'off', |
| 21 | + '@typescript-eslint/no-unsafe-assignment': 'off', |
| 22 | + '@typescript-eslint/no-unsafe-argument': 'off', |
| 23 | + '@typescript-eslint/no-explicit-any': 'warn', |
| 24 | + '@typescript-eslint/ban-ts-comment': [ |
| 25 | + 'error', |
| 26 | + { |
| 27 | + 'ts-ignore': 'allow-with-description', |
| 28 | + 'ts-expect-error': 'allow-with-description', |
| 29 | + }, |
| 30 | + ], |
| 31 | + '@typescript-eslint/no-unused-vars': [ |
| 32 | + 'error', |
| 33 | + { argsIgnorePattern: '^_' }, |
| 34 | + ], |
| 35 | + '@typescript-eslint/no-var-requires': 'off', |
| 36 | + '@typescript-eslint/no-non-null-assertion': 'off', |
| 37 | + '@typescript-eslint/no-duplicate-type-constituents': 'error', |
| 38 | + '@typescript-eslint/no-shadow': 'error', |
| 39 | + 'tsdoc/syntax': 'error', |
| 40 | + 'prettier/prettier': [ |
| 41 | + 'error', |
| 42 | + { |
| 43 | + plugins: ['prettier-plugin-jsdoc'], |
| 44 | + bracketSameLine: true, |
| 45 | + printWidth: 80, |
| 46 | + singleQuote: true, |
| 47 | + trailingComma: 'es5', |
| 48 | + tabWidth: 2, |
| 49 | + arrowParens: 'always', |
| 50 | + }, |
| 51 | + ], |
| 52 | + }, |
| 53 | + }, |
| 54 | + { |
| 55 | + files: ['*.js', '*.jsx'], |
| 56 | + plugins: ['jsdoc'], |
| 57 | + extends: ['plugin:jsdoc/recommended'], |
| 58 | + rules: { |
| 59 | + 'jsdoc/tag-lines': 'off', |
| 60 | + }, |
| 61 | + }, |
| 62 | + ], |
| 63 | + parserOptions: { |
| 64 | + requireConfigFile: false, |
| 65 | + }, |
| 66 | + extends: [ |
| 67 | + 'standard', |
| 68 | + 'prettier', |
| 69 | + 'plugin:import/typescript', |
| 70 | + 'plugin:react-hooks/recommended', |
| 71 | + ], |
| 72 | + plugins: ['react', 'react-native', 'import', 'jest', '@typescript-eslint'], |
| 73 | + env: { |
| 74 | + 'react-native/react-native': true, |
| 75 | + 'jest/globals': true, |
| 76 | + }, |
| 77 | + settings: { |
| 78 | + 'import/resolver': { |
| 79 | + 'babel-module': { |
| 80 | + extensions: ['.js', '.jsx', '.ts', '.tsx'], |
| 81 | + }, |
| 82 | + }, |
| 83 | + }, |
| 84 | + rules: { |
| 85 | + 'object-shorthand': 'error', |
| 86 | + 'curly': ['error', 'all'], |
| 87 | + 'no-case-declarations': 'error', |
| 88 | + 'import/no-unresolved': 'error', |
| 89 | + 'import/consistent-type-specifier-style': ['error', 'prefer-top-level'], |
| 90 | + 'react/jsx-uses-vars': 'error', |
| 91 | + 'react/jsx-uses-react': 'error', |
| 92 | + 'no-use-before-define': 'off', |
| 93 | + 'eqeqeq': 'error', |
| 94 | + 'no-unreachable': 'error', |
| 95 | + 'jest/no-disabled-tests': 'warn', |
| 96 | + 'jest/no-focused-tests': 'error', |
| 97 | + 'jest/no-identical-title': 'error', |
| 98 | + 'jest/prefer-to-have-length': 'warn', |
| 99 | + 'jest/valid-expect': 'error', |
| 100 | + 'react/react-in-jsx-scope': 'off', |
| 101 | + }, |
| 102 | +}; |
0 commit comments