Repository navigation
Expand file tree
/
Copy pathcore.js
More file actions
100 lines (99 loc) · 3.27 KB
/
Copy pathcore.js
File metadata and controls
100 lines (99 loc) · 3.27 KB
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
const tsPlugin = require('@typescript-eslint/eslint-plugin');
const tsParser = require('@typescript-eslint/parser');
const preferArrow = require('eslint-plugin-prefer-arrow');
const prettier = require('eslint-config-prettier');
const js = require('@eslint/js');
const globals = require('globals');
module.exports = [
js.configs.recommended,
...tsPlugin.configs['flat/recommended-type-checked'],
...tsPlugin.configs['flat/stylistic-type-checked'],
prettier,
{
plugins: {
'prefer-arrow': preferArrow
},
languageOptions: {
globals: {
...globals.browser,
...globals.es2015,
...globals.node
},
parser: tsParser,
parserOptions: { project: './tsconfig.json' }
},
rules: {
'@typescript-eslint/class-literal-property-style': ['error', 'getters'],
'@typescript-eslint/consistent-generic-constructors': 'error',
'@typescript-eslint/consistent-indexed-object-style': 'warn',
'@typescript-eslint/consistent-type-assertions': 'error',
'@typescript-eslint/dot-notation': 'error',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/naming-convention': [
'warn',
{
selector: 'variable',
format: ['camelCase', 'UPPER_CASE', 'PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid'
},
{
selector: ['property', 'accessor'],
modifiers: ['private'],
format: ['camelCase'],
leadingUnderscore: 'allow'
},
{
selector: ['variable', 'function'],
format: ['camelCase'],
leadingUnderscore: 'allow'
}
],
'@typescript-eslint/no-shadow': [
'error',
{
hoist: 'all'
}
],
'@typescript-eslint/no-unused-expressions': 'error',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/prefer-for-of': 'error',
'@typescript-eslint/prefer-function-type': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/prefer-readonly': 'error',
'@typescript-eslint/restrict-template-expressions': ['error', { allowBoolean: true, allowNumber: true }],
'@typescript-eslint/unified-signatures': 'error',
'dot-notation': 'off',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'linebreak-style': 'off',
'max-classes-per-file': ['error', 1],
'new-parens': ['error', 'always'],
'no-bitwise': 'error',
'no-caller': 'error',
'no-console': ['error', { allow: ['warn', 'error'] }],
'no-empty-function': 'off',
'no-eval': 'error',
'no-new-wrappers': 'error',
'no-shadow': 'off',
'no-throw-literal': 'error',
'no-trailing-spaces': 'error',
'no-undef-init': 'error',
'no-unused-expressions': 'off',
'no-var': 'error',
'object-shorthand': 'error',
'one-var': ['error', 'never'],
'prefer-arrow/prefer-arrow-functions': 'error',
'prefer-const': 'error',
radix: 'error',
'spaced-comment': [
'error',
'always',
{
markers: ['/']
}
]
}
}
];