-
Notifications
You must be signed in to change notification settings - Fork 14
/
.eslintrc.js
79 lines (79 loc) · 2.08 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
module.exports = {
env: {
browser: true,
commonjs: true,
es6: true,
jest: true,
node: true,
},
globals: {
window: true,
document: true,
localStorage: true,
FormData: true,
FileReader: true,
Blob: true,
navigator: true,
},
parserOptions: {
project: 'tsconfig.json',
ecmaVersion: 6, // Allows for the parsing of modern ECMAScript features
sourceType: 'module', // Allows for the use of imports
ecmaFeatures: {
jsx: true,
modules: true,
experimentalObjectRestSpread: true,
},
},
parser: '@typescript-eslint/parser', // Specifies the ESLint parser
plugins: ['react', '@typescript-eslint', 'react-hooks'],
extends: [
'plugin:react/recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'plugin:prettier/recommended',
'prettier',
],
settings: {
react: {
version: 'detect', // Tells eslint-plugin-react to automatically detect the version of React to use
},
'import/resolver': {
node: {
moduleDirectory: ['node_modules', '.'],
paths: ['src'],
},
},
},
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'import/named': 'off',
'@typescript-eslint/no-non-null-assertion': "off",
// 'no-nested-ternary': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { varsIgnorePattern: '[Rr]eact' }],
'@typescript-eslint/no-empty-function': 'off',
'max-lines': ['error', { max: 300, skipBlankLines: true, skipComments: true }],
'import/order': [
'error',
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index', 'object'],
alphabetize: {
order: 'asc',
caseInsensitive: false,
},
},
],
'sort-imports': [
'error',
{
ignoreCase: false,
ignoreDeclarationSort: true,
ignoreMemberSort: false,
memberSyntaxSortOrder: ['none', 'all', 'multiple', 'single'],
},
],
},
};