-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.mjs
More file actions
94 lines (84 loc) · 2.03 KB
/
eslint.config.mjs
File metadata and controls
94 lines (84 loc) · 2.03 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import { FlatCompat } from '@eslint/eslintrc';
import js from '@eslint/js';
import { defineConfig } from 'eslint/config';
import globals from 'globals';
import path from 'node:path';
import { fileURLToPath } from 'node:url';
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all,
});
export default defineConfig([
{
extends: compat.extends('eslint:recommended'),
ignores: ['**/dist', '**/*.js'],
languageOptions: {
globals: {
...globals.node,
},
ecmaVersion: 2024,
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
impliedStrict: true,
},
},
},
rules: {
'no-dupe-else-if': 'error',
'no-template-curly-in-string': 'error',
'array-callback-return': 'error',
'block-scoped-var': 'error',
curly: ['error', 'multi-line'],
'class-methods-use-this': 'error',
'default-case': 'error',
eqeqeq: 'error',
'no-caller': 'error',
'no-case-declarations': 'error',
'no-constructor-return': 'error',
'no-eq-null': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-label': 'error',
'no-implied-eval': 'error',
'no-iterator': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-multi-spaces': 'error',
'no-multi-str': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-octal-escape': 'error',
'no-proto': 'error',
'no-return-assign': 'error',
'no-return-await': 'error',
'no-script-url': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-unmodified-loop-condition': 'error',
'wrap-iife': ['error', 'inside'],
'vars-on-top': 'error',
'no-undef': 'error',
indent: [
'error',
'tab',
{
SwitchCase: 1,
},
],
'key-spacing': [
'error',
{
beforeColon: false,
afterColon: true,
},
],
semi: 'error',
yoda: 'error',
},
},
]);