-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
127 lines (125 loc) · 3.71 KB
/
index.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
module.exports = {
root: true,
parserOptions: {
ecmaVersion: 2022,
},
reportUnusedDisableDirectives: true,
overrides: [
{
files: ['*.js'],
// For now, require .js files (like .eslintrc.js) only to be formatted using Prettier.
plugins: ['prettier'],
extends: ['plugin:prettier/recommended'],
rules: {
'prettier/prettier': 'warn',
},
},
{
files: ['*.ts'],
parserOptions: {
project: './tsconfig.json',
},
extends: [
'eslint:recommended',
'plugin:import/recommended',
'plugin:import/typescript',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:prettier/recommended',
],
rules: {
'prettier/prettier': 'warn',
'@typescript-eslint/consistent-type-assertions': [
'error',
{
assertionStyle: 'as',
},
],
'@typescript-eslint/consistent-type-definitions': [
'error',
'interface',
],
'@typescript-eslint/explicit-function-return-type': 'error',
'@typescript-eslint/explicit-member-accessibility': [
'error',
{
accessibility: 'no-public',
},
],
'@typescript-eslint/member-ordering': [
'warn',
{
classes: ['field', 'constructor', 'method'],
},
],
'@typescript-eslint/naming-convention': [
'error',
{
selector: ['class', 'interface', 'typeAlias'],
format: ['PascalCase'],
},
],
'@typescript-eslint/no-unnecessary-condition': 'error',
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-includes': 'error',
'@typescript-eslint/prefer-string-starts-ends-with': 'error',
'@typescript-eslint/strict-boolean-expressions': 'error',
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'accessor-pairs': 'error',
'array-callback-return': 'error',
curly: 'error',
'default-case-last': 'error',
'default-param-last': 'error',
'dot-notation': 'warn',
eqeqeq: ['error', 'always', { null: 'never' }],
'guard-for-in': 'error',
'no-constructor-return': 'error',
'no-else-return': 'error',
'no-extra-bind': 'error',
'no-lone-blocks': 'error',
'no-new-wrappers': 'error',
'no-nested-ternary': 'error',
'no-restricted-globals': [
'error',
{ name: 'parseInt', message: `Use 'Number.parseInt()' instead.` },
{ name: 'parseFloat', message: `Use 'Number.parseFloat()' instead.` },
],
'no-self-compare': 'error',
'no-throw-literal': 'error',
'no-useless-rename': 'error',
'no-useless-return': 'error',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-cycle': 'error',
'import/no-unresolved': ['error'],
'import/order': [
'warn',
{
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
warnOnUnassignedImports: true,
},
],
'no-unreachable-loop': 'error',
radix: 'error',
'require-atomic-updates': 'error',
'sort-imports': [
'warn',
{
ignoreDeclarationSort: true,
},
],
'spaced-comment': ['warn', 'always'],
'valid-typeof': [
'error',
{
requireStringLiterals: true,
},
],
},
},
],
};