-
-
Notifications
You must be signed in to change notification settings - Fork 5.4k
/
Copy patheslint.config.mjs
47 lines (45 loc) · 1.33 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
import js from '@eslint/js';
import tseslint from 'typescript-eslint';
import globals from 'globals';
import path from 'node:path';
const __dirname = path.resolve();
export default tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.ts'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
parser: tseslint.parser,
parserOptions: {
project: ['./tsconfig.json', './spec/tsconfig.json'],
tsconfigRootDir: __dirname,
},
globals: {
...globals.node,
Parse: 'readonly',
},
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
indent: ['error', 2, { SwitchCase: 1 }],
'linebreak-style': ['error', 'unix'],
'no-trailing-spaces': 'error',
'eol-last': 'error',
'space-in-parens': ['error', 'never'],
'no-multiple-empty-lines': 'warn',
'prefer-const': 'error',
'space-infix-ops': 'error',
'no-useless-escape': 'off',
'require-atomic-updates': 'off',
'no-var': 'warn',
'no-await-in-loop': 'warn',
},
},
{
ignores: ['dist/**/*', 'logs/**/*', 'public/**/*', 'release.config.js'],
}
);