Skip to content

Commit 5569c03

Browse files
committed
feat: configure eslint with tseslint
1 parent 03d49ed commit 5569c03

File tree

4 files changed

+515
-20
lines changed

4 files changed

+515
-20
lines changed

eslint.config.mjs

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import js from '@eslint/js';
2+
import tseslint from 'typescript-eslint';
3+
import globals from 'globals';
4+
import path from 'node:path';
5+
6+
const __dirname = path.resolve();
7+
8+
export default tseslint.config(js.configs.recommended, ...tseslint.configs.recommended, {
9+
files: ['**/*.ts'],
10+
languageOptions: {
11+
ecmaVersion: 2022,
12+
sourceType: 'module',
13+
parser: tseslint.parser,
14+
parserOptions: {
15+
project: './tsconfig.json',
16+
tsconfigRootDir: __dirname,
17+
},
18+
globals: {
19+
...globals.node,
20+
Parse: 'readonly',
21+
},
22+
},
23+
rules: {
24+
'@typescript-eslint/explicit-function-return-type': 'off',
25+
'@typescript-eslint/no-explicit-any': 'warn',
26+
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
27+
indent: ['error', 2, { SwitchCase: 1 }],
28+
'linebreak-style': ['error', 'unix'],
29+
'no-trailing-spaces': 'error',
30+
'eol-last': 'error',
31+
'space-in-parens': ['error', 'never'],
32+
'no-multiple-empty-lines': 'warn',
33+
'prefer-const': 'error',
34+
'space-infix-ops': 'error',
35+
'no-useless-escape': 'off',
36+
'require-atomic-updates': 'off',
37+
'no-var': 'warn',
38+
'no-await-in-loop': 'warn',
39+
},
40+
});

0 commit comments

Comments
 (0)