-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
65 lines (63 loc) · 1.96 KB
/
eslint.config.mjs
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
import pluginEslintImport from 'eslint-plugin-import';
import pluginTypescriptEslint from '@typescript-eslint/eslint-plugin';
import tsParser from '@typescript-eslint/parser';
export default [
{
// the "ignores" patterns have to be defined as the only key of a config object
// see: https://eslint.org/docs/latest/use/configure/ignore#ignoring-directories
ignores: ['dist', '.coverage', '.vscode', '.idea'],
},
{
languageOptions: {
parser: tsParser,
parserOptions: {
project: ['./tsconfig.eslint.json'],
},
},
files: ['{src,tests}/**/*.{js,ts,yml,yaml}'],
plugins: {
'@typescript-eslint': pluginTypescriptEslint,
import: pluginEslintImport,
},
rules: {
// Use the TypeScript port of 'no-unused-vars' to prevent false positives on abstract methods parameters
// while keeping consistency with TS native behavior of ignoring parameters starting with '_'.
// https://typescript-eslint.io/rules/no-unused-vars/
'no-unused-vars': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
// eslint-plugin-import
'import/no-default-export': 'error',
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
'import/first': ['error'],
'import/exports-last': ['error'],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
'newlines-between': 'always',
alphabetize: { order: 'asc', caseInsensitive: true },
},
],
},
},
];