-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.cjs
97 lines (93 loc) · 2.48 KB
/
.eslintrc.cjs
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
'plugin:tailwindcss/recommended',
'prettier',
],
ignorePatterns: [
'dist',
'.eslintrc.cjs',
'node_modules',
'*.config.ts',
'*.config.js',
'generated',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
project: true,
tsconfigRootDir: __dirname,
warnOnUnsupportedTypeScriptVersion: false,
ecmaFeatures: {
jsx: true,
},
},
plugins: [
'react-refresh',
'simple-import-sort',
'react',
'typescript-sort-keys',
'sort-destructure-keys',
'react-hooks',
'prettier',
],
settings: {
react: {
pragma: 'React',
version: '18.0',
},
},
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
'no-dupe-args': 'error',
'no-dupe-else-if': 'error',
'no-dupe-keys': 'error',
//Typescript
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/sort-type-constituents': 'error',
'@typescript-eslint/sort-type-constituents': 'error',
//Simple-import-sort
'simple-import-sort/imports': [
'error',
{
groups: [
// Packages `react` related packages come first.
['^react', '^@?w'],
// Internal packages.
['^(@|src)(/.*|$)'],
// Side effect imports.
['^u0000'],
// Parent imports. Put `..` last.
['^..(?!/?$)', '^../?$'],
// Other relative imports. Put same-folder imports and `.` last.
['^./(?=.*/)(?!/?$)', '^.(?!/?$)', '^./?$'],
// Style imports.
['^.+.?(css)$'],
],
},
],
'simple-import-sort/exports': 'error',
//Format
'prettier/prettier': 'error',
'typescript-sort-keys/interface': 'error',
'typescript-sort-keys/string-enum': 'error',
'sort-destructure-keys/sort-destructure-keys': 'error',
//React
'react/react-in-jsx-scope': 'off',
'react/boolean-prop-naming': 'error',
'react/hook-use-state': 'error',
'react/jsx-sort-props': 'error',
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'error',
'tailwindcss/no-custom-classname': 'off',
},
}