-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
66 lines (65 loc) · 1.59 KB
/
eslint.config.mjs
File metadata and controls
66 lines (65 loc) · 1.59 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
/* eslint-disable import/no-named-as-default-member */
import globals from 'globals'
import pluginJs from '@eslint/js'
import tsEslint from 'typescript-eslint'
import pluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import pluginImport from 'eslint-plugin-import'
/** @type {import('eslint').Linter.Config[]} */
export default [
{
files: ['**/*.{js,ts}'],
},
{
ignores: ['vitest.config.mts', 'build/'],
},
{
languageOptions: {
globals: globals.node,
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
pluginJs.configs.recommended,
...tsEslint.configs.recommended,
pluginImport.flatConfigs.recommended,
pluginImport.flatConfigs.typescript,
pluginPrettierRecommended,
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/require-await': 'error',
'@typescript-eslint/no-unused-vars': [
'error',
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'import/no-commonjs': 'error',
},
},
{
files: ['**/*.{js,mjs}'],
...tsEslint.configs.disableTypeChecked,
},
{
files: ['**/*.js'],
languageOptions: {
sourceType: 'commonjs',
},
rules: {
...tsEslint.configs.disableTypeChecked.rules,
'@typescript-eslint/no-require-imports': 'off',
'import/no-commonjs': 'off',
},
},
{
settings: {
'import/resolver': {
typescript: {
project: './tsconfig.json',
},
},
},
},
]