-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy patheslint.config.mjs
More file actions
64 lines (59 loc) · 1.98 KB
/
eslint.config.mjs
File metadata and controls
64 lines (59 loc) · 1.98 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
// @ts-check
import js from '@eslint/js'
import vitest from '@vitest/eslint-plugin'
// import github from 'eslint-plugin-github'
import { importX } from 'eslint-plugin-import-x'
import { defineConfig, globalIgnores } from 'eslint/config'
import globals from 'globals'
import * as tseslint from 'typescript-eslint'
export default defineConfig([
globalIgnores(['node_modules', 'dist', 'coverage', 'eslint.config.mjs']),
{
extends: [
js.configs.recommended,
...tseslint.configs.strictTypeChecked,
...tseslint.configs.stylisticTypeChecked,
importX.flatConfigs.recommended,
importX.flatConfigs.typescript
],
languageOptions: {
ecmaVersion: 2022,
parserOptions: {
projectService: { allowDefaultProject: ['*.mjs'] },
tsconfigRootDir: import.meta.dirname
},
globals: {
...globals.es2022,
...globals.nodeBuiltin
}
},
rules: {
// 'github/array-foreach': 'error',
// 'github/filenames-match-regex': ['error', '^[a-z0-9-_]+(.[a-z0-9-_]+)?$'],
// 'github/no-then': 'error',
'import-x/no-dynamic-require': 'error',
'import-x/no-namespace': 'off',
'@typescript-eslint/explicit-function-return-type': ['error', { allowExpressions: true }],
'@typescript-eslint/explicit-member-accessibility': ['error', { accessibility: 'no-public' }],
'@typescript-eslint/no-deprecated': 'off',
'@typescript-eslint/consistent-generic-constructors': 'off',
'@typescript-eslint/no-unnecessary-qualifier': 'error',
'@typescript-eslint/no-var-requires': 'error',
'@typescript-eslint/promise-function-async': 'error',
'@typescript-eslint/require-array-sort-compare': 'error'
}
},
// Tests
{
extends: [vitest.configs.recommended],
files: ['**/*.test.ts'],
rules: {
'vitest/prefer-called-exactly-once-with': 'off'
}
},
// js files
{
files: ['**/*.js', '**/*.mjs'],
extends: [tseslint.configs.disableTypeChecked]
}
])