-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
35 lines (34 loc) · 1.06 KB
/
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
import { fileURLToPath } from 'url'
import { includeIgnoreFile } from '@eslint/compat'
import pluginJs from '@eslint/js'
import globals from 'globals'
import tseslint from 'typescript-eslint'
export default tseslint.config(
includeIgnoreFile(fileURLToPath(new URL('.gitignore', import.meta.url))),
includeIgnoreFile(
fileURLToPath(new URL('.git/info/exclude', import.meta.url))
),
{ files: ['**/*.{js,mjs,cjs,ts,tsx,jsx}'] },
{ languageOptions: { globals: { ...globals.browser, ...globals.node } } },
pluginJs.configs.recommended,
{
name: 'typescript',
extends: tseslint.configs.recommended,
rules: {
'@typescript-eslint/array-type': ['warn', { default: 'generic' }],
// Allow unused vars if prefixed with `_` (https://typescript-eslint.io/rules/no-unused-vars/)
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
},
}
)