-
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy patheslint.config.js
More file actions
94 lines (91 loc) · 2.18 KB
/
eslint.config.js
File metadata and controls
94 lines (91 loc) · 2.18 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
// SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
// SPDX-License-Identifier: AGPL-3.0-or-later
const js = require('@eslint/js')
const globals = require('globals')
const vue = require('eslint-plugin-vue')
const tsPlugin = require('@typescript-eslint/eslint-plugin')
const tsParser = require('@typescript-eslint/parser')
const vueParser = require('vue-eslint-parser')
const vitest = require('@vitest/eslint-plugin')
const vitestGlobals = {
afterAll: 'readonly',
afterEach: 'readonly',
beforeAll: 'readonly',
beforeEach: 'readonly',
describe: 'readonly',
expect: 'readonly',
it: 'readonly',
test: 'readonly',
vi: 'readonly',
}
module.exports = [
{
ignores: ['dist/**', 'dist-demo/**', 'node_modules/**', '.eslintrc.js'],
},
js.configs.recommended,
{
files: ['**/*.{ts,vue}'],
languageOptions: {
parser: vueParser,
parserOptions: {
parser: tsParser,
ecmaVersion: 2021,
sourceType: 'module',
},
globals: {
...globals.browser,
...globals.es2021,
},
},
plugins: {
vue,
'@typescript-eslint': tsPlugin,
},
rules: {
...vue.configs['flat/essential'].rules,
...tsPlugin.configs.recommended.rules,
'no-undef': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
},
},
{
files: ['eslint.config.js', '**/*.config.js', '**/*.config.cjs', 'postcss.config.js'],
languageOptions: {
globals: {
...globals.node,
...globals.es2021,
},
sourceType: 'script',
},
rules: {
'no-undef': 'off',
},
},
{
files: ['vite.config.ts', 'vitest.config.ts'],
languageOptions: {
globals: {
...globals.node,
...globals.es2021,
},
},
},
{
files: ['tests/**/*.ts'],
plugins: {
vitest,
},
languageOptions: {
globals: {
...globals.browser,
...globals.es2021,
...vitestGlobals,
},
},
rules: {
...(vitest.configs?.recommended?.rules || {}),
},
},
]