@kazupon/eslint-config 0.10.1 → 0.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/config.d.cts +2 -2
- package/dist/config.d.ts +2 -2
- package/dist/configs/comments.d.cts +2 -2
- package/dist/configs/comments.d.ts +2 -2
- package/dist/configs/javascript.d.cts +2 -2
- package/dist/configs/javascript.d.ts +2 -2
- package/dist/configs/jsdoc.d.cts +2 -2
- package/dist/configs/jsdoc.d.ts +2 -2
- package/dist/configs/jsonc.d.cts +2 -2
- package/dist/configs/jsonc.d.ts +2 -2
- package/dist/configs/prettier.d.cts +2 -2
- package/dist/configs/prettier.d.ts +2 -2
- package/dist/configs/promise.d.cts +2 -2
- package/dist/configs/promise.d.ts +2 -2
- package/dist/configs/regexp.d.cts +2 -2
- package/dist/configs/regexp.d.ts +2 -2
- package/dist/configs/toml.d.cts +2 -2
- package/dist/configs/toml.d.ts +2 -2
- package/dist/configs/typescript.d.cts +1 -1
- package/dist/configs/typescript.d.ts +1 -1
- package/dist/configs/unicorn.d.cts +2 -2
- package/dist/configs/unicorn.d.ts +2 -2
- package/dist/configs/vue.d.cts +2 -2
- package/dist/configs/vue.d.ts +2 -2
- package/dist/configs/yml.d.cts +2 -2
- package/dist/configs/yml.d.ts +2 -2
- package/dist/index.cjs +189 -121
- package/dist/index.js +103 -103
- package/dist/types/gens/javascript.d.cts +5 -9
- package/dist/types/gens/javascript.d.ts +5 -9
- package/dist/types/gens/promise.d.cts +10 -4
- package/dist/types/gens/promise.d.ts +10 -4
- package/dist/types/gens/typescript.d.cts +62 -737
- package/dist/types/gens/typescript.d.ts +62 -737
- package/dist/types/overrides.d.cts +2 -2
- package/dist/types/overrides.d.ts +2 -2
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
2
|
//#region rolldown:runtime
|
|
4
3
|
var __create = Object.create;
|
|
5
4
|
var __defProp = Object.defineProperty;
|
|
@@ -8,7 +7,7 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
8
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
9
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
9
|
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from ===
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
12
11
|
key = keys[i];
|
|
13
12
|
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
14
13
|
get: ((k) => from[k]).bind(null, key),
|
|
@@ -17,7 +16,7 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
16
|
}
|
|
18
17
|
return to;
|
|
19
18
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target,
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
21
20
|
value: mod,
|
|
22
21
|
enumerable: true
|
|
23
22
|
}) : target, mod));
|
|
@@ -36,7 +35,7 @@ function defineConfig(...configs) {
|
|
|
36
35
|
//#region src/utils.ts
|
|
37
36
|
async function interopDefault(mod) {
|
|
38
37
|
const resolved = await mod;
|
|
39
|
-
return
|
|
38
|
+
return resolved.default || resolved;
|
|
40
39
|
}
|
|
41
40
|
async function loadPlugin(name) {
|
|
42
41
|
const mod = await import(name).catch((error) => {
|
|
@@ -50,31 +49,31 @@ async function loadPlugin(name) {
|
|
|
50
49
|
//#region src/configs/javascript.ts
|
|
51
50
|
async function javascript(options = {}) {
|
|
52
51
|
const { rules: overrideRules = {} } = options;
|
|
53
|
-
const js = await loadPlugin(
|
|
52
|
+
const js = await loadPlugin("@eslint/js");
|
|
54
53
|
return [{
|
|
55
|
-
name:
|
|
56
|
-
...
|
|
54
|
+
name: "eslint/defaults/rules",
|
|
55
|
+
...js.configs.recommended
|
|
57
56
|
}, {
|
|
58
|
-
name:
|
|
57
|
+
name: "@kazupon/javascript/@eslint/js",
|
|
59
58
|
languageOptions: {
|
|
60
59
|
ecmaVersion: 2022,
|
|
61
60
|
globals: {
|
|
62
61
|
...globals.browser,
|
|
63
62
|
...globals.node,
|
|
64
63
|
...globals.es2022,
|
|
65
|
-
document:
|
|
66
|
-
navigator:
|
|
67
|
-
window:
|
|
64
|
+
document: "readonly",
|
|
65
|
+
navigator: "readonly",
|
|
66
|
+
window: "readonly"
|
|
68
67
|
},
|
|
69
68
|
parserOptions: {
|
|
70
|
-
ecmaFeatures: {jsx: true},
|
|
69
|
+
ecmaFeatures: { jsx: true },
|
|
71
70
|
ecmaVersion: 2022,
|
|
72
|
-
sourceType:
|
|
71
|
+
sourceType: "module"
|
|
73
72
|
},
|
|
74
|
-
sourceType:
|
|
73
|
+
sourceType: "module"
|
|
75
74
|
},
|
|
76
|
-
linterOptions: {reportUnusedDisableDirectives: true},
|
|
77
|
-
rules: {...overrideRules}
|
|
75
|
+
linterOptions: { reportUnusedDisableDirectives: true },
|
|
76
|
+
rules: { ...overrideRules }
|
|
78
77
|
}];
|
|
79
78
|
}
|
|
80
79
|
|
|
@@ -82,58 +81,58 @@ async function javascript(options = {}) {
|
|
|
82
81
|
//#region src/configs/comments.ts
|
|
83
82
|
async function comments(options = {}) {
|
|
84
83
|
const { rules: overrideRules = {} } = options;
|
|
85
|
-
const comments$1 = await loadPlugin(
|
|
84
|
+
const comments$1 = await loadPlugin("@eslint-community/eslint-plugin-eslint-comments");
|
|
86
85
|
return [{
|
|
87
|
-
name:
|
|
88
|
-
plugins: {
|
|
89
|
-
rules: {...
|
|
86
|
+
name: "@eslint-community/eslint-comments/recommended",
|
|
87
|
+
plugins: { "@eslint-community/eslint-comments": comments$1 },
|
|
88
|
+
rules: { ...comments$1.configs.recommended.rules }
|
|
90
89
|
}, {
|
|
91
|
-
name:
|
|
92
|
-
rules: {...overrideRules}
|
|
90
|
+
name: "@kazupon/eslint-comments",
|
|
91
|
+
rules: { ...overrideRules }
|
|
93
92
|
}];
|
|
94
93
|
}
|
|
95
94
|
|
|
96
95
|
//#endregion
|
|
97
96
|
//#region src/globs.ts
|
|
98
|
-
const GLOB_JS =
|
|
99
|
-
const GLOB_JSX =
|
|
100
|
-
const GLOB_TS =
|
|
101
|
-
const GLOB_TSX =
|
|
102
|
-
const GLOB_JSON =
|
|
103
|
-
const GLOB_JSON5 =
|
|
104
|
-
const GLOB_JSONC =
|
|
105
|
-
const GLOB_YAML =
|
|
106
|
-
const GLOB_TOML =
|
|
107
|
-
const GLOB_VUE =
|
|
97
|
+
const GLOB_JS = "**/*.?([cm])js";
|
|
98
|
+
const GLOB_JSX = "**/*.?([cm])jsx";
|
|
99
|
+
const GLOB_TS = "**/*.?([cm])ts";
|
|
100
|
+
const GLOB_TSX = "**/*.?([cm])tsx";
|
|
101
|
+
const GLOB_JSON = "**/*.json";
|
|
102
|
+
const GLOB_JSON5 = "**/*.json5";
|
|
103
|
+
const GLOB_JSONC = "**/*.jsonc";
|
|
104
|
+
const GLOB_YAML = "**/*.y?(a)ml";
|
|
105
|
+
const GLOB_TOML = "**/*.toml";
|
|
106
|
+
const GLOB_VUE = "**/*.vue";
|
|
108
107
|
|
|
109
108
|
//#endregion
|
|
110
109
|
//#region src/configs/typescript.ts
|
|
111
110
|
async function typescript(options = {}) {
|
|
112
|
-
const { rules: overrideRules = {}, extraFileExtensions = [], parserOptions = {project: true} } = options;
|
|
113
|
-
const ts = await loadPlugin(
|
|
111
|
+
const { rules: overrideRules = {}, extraFileExtensions = [], parserOptions = { project: true } } = options;
|
|
112
|
+
const ts = await loadPlugin("typescript-eslint");
|
|
114
113
|
const files = options.files ?? [GLOB_TS, GLOB_TSX, ...extraFileExtensions.map((ext) => `**/*${ext}`)];
|
|
115
|
-
return [...
|
|
114
|
+
return [...ts.configs.recommendedTypeChecked, {
|
|
116
115
|
files: [GLOB_JS, GLOB_JSX, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_YAML, GLOB_TOML],
|
|
117
|
-
...
|
|
116
|
+
...ts.configs.disableTypeChecked
|
|
118
117
|
}, {
|
|
119
|
-
name:
|
|
118
|
+
name: "@kazupon/typescipt/typescript-eslint",
|
|
120
119
|
files,
|
|
121
120
|
languageOptions: {
|
|
122
121
|
parser: ts.parser,
|
|
123
122
|
parserOptions: {
|
|
124
123
|
extraFileExtensions: extraFileExtensions.map((ext) => `${ext}`),
|
|
125
|
-
sourceType:
|
|
124
|
+
sourceType: "module",
|
|
126
125
|
...parserOptions
|
|
127
126
|
}
|
|
128
127
|
},
|
|
129
128
|
rules: {
|
|
130
|
-
|
|
131
|
-
args:
|
|
132
|
-
argsIgnorePattern:
|
|
133
|
-
caughtErrors:
|
|
134
|
-
caughtErrorsIgnorePattern:
|
|
135
|
-
destructuredArrayIgnorePattern:
|
|
136
|
-
varsIgnorePattern:
|
|
129
|
+
"@typescript-eslint/no-unused-vars": ["error", {
|
|
130
|
+
args: "all",
|
|
131
|
+
argsIgnorePattern: "^_",
|
|
132
|
+
caughtErrors: "all",
|
|
133
|
+
caughtErrorsIgnorePattern: "^_",
|
|
134
|
+
destructuredArrayIgnorePattern: "^_",
|
|
135
|
+
varsIgnorePattern: "^_",
|
|
137
136
|
ignoreRestSiblings: true
|
|
138
137
|
}],
|
|
139
138
|
...overrideRules
|
|
@@ -145,12 +144,12 @@ async function typescript(options = {}) {
|
|
|
145
144
|
//#region src/configs/jsdoc.ts
|
|
146
145
|
async function jsdoc(options = {}) {
|
|
147
146
|
const { rules: overrideRules = {}, typescript: typescript$1, error = false } = options;
|
|
148
|
-
const jsdoc$1 = await loadPlugin(
|
|
147
|
+
const jsdoc$1 = await loadPlugin("eslint-plugin-jsdoc");
|
|
149
148
|
function resolvePreset() {
|
|
150
|
-
let preset =
|
|
151
|
-
if (typescript$1 ===
|
|
149
|
+
let preset = "recommended";
|
|
150
|
+
if (typescript$1 === "syntax") {
|
|
152
151
|
preset = `${preset}-typescript`;
|
|
153
|
-
} else if (typescript$1 ===
|
|
152
|
+
} else if (typescript$1 === "flavor") {
|
|
154
153
|
preset = `${preset}-typescript-flavor`;
|
|
155
154
|
}
|
|
156
155
|
if (error) {
|
|
@@ -159,8 +158,8 @@ async function jsdoc(options = {}) {
|
|
|
159
158
|
return preset;
|
|
160
159
|
}
|
|
161
160
|
return [jsdoc$1.configs[`flat/${resolvePreset()}`], {
|
|
162
|
-
name:
|
|
163
|
-
rules: {...overrideRules}
|
|
161
|
+
name: "@kazupon/jsdoc",
|
|
162
|
+
rules: { ...overrideRules }
|
|
164
163
|
}];
|
|
165
164
|
}
|
|
166
165
|
|
|
@@ -168,13 +167,13 @@ async function jsdoc(options = {}) {
|
|
|
168
167
|
//#region src/configs/promise.ts
|
|
169
168
|
async function promise(options = {}) {
|
|
170
169
|
const { rules: overrideRules = {} } = options;
|
|
171
|
-
const promise$1 = await loadPlugin(
|
|
170
|
+
const promise$1 = await loadPlugin("eslint-plugin-promise");
|
|
172
171
|
return [{
|
|
173
|
-
name:
|
|
174
|
-
...
|
|
172
|
+
name: "promise/flat/recommended",
|
|
173
|
+
...promise$1.configs["flat/recommended"]
|
|
175
174
|
}, {
|
|
176
|
-
name:
|
|
177
|
-
rules: {...overrideRules}
|
|
175
|
+
name: "@kazupon/promise",
|
|
176
|
+
rules: { ...overrideRules }
|
|
178
177
|
}];
|
|
179
178
|
}
|
|
180
179
|
|
|
@@ -182,13 +181,13 @@ async function promise(options = {}) {
|
|
|
182
181
|
//#region src/configs/regexp.ts
|
|
183
182
|
async function regexp(options = {}) {
|
|
184
183
|
const { rules: overrideRules = {} } = options;
|
|
185
|
-
const regexp$1 = await loadPlugin(
|
|
184
|
+
const regexp$1 = await loadPlugin("eslint-plugin-regexp");
|
|
186
185
|
return [{
|
|
187
|
-
name:
|
|
188
|
-
...
|
|
186
|
+
name: "regexp/flat/recommended",
|
|
187
|
+
...regexp$1.configs["flat/recommended"]
|
|
189
188
|
}, {
|
|
190
|
-
name:
|
|
191
|
-
rules: {...overrideRules}
|
|
189
|
+
name: "@kazupon/eslint-regexp",
|
|
190
|
+
rules: { ...overrideRules }
|
|
192
191
|
}];
|
|
193
192
|
}
|
|
194
193
|
|
|
@@ -196,18 +195,18 @@ async function regexp(options = {}) {
|
|
|
196
195
|
//#region src/configs/toml.ts
|
|
197
196
|
async function toml(options = {}) {
|
|
198
197
|
const { rules: overrideRules = {} } = options;
|
|
199
|
-
const toml$1 = await loadPlugin(
|
|
198
|
+
const toml$1 = await loadPlugin("eslint-plugin-toml");
|
|
200
199
|
const configs = [];
|
|
201
|
-
configs.push(...toml$1.configs[
|
|
200
|
+
configs.push(...toml$1.configs["flat/standard"].map((config, index) => {
|
|
202
201
|
return config.name ? config : {
|
|
203
202
|
name: `toml/flat/standard/${index}`,
|
|
204
203
|
...config
|
|
205
204
|
};
|
|
206
205
|
}));
|
|
207
206
|
const overriddenConfig = {
|
|
208
|
-
name:
|
|
207
|
+
name: "@kazupon/toml",
|
|
209
208
|
files: [GLOB_TOML],
|
|
210
|
-
rules: {...overrideRules}
|
|
209
|
+
rules: { ...overrideRules }
|
|
211
210
|
};
|
|
212
211
|
configs.push(overriddenConfig);
|
|
213
212
|
return configs;
|
|
@@ -217,10 +216,10 @@ async function toml(options = {}) {
|
|
|
217
216
|
//#region src/configs/unicorn.ts
|
|
218
217
|
async function unicorn(options = {}) {
|
|
219
218
|
const { rules: overrideRules = {} } = options;
|
|
220
|
-
const unicorn$1 = await loadPlugin(
|
|
221
|
-
return [unicorn$1.configs[
|
|
222
|
-
name:
|
|
223
|
-
rules: {...overrideRules}
|
|
219
|
+
const unicorn$1 = await loadPlugin("eslint-plugin-unicorn");
|
|
220
|
+
return [unicorn$1.configs["flat/recommended"], {
|
|
221
|
+
name: "@kazupon/unicorn",
|
|
222
|
+
rules: { ...overrideRules }
|
|
224
223
|
}];
|
|
225
224
|
}
|
|
226
225
|
|
|
@@ -228,10 +227,10 @@ async function unicorn(options = {}) {
|
|
|
228
227
|
//#region src/configs/prettier.ts
|
|
229
228
|
async function prettier(options = {}) {
|
|
230
229
|
const { rules: overrideRules = {} } = options;
|
|
231
|
-
const prettier$1 = await loadPlugin(
|
|
230
|
+
const prettier$1 = await loadPlugin("eslint-config-prettier");
|
|
232
231
|
return [prettier$1, {
|
|
233
|
-
name:
|
|
234
|
-
rules: {...overrideRules}
|
|
232
|
+
name: "@kazupon/prettier",
|
|
233
|
+
rules: { ...overrideRules }
|
|
235
234
|
}];
|
|
236
235
|
}
|
|
237
236
|
|
|
@@ -239,9 +238,9 @@ async function prettier(options = {}) {
|
|
|
239
238
|
//#region src/configs/jsonc.ts
|
|
240
239
|
async function jsonc(options = {}) {
|
|
241
240
|
const { rules: overrideRules = {} } = options;
|
|
242
|
-
const kinds = [options.json ?
|
|
241
|
+
const kinds = [options.json ? "json" : "", options.jsonc ? "jsonc" : "", options.json5 ? "json5" : ""];
|
|
243
242
|
const usePrettier = !!options.prettier;
|
|
244
|
-
const jsonc$1 = await loadPlugin(
|
|
243
|
+
const jsonc$1 = await loadPlugin("eslint-plugin-jsonc");
|
|
245
244
|
const configs = [];
|
|
246
245
|
for (const kind of kinds) {
|
|
247
246
|
if (kind) {
|
|
@@ -254,7 +253,7 @@ async function jsonc(options = {}) {
|
|
|
254
253
|
}
|
|
255
254
|
}
|
|
256
255
|
if (usePrettier) {
|
|
257
|
-
configs.push(...jsonc$1.configs[
|
|
256
|
+
configs.push(...jsonc$1.configs["flat/prettier"].map((config, index) => {
|
|
258
257
|
return config.name ? config : {
|
|
259
258
|
name: `jsonc/flat/prettier/${index}`,
|
|
260
259
|
...config
|
|
@@ -262,34 +261,34 @@ async function jsonc(options = {}) {
|
|
|
262
261
|
}));
|
|
263
262
|
}
|
|
264
263
|
const overriddenConfig = {
|
|
265
|
-
name:
|
|
264
|
+
name: "@kazupon/jsonc",
|
|
266
265
|
files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
|
|
267
|
-
rules: {...overrideRules}
|
|
266
|
+
rules: { ...overrideRules }
|
|
268
267
|
};
|
|
269
268
|
configs.push(...jsoncSort(), overriddenConfig);
|
|
270
269
|
return configs;
|
|
271
270
|
}
|
|
272
271
|
function jsoncSort() {
|
|
273
272
|
return [{
|
|
274
|
-
name:
|
|
275
|
-
files: [
|
|
273
|
+
name: "@kazupon/jsonc/sort/package.json",
|
|
274
|
+
files: ["**/package.json"],
|
|
276
275
|
rules: {
|
|
277
|
-
|
|
278
|
-
order: {type:
|
|
279
|
-
pathPattern:
|
|
276
|
+
"jsonc/sort-array-values": ["error", {
|
|
277
|
+
order: { type: "asc" },
|
|
278
|
+
pathPattern: "^files$"
|
|
280
279
|
}],
|
|
281
|
-
|
|
282
|
-
order: [
|
|
283
|
-
pathPattern:
|
|
280
|
+
"jsonc/sort-keys": ["error", {
|
|
281
|
+
order: ["name", "description", "private", "version", "author", "contributors", "license", "funding", "bugs", "repository", "keywords", "homepage", "publishConfig", "packageManager", "engines", "os", "cpu", "type", "sideEffects", "bin", "files", "main", "module", "browser", "unpkg", "jsdelivr", "directories", "exports", "types", "typesVersions", "scripts", "dependencies", "peerDependencies", "peerDependenciesMeta", "optionalDependencies", "devDependencies", "pnpm", "overrides", "resolutions", "workspaces", "prettier", "buildOptions", "lint-staged"],
|
|
282
|
+
pathPattern: "^$"
|
|
284
283
|
}, {
|
|
285
|
-
order: {type:
|
|
286
|
-
pathPattern:
|
|
284
|
+
order: { type: "asc" },
|
|
285
|
+
pathPattern: "^scripts$"
|
|
287
286
|
}, {
|
|
288
|
-
order: {type:
|
|
289
|
-
pathPattern:
|
|
287
|
+
order: { type: "asc" },
|
|
288
|
+
pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
|
|
290
289
|
}, {
|
|
291
|
-
order: {type:
|
|
292
|
-
pathPattern:
|
|
290
|
+
order: { type: "asc" },
|
|
291
|
+
pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
|
|
293
292
|
}]
|
|
294
293
|
}
|
|
295
294
|
}];
|
|
@@ -300,16 +299,16 @@ function jsoncSort() {
|
|
|
300
299
|
async function yml(options = {}) {
|
|
301
300
|
const { rules: overrideRules = {} } = options;
|
|
302
301
|
const usePrettier = !!options.prettier;
|
|
303
|
-
const yml$1 = await loadPlugin(
|
|
302
|
+
const yml$1 = await loadPlugin("eslint-plugin-yml");
|
|
304
303
|
const configs = [];
|
|
305
|
-
configs.push(...yml$1.configs[
|
|
304
|
+
configs.push(...yml$1.configs["flat/standard"].map((config, index) => {
|
|
306
305
|
return config.name ? config : {
|
|
307
306
|
name: `yml/flat/standard/${index}`,
|
|
308
307
|
...config
|
|
309
308
|
};
|
|
310
309
|
}));
|
|
311
310
|
if (usePrettier) {
|
|
312
|
-
configs.push(...yml$1.configs[
|
|
311
|
+
configs.push(...yml$1.configs["flat/prettier"].map((config, index) => {
|
|
313
312
|
return config.name ? config : {
|
|
314
313
|
name: `yml/flat/prettier/${index}`,
|
|
315
314
|
...config
|
|
@@ -317,9 +316,9 @@ async function yml(options = {}) {
|
|
|
317
316
|
}));
|
|
318
317
|
}
|
|
319
318
|
const overriddenConfig = {
|
|
320
|
-
name:
|
|
319
|
+
name: "@kazupon/yml",
|
|
321
320
|
files: [GLOB_YAML],
|
|
322
|
-
rules: {...overrideRules}
|
|
321
|
+
rules: { ...overrideRules }
|
|
323
322
|
};
|
|
324
323
|
configs.push(overriddenConfig);
|
|
325
324
|
return configs;
|
|
@@ -329,47 +328,116 @@ const yaml = yml;
|
|
|
329
328
|
//#endregion
|
|
330
329
|
//#region src/configs/vue.ts
|
|
331
330
|
async function vue(options = {}) {
|
|
332
|
-
const { rules: overrideRules = {}, parserOptions = {project: true} } = options;
|
|
331
|
+
const { rules: overrideRules = {}, parserOptions = { project: true } } = options;
|
|
333
332
|
const useTypeScript = !!options.typescript;
|
|
334
|
-
const vue$1 = await loadPlugin(
|
|
335
|
-
const vueParser = vue$1.configs[
|
|
333
|
+
const vue$1 = await loadPlugin("eslint-plugin-vue");
|
|
334
|
+
const vueParser = vue$1.configs["flat/base"][1]["languageOptions"]["parser"];
|
|
336
335
|
async function getTypeScriptParser() {
|
|
337
|
-
const ts = await loadPlugin(
|
|
336
|
+
const ts = await loadPlugin("typescript-eslint");
|
|
338
337
|
return ts.parser;
|
|
339
338
|
}
|
|
340
339
|
const customConfig = {
|
|
341
|
-
name:
|
|
340
|
+
name: "@kazupon/vue",
|
|
342
341
|
files: [GLOB_VUE],
|
|
343
|
-
rules: {...overrideRules}
|
|
342
|
+
rules: { ...overrideRules }
|
|
344
343
|
};
|
|
345
344
|
if (useTypeScript) {
|
|
346
345
|
customConfig.languageOptions = {
|
|
347
346
|
parser: vueParser,
|
|
348
347
|
parserOptions: {
|
|
349
|
-
sourceType:
|
|
348
|
+
sourceType: "module",
|
|
350
349
|
parser: await getTypeScriptParser(),
|
|
351
|
-
ecmaFeatures: {jsx: true},
|
|
352
|
-
extraFileExtensions: [
|
|
350
|
+
ecmaFeatures: { jsx: true },
|
|
351
|
+
extraFileExtensions: [".vue"],
|
|
353
352
|
...parserOptions
|
|
354
353
|
}
|
|
355
354
|
};
|
|
356
355
|
}
|
|
357
|
-
return [...
|
|
356
|
+
return [...vue$1.configs["flat/recommended"], customConfig];
|
|
358
357
|
}
|
|
359
358
|
|
|
360
359
|
//#endregion
|
|
361
|
-
Object.defineProperty(exports, '
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
exports
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
exports
|
|
374
|
-
|
|
375
|
-
|
|
360
|
+
Object.defineProperty(exports, 'comments', {
|
|
361
|
+
enumerable: true,
|
|
362
|
+
get: function () {
|
|
363
|
+
return comments;
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
Object.defineProperty(exports, 'defineConfig', {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function () {
|
|
369
|
+
return defineConfig;
|
|
370
|
+
}
|
|
371
|
+
});
|
|
372
|
+
Object.defineProperty(exports, 'javascript', {
|
|
373
|
+
enumerable: true,
|
|
374
|
+
get: function () {
|
|
375
|
+
return javascript;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
Object.defineProperty(exports, 'jsdoc', {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function () {
|
|
381
|
+
return jsdoc;
|
|
382
|
+
}
|
|
383
|
+
});
|
|
384
|
+
Object.defineProperty(exports, 'jsonc', {
|
|
385
|
+
enumerable: true,
|
|
386
|
+
get: function () {
|
|
387
|
+
return jsonc;
|
|
388
|
+
}
|
|
389
|
+
});
|
|
390
|
+
Object.defineProperty(exports, 'prettier', {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
get: function () {
|
|
393
|
+
return prettier;
|
|
394
|
+
}
|
|
395
|
+
});
|
|
396
|
+
Object.defineProperty(exports, 'promise', {
|
|
397
|
+
enumerable: true,
|
|
398
|
+
get: function () {
|
|
399
|
+
return promise;
|
|
400
|
+
}
|
|
401
|
+
});
|
|
402
|
+
Object.defineProperty(exports, 'regexp', {
|
|
403
|
+
enumerable: true,
|
|
404
|
+
get: function () {
|
|
405
|
+
return regexp;
|
|
406
|
+
}
|
|
407
|
+
});
|
|
408
|
+
Object.defineProperty(exports, 'toml', {
|
|
409
|
+
enumerable: true,
|
|
410
|
+
get: function () {
|
|
411
|
+
return toml;
|
|
412
|
+
}
|
|
413
|
+
});
|
|
414
|
+
Object.defineProperty(exports, 'typescript', {
|
|
415
|
+
enumerable: true,
|
|
416
|
+
get: function () {
|
|
417
|
+
return typescript;
|
|
418
|
+
}
|
|
419
|
+
});
|
|
420
|
+
Object.defineProperty(exports, 'unicorn', {
|
|
421
|
+
enumerable: true,
|
|
422
|
+
get: function () {
|
|
423
|
+
return unicorn;
|
|
424
|
+
}
|
|
425
|
+
});
|
|
426
|
+
Object.defineProperty(exports, 'vue', {
|
|
427
|
+
enumerable: true,
|
|
428
|
+
get: function () {
|
|
429
|
+
return vue;
|
|
430
|
+
}
|
|
431
|
+
});
|
|
432
|
+
Object.defineProperty(exports, 'yaml', {
|
|
433
|
+
enumerable: true,
|
|
434
|
+
get: function () {
|
|
435
|
+
return yaml;
|
|
436
|
+
}
|
|
437
|
+
});
|
|
438
|
+
Object.defineProperty(exports, 'yml', {
|
|
439
|
+
enumerable: true,
|
|
440
|
+
get: function () {
|
|
441
|
+
return yml;
|
|
442
|
+
}
|
|
443
|
+
});
|