-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
88 lines (86 loc) · 2.07 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import StylisticPlugin from '@stylistic/eslint-plugin'
import parserTs from '@typescript-eslint/parser'
import vitest from '@vitest/eslint-plugin' // Add Vitest plugin
// import { FlatCompat } from '@eslint/eslintrc'
// const compat = new FlatCompat()
// eslint.config.js
export default [
// ...compat.extends('plugin:@stylistic/recommended'),
StylisticPlugin.configs['recommended-flat'],
{
plugins: {
stylistic: StylisticPlugin,
},
files: ['**/*.js', '**/*.ts', '**/*.tsx', '**/*.jsx'],
languageOptions: {
parser: parserTs,
parserOptions: {
ecmaVersion: 2021,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
globals: {
// Add Node.js globals
NodeJS: 'readonly',
console: 'readonly',
process: 'readonly',
Buffer: 'readonly',
__dirname: 'readonly',
__filename: 'readonly',
module: 'readonly',
require: 'readonly',
},
},
ignores: [
'**/node_modules/*',
'**/coverage/*',
'**/dist/*',
'**/build/*',
'**/tmp/*',
'**/deps/*',
'**/scripts/concatenated-output.ts',
'docs/',
'postman/',
'.eslintrc.*',
'rollup.config.js',
'jest.config.js',
],
rules: {
'@stylistic/indent': ['error', 2],
'@stylistic/semi': ['error', 'never'],
'@stylistic/no-tabs': 'error',
'@stylistic/member-delimiter-style': [
'error',
{
multiline: {
delimiter: 'semi',
requireLast: true,
},
singleline: {
delimiter: 'semi',
requireLast: false,
},
},
],
'@stylistic/eol-last': ['error', 'always'],
'@stylistic/brace-style': ['error', '1tbs'],
},
},
// Vitest configuration
{
files: [
'src/**/*.test.js',
'src/**/*.test.ts',
'src/**/*.spec.js',
'src/**/*.spec.ts',
],
plugins: {
vitest, // Register Vitest plugin
},
rules: {
...vitest.configs.recommended.rules,
},
},
]