-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
108 lines (107 loc) · 2.96 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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
const OFF = 0;
const WARNING = 1;
const ERROR = 2;
module.exports = {
settings: {
react: {
version: 'detect',
}
},
env: {
browser: true,
jest: true,
es6: true,
jasmine: true
},
parser: '@typescript-eslint/parser',
plugins: [
'import',
'eslint-plugin-no-inline-styles',
'jasmine'
],
extends: [
'eslint:recommended',
'plugin:prettier/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:import/warnings',
'plugin:jasmine/recommended',
'plugin:@typescript-eslint/recommended',
],
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module'
},
rules: {
'no-console': process.env.NODE_ENV === 'production' ? ERROR : WARNING,
'no-eval': ERROR,
'import/first': ERROR,
'react-hooks/rules-of-hooks': ERROR,
'react-hooks/exhaustive-deps': ERROR,
'max-params': [ERROR, 3],
'no-debugger': ERROR,
'no-nested-ternary': ERROR,
'object-shorthand': ERROR,
'semi': [ERROR, 'always'],
'no-extra-semi': OFF,
'quotes': [ERROR, 'single', { 'avoidEscape': true }],
'import/order': [
ERROR,
{
groups: ['builtin', 'external', 'internal', 'parent', 'sibling'],
pathGroups: [
{
pattern: 'react',
group: 'external',
position: 'before'
},
{
pattern: '@/**',
group: 'internal'
}
],
pathGroupsExcludedImportTypes: ['react'],
'newlines-between': 'always',
alphabetize: {order: 'ignore'}
}
],
'import/extensions': [ERROR, 'never', {
scss: 'always',
json: 'always',
png: 'always'
}],
'no-inline-styles/no-inline-styles': ERROR,
'no-unused-vars': ERROR,
'no-use-before-define': OFF,
'import/no-anonymous-default-export': ERROR,
'react/prop-types': OFF,
'react/display-name': OFF,
'@typescript-eslint/no-unused-vars': ERROR,
'@typescript-eslint/naming-convention': [
ERROR,
{selector: 'typeAlias', format: ['PascalCase'], prefix: ['T']},
{selector: 'interface', format: ['PascalCase'], prefix: ['I']}
],
'@typescript-eslint/no-extra-semi': ERROR,
'@typescript-eslint/no-non-null-assertion': ERROR,
'@typescript-eslint/ban-ts-comment': [
ERROR,
{
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
minimumDescriptionLength: 10
},
],
'@typescript-eslint/explicit-module-boundary-types': OFF,
'@typescript-eslint/no-explicit-any': OFF,
'jasmine/new-line-between-declarations': ERROR,
'jasmine/new-line-before-expect': ERROR,
'jasmine/prefer-toHaveBeenCalledWith': ERROR,
'jasmine/expect-matcher': ERROR,
'jasmine/prefer-jasmine-matcher': ERROR,
'jasmine/no-disabled-tests': ERROR,
'jasmine/no-suite-dupes': [ERROR, 'branch'],
'jasmine/no-spec-dupes': [ERROR, 'branch'],
'jasmine/no-unsafe-spy': ERROR
},
}