-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
67 lines (63 loc) · 1.8 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
module.exports = {
root: true,
extends: ['noftalint/typescript'],
parser: '@typescript-eslint/parser',
plugins: ['@typescript-eslint', 'deprecation'],
ignorePatterns: ['node_modules/', 'dist/'],
reportUnusedDisableDirectives: true,
parserOptions: {
project: './tsconfig.eslint.json',
},
rules: {
'deprecation/deprecation': 'warn',
// It cannot resolve TypeScript's path aliases. See https://github.com/mysticatea/eslint-plugin-node/issues/233
'node/no-missing-import': 'off',
// Incorrectly reports some ESNext core-js polyfills.
'unicorn/no-unnecessary-polyfills': 'off',
'no-await-in-loop': 'off',
'no-irregular-whitespace': ['error', {
skipStrings: true,
skipTemplates: true,
}],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
'import/resolver': {
typescript: {
alwaysTryTypes: true,
},
},
},
overrides: [
{
files: './src/lib/decorators/**.ts',
rules: {
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/naming-convention': [
...require('eslint-config-noftalint/rules/typescript').rules['@typescript-eslint/naming-convention'],
{
selector: 'function',
modifiers: ['exported'],
format: ['PascalCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
{
selector: 'function',
modifiers: ['global'],
format: ['camelCase'],
leadingUnderscore: 'forbid',
trailingUnderscore: 'forbid',
},
],
},
},
],
globals: {
PromiseRejectedResult: 'readonly',
PromiseSettledResult: 'readonly',
PromiseFulfilledResult: 'readonly',
},
};