forked from NiREvil/vless
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
103 lines (98 loc) · 2.27 KB
/
eslint.config.js
File metadata and controls
103 lines (98 loc) · 2.27 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
95
96
97
98
99
100
101
102
103
import js from '@eslint/js';
import globals from 'globals';
import eslintPluginJsonc from 'eslint-plugin-jsonc';
import jsoncParser from 'jsonc-eslint-parser';
import eslintPluginYml from 'eslint-plugin-yml';
import ymlParser from 'yaml-eslint-parser';
import eslintPluginHtml from 'eslint-plugin-html';
import eslintConfigPrettier from 'eslint-config-prettier';
export default [
{
ignores: [
'**/*.md',
'dist/**',
'build/**',
'**/*.css',
'**/*.scss',
'warp.json',
'hiddify/**',
'.github/**',
'edge/waste/**',
'edge/unite.js',
'**/clash-12.**',
'sub/ProxyIP.md',
'node_modules/**',
'DNS over HTTPS/**',
'package-lock.json',
'edge/all-in-one.js',
'edge/LoadBalance.js',
'real address generator/**',
'boringtun-boringtun-cli-0.5.2/**',
],
},
js.configs.recommended,
{
// ⚙️ JavaScript
files: ['**/*.js', '**/*.mjs', '**/*.cjs'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
...globals.browser,
},
},
rules: {
'no-unused-vars': 'warn',
'no-console': 'off',
semi: ['error', 'always'],
quotes: ['error', 'single'],
'no-irregular-whitespace': [
'error',
{
skipStrings: true,
skipComments: false,
skipRegExps: true,
skipTemplates: true,
},
],
},
// ⚙️ JSON, JSONC, JSON5
files: ['**/*.json', '**/*.jsonc', '**/*.json5'],
plugins: {
jsonc: eslintPluginJsonc,
},
languageOptions: {
parser: jsoncParser,
},
rules: {
...eslintPluginJsonc.configs['recommended-with-jsonc'].rules,
'jsonc/sort-keys': 'error',
},
},
{
// ⚙️ YAML
files: ['**/*.yaml', '**/*.yml'],
plugins: {
yml: eslintPluginYml,
},
languageOptions: {
parser: ymlParser,
},
rules: {
...eslintPluginYml.configs.standard.rules,
...eslintPluginYml.configs.prettier.rules,
},
},
{
// ⚙️ HTML (For linting inside <script>)
files: ['**/*.html'],
plugins: {
html: eslintPluginHtml,
},
languageOptions: {
globals: { ...globals.browser },
},
rules: {},
},
];