-
Notifications
You must be signed in to change notification settings - Fork 295
Expand file tree
/
Copy patheslint.config.mjs
More file actions
49 lines (47 loc) · 1.21 KB
/
eslint.config.mjs
File metadata and controls
49 lines (47 loc) · 1.21 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
// @ts-check
import eslint from '@eslint/js'
import prettierRecommended from 'eslint-plugin-prettier/recommended'
import { config, configs } from 'typescript-eslint'
import { flatConfigs as pluginImport } from 'eslint-plugin-import-x'
import globals from 'globals'
import vitest from '@vitest/eslint-plugin'
export default config(
{
ignores: ['dist'],
},
eslint.configs.recommended,
...configs.strictTypeChecked,
pluginImport.recommended,
pluginImport.typescript,
prettierRecommended,
{
languageOptions: {
globals: globals.node,
parserOptions: {
project: './tsconfig.json',
tsconfigDirName: import.meta.dirname,
},
},
linterOptions: {
reportUnusedDisableDirectives: 'warn',
},
rules: {
'@typescript-eslint/explicit-function-return-type': 'error',
'import-x/no-nodejs-modules': 'error',
'no-control-regex': 'off',
},
},
{
files: ['lib/__tests__/**'],
plugins: { vitest },
rules: {
...vitest.configs.recommended.rules,
// We only run tests in node, so we can use node's builtins
'import-x/no-nodejs-modules': 'off',
},
},
{
files: ['eslint.config.mjs'],
...configs.disableTypeChecked,
},
)