|
| 1 | +/** |
| 2 | + * This is intended to be a basic starting point for linting in your app. |
| 3 | + * It relies on recommended configs out of the box for simplicity, but you can |
| 4 | + * and should modify this configuration to best suit your team's needs. |
| 5 | + */ |
| 6 | + |
| 7 | +/** @type {import('eslint').Linter.Config} */ |
| 8 | +module.exports = { |
| 9 | + parser: '@typescript-eslint/parser', |
| 10 | + parserOptions: { |
| 11 | + tsconfigRootDir: __dirname, |
| 12 | + sourceType: 'module' |
| 13 | + }, |
| 14 | + plugins: ['@typescript-eslint/eslint-plugin'], |
| 15 | + extends: ['plugin:@typescript-eslint/recommended', 'plugin:prettier/recommended'], |
| 16 | + root: true, |
| 17 | + env: { |
| 18 | + node: true, |
| 19 | + jest: true |
| 20 | + }, |
| 21 | + ignorePatterns: ['.eslintrc.js'], |
| 22 | + overrides: [ |
| 23 | + { |
| 24 | + files: ['**/*.{js,jsx,ts,tsx}'], |
| 25 | + extends: ['plugin:react-hooks/recommended'] |
| 26 | + }, |
| 27 | + |
| 28 | + { |
| 29 | + files: ['**/*.{ts,tsx}'], |
| 30 | + plugins: ['@typescript-eslint', 'import'], |
| 31 | + parser: '@typescript-eslint/parser', |
| 32 | + settings: { |
| 33 | + 'import/internal-regex': '^~/', |
| 34 | + 'import/resolver': { |
| 35 | + node: { |
| 36 | + extensions: ['.ts', '.tsx'] |
| 37 | + }, |
| 38 | + typescript: { |
| 39 | + alwaysTryTypes: true |
| 40 | + } |
| 41 | + } |
| 42 | + }, |
| 43 | + extends: ['plugin:@typescript-eslint/recommended', 'plugin:import/recommended', 'plugin:import/typescript'], |
| 44 | + rules: { |
| 45 | + '@typescript-eslint/interface-name-prefix': 'off', |
| 46 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 47 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 48 | + '@typescript-eslint/no-explicit-any': 'off', |
| 49 | + 'no-alert': ['warn'], |
| 50 | + 'no-debugger': ['warn'], |
| 51 | + 'no-else-return': 'error', |
| 52 | + 'no-multiple-empty-lines': 'off', |
| 53 | + 'require-await': 'error', |
| 54 | + 'react/prop-types': 'off', |
| 55 | + 'no-unused-vars': [ |
| 56 | + 'warn', |
| 57 | + { |
| 58 | + argsIgnorePattern: '^_', |
| 59 | + varsIgnorePattern: '^_', |
| 60 | + caughtErrorsIgnorePattern: '^_' |
| 61 | + } |
| 62 | + ], |
| 63 | + semi: 'off' |
| 64 | + } |
| 65 | + }, |
| 66 | + |
| 67 | + { |
| 68 | + files: ['.eslintrc.cjs'], |
| 69 | + env: { |
| 70 | + node: true |
| 71 | + } |
| 72 | + } |
| 73 | + ] |
| 74 | +} |
0 commit comments