-
Notifications
You must be signed in to change notification settings - Fork 432
/
Copy patheslint.config.ts
47 lines (45 loc) · 1.26 KB
/
eslint.config.ts
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 type { FlatConfig } from '@typescript-eslint/utils/ts-eslint';
import prettier from 'eslint-plugin-prettier';
import tsParser from '@typescript-eslint/parser';
import typescriptEslintPlugin from '@typescript-eslint/eslint-plugin';
const eslintConfig: FlatConfig.Config = {
files: ['**/*.{ts,mts,tsx}'],
ignores: ['node_modules/**'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: tsParser,
globals: {
node: true,
es2021: true,
},
},
plugins: {
'@typescript-eslint': typescriptEslintPlugin,
prettier,
},
rules: {
'prettier/prettier': [
'error',
{
printWidth: 100,
tabWidth: 2,
useTabs: false,
singleQuote: true,
semi: true,
quoteProps: 'as-needed',
trailingComma: 'all',
bracketSpacing: true,
bracketSameLine: false,
arrowParens: 'always',
endOfLine: 'lf',
proseWrap: 'preserve',
},
],
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }],
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
},
};
export default [eslintConfig];