-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy patheslint.config.js
98 lines (93 loc) · 3.45 KB
/
eslint.config.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
//@ts-check
import eslint from '@eslint/js';
import eslintConfigPrettier from 'eslint-config-prettier';
//@ts-expect-error: no types
import importPlugin from 'eslint-plugin-import';
import tseslint from 'typescript-eslint';
export default tseslint.config(
eslint.configs.recommended,
tseslint.configs.recommendedTypeChecked,
// tseslint.configs.strictTypeChecked,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
eslintConfigPrettier,
{
ignores: ['dist', '.yarn', 'node_modules', '*.nnb', 'tooltips*'],
languageOptions: {
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: './tsconfig.eslint.json'
}
},
rules: {
'no-return-await': 'off',
'@typescript-eslint/no-empty-interface': 'off',
'no-mixed-spaces-and-tabs': 'off',
'no-duplicate-imports': 'warn',
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': 'off',
'no-empty': 'off',
'@typescript-eslint/ban-ts-comment': [
'error',
{
'ts-expect-error': 'allow-with-description',
'ts-ignore': 'allow-with-description',
'ts-nocheck': 'allow-with-description',
'ts-check': false,
'minimumDescriptionLength': 5
}
],
'@typescript-eslint/no-floating-promises': 'warn',
'prefer-promise-reject-errors': 'warn',
'@typescript-eslint/no-misused-promises': 'error',
'@typescript-eslint/no-base-to-string': 'error',
'no-loss-of-precision': 'off',
'@typescript-eslint/no-loss-of-precision': 'error',
'no-throw-literal': 'off',
'@typescript-eslint/only-throw-error': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'warn',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-non-null-assertion': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'prefer-template': 'warn',
'@typescript-eslint/no-this-alias': ['error', { allowDestructuring: true, allowedNames: ['that'] }],
'@typescript-eslint/no-unused-vars': [
'warn',
{
argsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_'
}
],
'no-implied-eval': 'off',
'@typescript-eslint/no-implied-eval': ['error'],
'@typescript-eslint/no-deprecated': 'warn',
'@typescript-eslint/explicit-member-accessibility': ['warn', { accessibility: 'explicit' }],
'@typescript-eslint/switch-exhaustiveness-check': 'warn',
'@typescript-eslint/no-restricted-imports': [
'error',
{ paths: [{ name: 'console', importNames: ['assert'], message: 'Import from the `assert` module instead.' }] }
],
'@typescript-eslint/no-namespace': 'off',
'no-debugger': 'warn',
'@typescript-eslint/prefer-as-const': 'warn',
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/no-inferrable-types': 'off',
'@typescript-eslint/no-unsafe-declaration-merging': 'off',
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
'@typescript-eslint/restrict-template-expressions': 'off',
'@typescript-eslint/no-unnecessary-type-assertion': 'warn',
'@typescript-eslint/require-await': 'warn',
'@typescript-eslint/no-unused-expressions': 'warn',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-redundant-type-constituents': 'warn',
'prefer-const': 'warn',
'import/no-unresolved': 'off', // until it supports subpath imports
'import/extensions': ['error', 'ignorePackages'],
'import/no-cycle': 'error',
'no-warning-comments': 'warn'
}
}
);