-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
59 lines (58 loc) · 2.81 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
// @ts-check
/* eslint-disable max-len */
import globals from 'globals';
import eslint from '@eslint/js';
import tseslint from 'typescript-eslint';
// ESLint options
export default tseslint.config(
// ESLint recommended rules
eslint.configs.recommended,
// typescript-eslint strict and stylistic rules
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
{
files: ['**/*.ts', 'eslint.config.mjs'],
languageOptions: {
globals: globals.node,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
projectService: true
}
},
rules: {
'@typescript-eslint/explicit-function-return-type': ['error'],
'@typescript-eslint/no-unused-vars': ['error', { args: 'all', argsIgnorePattern: '^_', ignoreRestSiblings: true }],
'@typescript-eslint/restrict-template-expressions': ['error', { allowBoolean: true, allowNullish: true, allowNumber: true}],
'brace-style': ['warn', '1tbs', { allowSingleLine: true }],
'comma-dangle': ['warn', 'never'],
'comma-spacing': ['error'],
'curly': ['off'],
'eqeqeq': ['warn'],
'indent': ['warn', 4, {
SwitchCase: 0,
FunctionDeclaration: { parameters: 'first' },
FunctionExpression: { parameters: 'first' },
CallExpression: { arguments: 'first' },
ImportDeclaration: 'first',
ArrayExpression: 'first',
ignoredNodes: ['ConditionalExpression']
}],
'lines-between-class-members': ['warn', 'always', { exceptAfterSingleLine: true }],
'max-len': ['warn', 140],
'no-trailing-spaces': ['warn'],
'prefer-arrow-callback': ['warn'],
'quotes': ['warn', 'single', { avoidEscape: true }],
'semi': ['warn'],
// Special rules for this project
'@typescript-eslint/unified-signatures': ['error', { ignoreDifferentlyNamedParameters: true }]
}
}, {
files: ['**/*-types.ts'],
rules: {
'@typescript-eslint/consistent-indexed-object-style': 'off'
}
}, {
ignores: [ '**/ti/' ]
}
);