-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
eslint.config.mjs
55 lines (54 loc) · 1.27 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
import globals from 'globals'
import js from '@eslint/js'
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
/** @type {import("eslint").Linter.Config[]} */
export default [
js.configs.recommended,
eslint.configs.recommended,
...tseslint.configs.recommended,
{
files: ['**/*.js', '**/*.ts'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
...globals.node,
...globals.es2021,
...globals.es2020,
},
parserOptions: {
globalReturn: true,
},
},
rules: {
'prettier/prettier': 'error',
'no-unused-vars': 'off',
},
},
{
files: ['**/*.js'],
rules: {
'no-undef': 'off',
'no-useless-escape': 'off',
'no-prototype-builtins': 'off',
'@typescript-eslint/no-unused-expressions': 'off',
},
},
{
files: ['**/*d.ts'],
rules: {
'no-undef': 'off',
},
},
{
files: ['**/*test.ts'],
rules: {
'no-console': 'error',
},
},
// ref: https://github.com/prettier/eslint-plugin-prettier?tab=readme-ov-file#configuration-new-eslintconfigjs
eslintPluginPrettierRecommended,
]