|
| 1 | +import { jestMutation, prettierMutation } from '../eslint.utils'; |
| 2 | +import { Config } from './config.interface'; |
| 3 | + |
| 4 | +export const reactTsConfig: Config = { |
| 5 | + dependencies: [ |
| 6 | + '@typescript-eslint/eslint-plugin', |
| 7 | + '@typescript-eslint/parser', |
| 8 | + 'eslint-plugin-beautiful-sort', |
| 9 | + 'eslint-config-airbnb', |
| 10 | + 'eslint-config-airbnb-typescript', |
| 11 | + ], |
| 12 | + eslintConfig: { |
| 13 | + parser: '@typescript-eslint/parser', |
| 14 | + parserOptions: { |
| 15 | + project: 'tsconfig.json', |
| 16 | + sourceType: 'module', |
| 17 | + }, |
| 18 | + plugins: ['@typescript-eslint/eslint-plugin', 'beautiful-sort'], |
| 19 | + extends: ['plugin:@typescript-eslint/recommended', 'airbnb', 'airbnb-typescript'], |
| 20 | + root: true, |
| 21 | + env: { |
| 22 | + es6: true, |
| 23 | + browser: true, |
| 24 | + node: true, |
| 25 | + }, |
| 26 | + ignorePatterns: ['.eslintrc.js'], |
| 27 | + rules: { |
| 28 | + '@typescript-eslint/interface-name-prefix': 'off', |
| 29 | + '@typescript-eslint/explicit-function-return-type': 'off', |
| 30 | + '@typescript-eslint/explicit-module-boundary-types': 'off', |
| 31 | + '@typescript-eslint/no-explicit-any': 'warn', |
| 32 | + '@typescript-eslint/no-floating-promises': 'warn', |
| 33 | + '@typescript-eslint/no-empty-interface': 'warn', |
| 34 | + 'no-param-reassign': 'warn', |
| 35 | + '@typescript-eslint/ban-types': 'warn', |
| 36 | + 'max-classes-per-file': ['error', 2], |
| 37 | + |
| 38 | + 'react/react-in-jsx-scope': 'off', |
| 39 | + 'react/jsx-props-no-spreading': 'off', |
| 40 | + 'react/function-component-definition': 'off', |
| 41 | + 'react/no-invalid-html-attribute': 'warn', |
| 42 | + 'react/display-name': 'warn', |
| 43 | + 'import/prefer-default-export': 'off', |
| 44 | + 'react/require-default-props': 'off', |
| 45 | + 'react/no-array-index-key': 'warn', |
| 46 | + |
| 47 | + 'beautiful-sort/import': [ |
| 48 | + 'error', |
| 49 | + { |
| 50 | + special: ['react'], |
| 51 | + order: ['special', 'namespace', 'default', 'defaultObj', 'obj', 'none'], |
| 52 | + }, |
| 53 | + ], |
| 54 | + }, |
| 55 | + }, |
| 56 | + scripts: [ |
| 57 | + { name: 'lint', script: 'eslint "src/**/*.{ts,tsx}"' }, |
| 58 | + { name: 'lint:fix', script: 'eslint "src/**/*.{ts,tsx}" --fix' }, |
| 59 | + ], |
| 60 | + mutations: [prettierMutation, jestMutation], |
| 61 | +}; |
0 commit comments