-
Notifications
You must be signed in to change notification settings - Fork 1
/
eslint.config.js
72 lines (71 loc) · 2.16 KB
/
eslint.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import eslint from '@eslint/js';
import eslintFunctional from 'eslint-plugin-functional';
import eslintImport from 'eslint-plugin-import';
import {
config as eslintTypescriptConfig,
configs as eslintTypescriptConfigs,
parser as eslintTypescriptParser,
} from 'typescript-eslint';
import eslintUnusedImports from 'eslint-plugin-unused-imports';
import eslintReact from 'eslint-plugin-react';
import eslintReactHooks from 'eslint-plugin-react-hooks';
import eslintTailwindcss from 'eslint-plugin-tailwindcss';
export default eslintTypescriptConfig({
extends: [
eslint.configs.recommended,
eslintImport.flatConfigs.react,
eslintImport.flatConfigs.recommended,
eslintImport.flatConfigs.typescript,
eslintReact.configs.flat.recommended,
eslintReact.configs.flat['jsx-runtime'],
eslintTailwindcss.configs['flat/recommended'],
eslintTypescriptConfigs.strict,
],
plugins: {
functional: eslintFunctional,
'unused-imports': eslintUnusedImports,
'react-hooks': eslintReactHooks,
},
languageOptions: {
parser: eslintTypescriptParser,
parserOptions: {
project: './tsconfig.eslint.json',
},
},
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'linebreak-style': ['error', 'unix'],
'no-constant-condition': ['error', { checkLoops: false }],
quotes: ['error', 'single', { avoidEscape: true }],
semi: ['error', 'always'],
'@typescript-eslint/consistent-type-imports': 'error',
'functional/immutable-data': 'error',
'functional/no-let': 'error',
'functional/prefer-tacit': 'error',
'import/order': 'error',
'no-param-reassign': 'error',
'no-var': 'error',
'prefer-const': 'error',
'unused-imports/no-unused-imports': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
},
settings: {
'import/resolver': {
typescript: true,
node: {
extensions: ['.cjs', '.d.ts', '.js', '.jsx', '.mjs', '.ts', '.tsx'],
},
},
react: {
version: 'detect',
},
},
});