-
Notifications
You must be signed in to change notification settings - Fork 46
/
.eslintrc.cjs
95 lines (93 loc) · 2.44 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
const extendsBase = [
'eslint:recommended',
'plugin:react/recommended',
'plugin:prettier/recommended',
'plugin:tailwindcss/recommended',
];
const extendsTypescript = [
...extendsBase,
'plugin:@typescript-eslint/recommended',
];
module.exports = {
env: {
browser: true,
es2020: true,
jest: true,
node: true,
},
settings: {
react: {
version: 'detect',
},
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 11,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
extends: extendsBase,
plugins: [
'react',
'react-hooks',
'@typescript-eslint',
'tailwindcss',
'prettier',
],
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'react/prop-types': 'off',
'react/react-in-jsx-scope': 'off',
'tailwindcss/classnames-order': 'warn',
'tailwindcss/no-custom-classname': 'off',
'tailwindcss/no-contradicting-classname': 'error',
'prettier/prettier': 'error',
'block-scoped-var': 'error',
eqeqeq: ['error', 'always', {null: 'ignore'}],
'no-var': 'error',
'prefer-const': 'error',
'eol-last': 'error',
'prefer-arrow-callback': 'error',
'no-trailing-spaces': 'error',
quotes: ['warn', 'single', {avoidEscape: true}],
'no-restricted-properties': [
'error',
{
object: 'describe',
property: 'only',
},
{
object: 'it',
property: 'only',
},
],
},
overrides: [
{
files: ['**/*.ts', '**/*.tsx'],
extends: extendsTypescript,
rules: {
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/no-use-before-define': 'off',
'@typescript-eslint/no-warning-comments': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/camelcase': 'off',
'node/no-missing-import': 'off',
'node/no-empty-function': 'off',
'node/no-unsupported-features/es-syntax': 'off',
'node/no-missing-require': 'off',
'node/shebang': 'off',
'no-dupe-class-members': 'off',
'require-atomic-updates': 'off',
'react/prop-types': 'off',
},
},
],
};