-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy patheslint.config.js
39 lines (37 loc) · 1006 Bytes
/
eslint.config.js
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
import { fileURLToPath } from 'node:url'
import { readFileSync } from 'node:fs'
import { includeIgnoreFile } from '@eslint/compat'
import js from '@eslint/js'
import ts from 'typescript-eslint'
import globals from 'globals'
import prettier from 'eslint-config-prettier'
import prettierPlugin from 'eslint-plugin-prettier'
const gitignorePath = fileURLToPath(new URL('./.gitignore', import.meta.url))
const prettierConfig = JSON.parse(readFileSync(new URL('./.prettierrc', import.meta.url)))
export default ts.config(
includeIgnoreFile(gitignorePath),
js.configs.recommended,
...ts.configs.recommended,
prettier,
{
languageOptions: {
globals: {
...globals.node
}
},
plugins: {
prettier: prettierPlugin
},
rules: {
'prettier/prettier': ['error', prettierConfig],
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', { argsIgnorePattern: '^_' }]
}
},
{
files: ['**/*.ts'],
languageOptions: {
parser: ts.parser
}
}
)