-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
80 lines (80 loc) · 2.32 KB
/
.eslintrc.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
73
74
75
76
77
78
79
80
module.exports = {
env: {
browser: true,
node: true,
es6: true,
mocha: true,
},
extends: [
'standard',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2022,
sourceType: 'module',
},
plugins: ['react', '@typescript-eslint', 'react-hooks', 'prettier'],
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
},
overrides: [
{
files: ['*.ts', '*.tsx'],
rules: {
'@typescript-eslint/no-unused-vars': [2, { args: 'none' }],
'no-unused-expressions': 0,
'@typescript-eslint/no-unused-expressions': 2,
'@typescript-eslint/explicit-module-boundary-types': 0,
},
},
{
files: ['*.ts', '*.ts', '*.tsx', '*.jsx', '*.test.jsx', '*.test.js', '*.test.tsx'],
rules: {
'@typescript-eslint/explicit-module-boundary-types': 0,
'no-use-before-define': 0,
'@typescript-eslint/no-use-before-define': 0,
},
},
{
// enable the rule specifically for TypeScript files
files: ['*.js', '*.ts'],
rules: {
'@typescript-eslint/no-var-requires': 0,
},
},
],
rules: {
'no-console': 0,
'react/jsx-filename-extension': 0,
'lines-between-class-members': [1, 'always'],
'keyword-spacing': [1, { before: true, after: true }],
'object-curly-spacing': [1, 'always'],
'space-before-blocks': 1,
'space-infix-ops': 1,
'arrow-spacing': 1,
'no-var': 1,
'prefer-const': 1,
'array-bracket-newline': [1, { multiline: true }],
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/ban-ts-comment': 0,
'no-unused-expressions': 0,
'@typescript-eslint/no-unused-expressions': ['error', { allowTernary: true, allowShortCircuit: true }],
'react/prop-types': 0,
'react/display-name': 0,
'no-self-assign': 0,
camelcase: 0,
'array-callback-return': 0,
'@typescript-eslint/ban-types': 0,
'react-hooks/exhaustive-deps': 0,
'no-debugger': 0,
},
}