-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
82 lines (82 loc) · 2.53 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
81
82
module.exports = {
root: true,
env: {
browser: true,
es2020: true,
node: true
},
extends: [
'eslint:recommended',
'standard',
'plugin:import/errors',
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:prettier/recommended',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 11,
sourceType: 'module'
},
plugins: ['react', 'react-hooks', '@typescript-eslint', 'import','prettier', 'unused-imports'],
rules: {
"react/react-in-jsx-scope": "off",
'@typescript-eslint/no-use-before-define': 'off', // Allows us to hoist variables and functions which I am a fan of, functions not variables that is.
'@typescript-eslint/no-explicit-any': 'off', // Too strict for my case, sometimes I need an any type
'@typescript-eslint/member-delimiter-style': ['error', { // Prevents us from using any delimiter for interface properties.
'multiline': {
'delimiter': 'none',
'requireLast': false
},
'singleline': {
'delimiter': 'comma',
'requireLast': false
}
}],
'camelcase': 'off',
'@typescript-eslint/indent': 'off', // This is the job of StandardJS, they are competing rules so we turn off the Typescript one.
'no-unused-vars': 'off', // On the fence about using this one, sometimes we import a package that is never used directly.
'node/no-unsupported-features/es-syntax': 'off', // Allows us to use Import and Export keywords.
'prettier/prettier': 'error',
'no-use-before-define': 'off',
'@typescript-eslint/no-use-before-define': ['error'],
'import/no-unresolved': 'off',
'react/jsx-filename-extension': [ 1, {'extensions': ['.tsx']} ],
'import/prefer-default-export': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
"argsIgnorePattern": '_'
}],
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
'no-useless-constructor': 'off',
"no-unused-vars": "off",
"unused-imports/no-unused-imports": "error",
"unused-imports/no-unused-vars": [
"warn",
{
"vars": "all",
"varsIgnorePattern": "^_",
"args": "after-used",
"argsIgnorePattern": "^_",
},
],
"sort-imports": [
"error",
{
"ignoreDeclarationSort": true
}
],
},
settings: {
'import/resolver': {
typescript: {}
},
react: {
version: 'detect',
},
}
}