-
-
Notifications
You must be signed in to change notification settings - Fork 106
/
eslint.config.mjs
74 lines (73 loc) · 1.89 KB
/
eslint.config.mjs
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
import eslint from '@eslint/js';
import pluginVitest from '@vitest/eslint-plugin';
import configPrettier from 'eslint-config-prettier';
import pluginImport from 'eslint-plugin-import';
import globals from 'globals';
import tseslint from 'typescript-eslint';
// eslint-disable-next-line import/no-default-export
export default tseslint.config(
{ files: ['**/*.{js,mjs,cjs,ts}'] },
{ ignores: ['build', 'gen'] },
eslint.configs.recommended,
pluginImport.flatConfigs.recommended,
pluginImport.flatConfigs.typescript,
// eslint-disable-next-line import/no-named-as-default-member
...tseslint.configs.strictTypeChecked,
configPrettier,
{
languageOptions: {
ecmaVersion: 2022,
globals: { ...globals.browser, ...globals.node },
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
settings: {
'import/resolver': {
node: true,
typescript: true,
},
},
},
{
files: ['**/__tests__/**', '**/*.spec.*'],
...pluginVitest.configs.recommended,
},
{
rules: {
'@typescript-eslint/no-invalid-void-type': [
'error',
{ allowAsThisParameter: true },
],
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_' },
],
'@typescript-eslint/restrict-template-expressions': [
'error',
{ allowNumber: true },
],
'@typescript-eslint/unbound-method': ['error', { ignoreStatic: true }],
'import/no-extraneous-dependencies': 'error',
'import/no-default-export': 'error',
'import/order': [
'error',
{
alphabetize: { order: 'asc' },
'newlines-between': 'always',
warnOnUnassignedImports: true,
},
],
'no-console': 'error',
},
},
{
files: ['scripts/**'],
rules: {
'no-console': 'off',
},
},
);