This repository was archived by the owner on Jun 17, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy patheslint.config.mjs
More file actions
101 lines (88 loc) · 2.69 KB
/
eslint.config.mjs
File metadata and controls
101 lines (88 loc) · 2.69 KB
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import globals from 'globals'
import path from 'node:path'
import js from '@eslint/js'
import tsParser from '@typescript-eslint/parser'
import tsPlugin from '@typescript-eslint/eslint-plugin'
import { fileURLToPath } from 'node:url'
import { FlatCompat } from '@eslint/eslintrc'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory : __dirname,
recommendedConfig : js.configs.recommended,
allConfig : js.configs.all
})
export default [
{
ignores: [
'.github',
'contrib',
'demo',
'docs',
'node_modules',
'scripts',
'test',
'eslint.config.mjs',
'rollup.config.ts'
]
},
{
languageOptions: {
globals: {
...globals.node,
...globals.browser,
},
ecmaVersion : 'latest',
sourceType : 'module',
parser : tsParser,
parserOptions : {
project : ['./tsconfig.json'],
tsconfigRootDir : process.cwd()
},
},
plugins: {
'@typescript-eslint' : tsPlugin,
},
files: ["src/**/*.ts"],
rules: {
semi : [2, 'never'],
'one-var' : 'off',
'return-await' : 'off',
indent : 'off',
'no-multi-spaces' : 'off',
'operator-linebreak' : 'off',
'array-bracket-spacing' : ['error', 'always'],
'key-spacing': ['error', {
multiLine: {
beforeColon: true,
afterColon: true,
},
align: {
beforeColon: true,
afterColon: true,
},
}],
'@typescript-eslint/indent': 'off',
'@typescript-eslint/return-await': [1, 'in-try-catch'],
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/restrict-plus-operands': 'off',
'@typescript-eslint/no-base-to-string': 'off',
'@typescript-eslint/naming-convention': 'off',
'@typescript-eslint/array-type': 'off',
'@typescript-eslint/key-spacing': 'off',
'@typescript-eslint/consistent-type-imports': 'off',
'@typescript-eslint/require-array-sort-compare': 'off',
'@typescript-eslint/no-useless-constructor': 'off',
'@typescript-eslint/no-unused-vars': ['error', {
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
ignoreRestSiblings: true,
}],
'@typescript-eslint/no-invalid-void-type': ['error', {
allowInGenericTypeArguments: true,
}],
},
}];