|
| 1 | +module.exports = { |
| 2 | + // For JavaScript |
| 3 | + root: true, |
| 4 | + env: { |
| 5 | + browser: true, |
| 6 | + es6: true, |
| 7 | + jest: true, |
| 8 | + node: true, |
| 9 | + }, |
| 10 | + extends: [ |
| 11 | + require.resolve('eslint-config-airbnb-base'), |
| 12 | + 'plugin:@typescript-eslint/recommended', |
| 13 | + 'plugin:prettier/recommended', |
| 14 | + 'prettier/@typescript-eslint', |
| 15 | + ], |
| 16 | + parser: '@typescript-eslint/parser', |
| 17 | + parserOptions: { |
| 18 | + ecmaVersion: 2020, |
| 19 | + sourceType: 'module', |
| 20 | + }, |
| 21 | + plugins: ['@typescript-eslint', 'prettier'], |
| 22 | + rules: { |
| 23 | + 'class-methods-use-this': 0, |
| 24 | + eqeqeq: 0, |
| 25 | + 'func-names': 0, |
| 26 | + 'global-require': 0, |
| 27 | + 'import/extensions': [ |
| 28 | + 2, |
| 29 | + 'ignorePackages', |
| 30 | + { |
| 31 | + js: 'never', |
| 32 | + ts: 'never', |
| 33 | + }, |
| 34 | + ], |
| 35 | + 'import/no-dynamic-require': 0, |
| 36 | + 'import/no-extraneous-dependencies': [2, { devDependencies: true }], |
| 37 | + 'import/prefer-default-export': 0, |
| 38 | + 'lines-between-class-members': [2, 'always', { exceptAfterSingleLine: true }], |
| 39 | + 'no-console': 0, |
| 40 | + 'no-nested-ternary': 0, |
| 41 | + 'no-param-reassign': 0, |
| 42 | + 'no-plusplus': [2, { allowForLoopAfterthoughts: true }], |
| 43 | + 'no-template-curly-in-string': 0, // for yup interpolation |
| 44 | + 'no-undef': 0, |
| 45 | + 'no-underscore-dangle': 0, |
| 46 | + 'no-use-before-define': 0, |
| 47 | + |
| 48 | + '@typescript-eslint/explicit-module-boundary-types': 0, |
| 49 | + '@typescript-eslint/no-explicit-any': 0, |
| 50 | + '@typescript-eslint/no-var-requires': 0, |
| 51 | + '@typescript-eslint/no-use-before-define': 0, |
| 52 | + '@typescript-eslint/no-unused-vars': [ |
| 53 | + 2, |
| 54 | + { |
| 55 | + argsIgnorePattern: '^_', |
| 56 | + }, |
| 57 | + ], |
| 58 | + }, |
| 59 | + |
| 60 | + settings: { |
| 61 | + 'import/parsers': { |
| 62 | + '@typescript-eslint/parser': ['.ts'], |
| 63 | + }, |
| 64 | + 'import/resolver': { |
| 65 | + node: { |
| 66 | + extensions: ['.js', '.json', '.ts', '.d.ts'], |
| 67 | + }, |
| 68 | + typescript: { |
| 69 | + /* project: ['tsconfig.json', 'packages/ * /tsconfig.json'], */ |
| 70 | + }, |
| 71 | + }, |
| 72 | + }, |
| 73 | + |
| 74 | + // For TypeScript |
| 75 | + overrides: [ |
| 76 | + { |
| 77 | + files: ['**/*.ts'], |
| 78 | + rules: { |
| 79 | + '@typescript-eslint/explicit-module-boundary-types': [ |
| 80 | + 1, |
| 81 | + { |
| 82 | + allowArgumentsExplicitlyTypedAsAny: true, |
| 83 | + }, |
| 84 | + ], |
| 85 | + }, |
| 86 | + }, |
| 87 | + ], |
| 88 | +}; |
0 commit comments