@kazupon/eslint-config 0.10.1 → 0.12.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.
Files changed (50) hide show
  1. package/README.md +16 -4
  2. package/dist/config.d.cts +2 -2
  3. package/dist/config.d.ts +2 -2
  4. package/dist/configs/comments.d.cts +2 -2
  5. package/dist/configs/comments.d.ts +2 -2
  6. package/dist/configs/index.d.cts +1 -0
  7. package/dist/configs/index.d.ts +1 -0
  8. package/dist/configs/javascript.d.cts +2 -2
  9. package/dist/configs/javascript.d.ts +2 -2
  10. package/dist/configs/jsdoc.d.cts +2 -2
  11. package/dist/configs/jsdoc.d.ts +2 -2
  12. package/dist/configs/jsonc.d.cts +2 -2
  13. package/dist/configs/jsonc.d.ts +2 -2
  14. package/dist/configs/prettier.d.cts +2 -2
  15. package/dist/configs/prettier.d.ts +2 -2
  16. package/dist/configs/promise.d.cts +2 -2
  17. package/dist/configs/promise.d.ts +2 -2
  18. package/dist/configs/regexp.d.cts +2 -2
  19. package/dist/configs/regexp.d.ts +2 -2
  20. package/dist/configs/svelte.d.cts +21 -0
  21. package/dist/configs/svelte.d.ts +21 -0
  22. package/dist/configs/toml.d.cts +2 -2
  23. package/dist/configs/toml.d.ts +2 -2
  24. package/dist/configs/typescript.d.cts +1 -1
  25. package/dist/configs/typescript.d.ts +1 -1
  26. package/dist/configs/unicorn.d.cts +2 -2
  27. package/dist/configs/unicorn.d.ts +2 -2
  28. package/dist/configs/vue.d.cts +2 -2
  29. package/dist/configs/vue.d.ts +2 -2
  30. package/dist/configs/yml.d.cts +2 -2
  31. package/dist/configs/yml.d.ts +2 -2
  32. package/dist/globs.d.cts +1 -0
  33. package/dist/globs.d.ts +1 -0
  34. package/dist/index.cjs +227 -121
  35. package/dist/index.js +136 -104
  36. package/dist/types/gens/eslint.d.cts +2 -1
  37. package/dist/types/gens/eslint.d.ts +2 -1
  38. package/dist/types/gens/javascript.d.cts +5 -9
  39. package/dist/types/gens/javascript.d.ts +5 -9
  40. package/dist/types/gens/promise.d.cts +10 -4
  41. package/dist/types/gens/promise.d.ts +10 -4
  42. package/dist/types/gens/svelte.d.cts +491 -0
  43. package/dist/types/gens/svelte.d.ts +491 -0
  44. package/dist/types/gens/typescript.d.cts +62 -737
  45. package/dist/types/gens/typescript.d.ts +62 -737
  46. package/dist/types/index.d.cts +2 -1
  47. package/dist/types/index.d.ts +2 -1
  48. package/dist/types/overrides.d.cts +2 -2
  49. package/dist/types/overrides.d.ts +2 -2
  50. package/package.json +17 -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 === 'object' || typeof from === 'function') for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
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, 'default', {
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 (resolved).default || resolved;
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('@eslint/js');
52
+ const js = await loadPlugin("@eslint/js");
54
53
  return [{
55
- name: 'eslint/defaults/rules',
56
- ...(js.configs.recommended)
54
+ name: "eslint/defaults/rules",
55
+ ...js.configs.recommended
57
56
  }, {
58
- name: '@kazupon/javascript/@eslint/js',
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: 'readonly',
66
- navigator: 'readonly',
67
- window: 'readonly'
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: 'module'
71
+ sourceType: "module"
73
72
  },
74
- sourceType: 'module'
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,59 @@ 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('@eslint-community/eslint-plugin-eslint-comments');
84
+ const comments$1 = await loadPlugin("@eslint-community/eslint-plugin-eslint-comments");
86
85
  return [{
87
- name: '@eslint-community/eslint-comments/recommended',
88
- plugins: {'@eslint-community/eslint-comments': comments$1},
89
- rules: {...(comments$1.configs.recommended.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: '@kazupon/eslint-comments',
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 = '**/*.?([cm])js';
99
- const GLOB_JSX = '**/*.?([cm])jsx';
100
- const GLOB_TS = '**/*.?([cm])ts';
101
- const GLOB_TSX = '**/*.?([cm])tsx';
102
- const GLOB_JSON = '**/*.json';
103
- const GLOB_JSON5 = '**/*.json5';
104
- const GLOB_JSONC = '**/*.jsonc';
105
- const GLOB_YAML = '**/*.y?(a)ml';
106
- const GLOB_TOML = '**/*.toml';
107
- const GLOB_VUE = '**/*.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";
107
+ const GLOB_SVELTE = "**/*.svelte";
108
108
 
109
109
  //#endregion
110
110
  //#region src/configs/typescript.ts
111
111
  async function typescript(options = {}) {
112
- const { rules: overrideRules = {}, extraFileExtensions = [], parserOptions = {project: true} } = options;
113
- const ts = await loadPlugin('typescript-eslint');
112
+ const { rules: overrideRules = {}, extraFileExtensions = [], parserOptions = { project: true } } = options;
113
+ const ts = await loadPlugin("typescript-eslint");
114
114
  const files = options.files ?? [GLOB_TS, GLOB_TSX, ...extraFileExtensions.map((ext) => `**/*${ext}`)];
115
- return [...(ts.configs.recommendedTypeChecked), {
115
+ return [...ts.configs.recommendedTypeChecked, {
116
116
  files: [GLOB_JS, GLOB_JSX, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_YAML, GLOB_TOML],
117
- ...(ts.configs.disableTypeChecked)
117
+ ...ts.configs.disableTypeChecked
118
118
  }, {
119
- name: '@kazupon/typescipt/typescript-eslint',
119
+ name: "@kazupon/typescipt/typescript-eslint",
120
120
  files,
121
121
  languageOptions: {
122
122
  parser: ts.parser,
123
123
  parserOptions: {
124
124
  extraFileExtensions: extraFileExtensions.map((ext) => `${ext}`),
125
- sourceType: 'module',
125
+ sourceType: "module",
126
126
  ...parserOptions
127
127
  }
128
128
  },
129
129
  rules: {
130
- '@typescript-eslint/no-unused-vars': ['error', {
131
- args: 'all',
132
- argsIgnorePattern: '^_',
133
- caughtErrors: 'all',
134
- caughtErrorsIgnorePattern: '^_',
135
- destructuredArrayIgnorePattern: '^_',
136
- varsIgnorePattern: '^_',
130
+ "@typescript-eslint/no-unused-vars": ["error", {
131
+ args: "all",
132
+ argsIgnorePattern: "^_",
133
+ caughtErrors: "all",
134
+ caughtErrorsIgnorePattern: "^_",
135
+ destructuredArrayIgnorePattern: "^_",
136
+ varsIgnorePattern: "^_",
137
137
  ignoreRestSiblings: true
138
138
  }],
139
139
  ...overrideRules
@@ -145,12 +145,12 @@ async function typescript(options = {}) {
145
145
  //#region src/configs/jsdoc.ts
146
146
  async function jsdoc(options = {}) {
147
147
  const { rules: overrideRules = {}, typescript: typescript$1, error = false } = options;
148
- const jsdoc$1 = await loadPlugin('eslint-plugin-jsdoc');
148
+ const jsdoc$1 = await loadPlugin("eslint-plugin-jsdoc");
149
149
  function resolvePreset() {
150
- let preset = 'recommended';
151
- if (typescript$1 === 'syntax') {
150
+ let preset = "recommended";
151
+ if (typescript$1 === "syntax") {
152
152
  preset = `${preset}-typescript`;
153
- } else if (typescript$1 === 'flavor') {
153
+ } else if (typescript$1 === "flavor") {
154
154
  preset = `${preset}-typescript-flavor`;
155
155
  }
156
156
  if (error) {
@@ -159,8 +159,8 @@ async function jsdoc(options = {}) {
159
159
  return preset;
160
160
  }
161
161
  return [jsdoc$1.configs[`flat/${resolvePreset()}`], {
162
- name: '@kazupon/jsdoc',
163
- rules: {...overrideRules}
162
+ name: "@kazupon/jsdoc",
163
+ rules: { ...overrideRules }
164
164
  }];
165
165
  }
166
166
 
@@ -168,13 +168,13 @@ async function jsdoc(options = {}) {
168
168
  //#region src/configs/promise.ts
169
169
  async function promise(options = {}) {
170
170
  const { rules: overrideRules = {} } = options;
171
- const promise$1 = await loadPlugin('eslint-plugin-promise');
171
+ const promise$1 = await loadPlugin("eslint-plugin-promise");
172
172
  return [{
173
- name: 'promise/flat/recommended',
174
- ...(promise$1.configs['flat/recommended'])
173
+ name: "promise/flat/recommended",
174
+ ...promise$1.configs["flat/recommended"]
175
175
  }, {
176
- name: '@kazupon/promise',
177
- rules: {...overrideRules}
176
+ name: "@kazupon/promise",
177
+ rules: { ...overrideRules }
178
178
  }];
179
179
  }
180
180
 
@@ -182,13 +182,13 @@ async function promise(options = {}) {
182
182
  //#region src/configs/regexp.ts
183
183
  async function regexp(options = {}) {
184
184
  const { rules: overrideRules = {} } = options;
185
- const regexp$1 = await loadPlugin('eslint-plugin-regexp');
185
+ const regexp$1 = await loadPlugin("eslint-plugin-regexp");
186
186
  return [{
187
- name: 'regexp/flat/recommended',
188
- ...(regexp$1.configs['flat/recommended'])
187
+ name: "regexp/flat/recommended",
188
+ ...regexp$1.configs["flat/recommended"]
189
189
  }, {
190
- name: '@kazupon/eslint-regexp',
191
- rules: {...overrideRules}
190
+ name: "@kazupon/eslint-regexp",
191
+ rules: { ...overrideRules }
192
192
  }];
193
193
  }
194
194
 
@@ -196,18 +196,18 @@ async function regexp(options = {}) {
196
196
  //#region src/configs/toml.ts
197
197
  async function toml(options = {}) {
198
198
  const { rules: overrideRules = {} } = options;
199
- const toml$1 = await loadPlugin('eslint-plugin-toml');
199
+ const toml$1 = await loadPlugin("eslint-plugin-toml");
200
200
  const configs = [];
201
- configs.push(...toml$1.configs['flat/standard'].map((config, index) => {
201
+ configs.push(...toml$1.configs["flat/standard"].map((config, index) => {
202
202
  return config.name ? config : {
203
203
  name: `toml/flat/standard/${index}`,
204
204
  ...config
205
205
  };
206
206
  }));
207
207
  const overriddenConfig = {
208
- name: '@kazupon/toml',
208
+ name: "@kazupon/toml",
209
209
  files: [GLOB_TOML],
210
- rules: {...overrideRules}
210
+ rules: { ...overrideRules }
211
211
  };
212
212
  configs.push(overriddenConfig);
213
213
  return configs;
@@ -217,10 +217,10 @@ async function toml(options = {}) {
217
217
  //#region src/configs/unicorn.ts
218
218
  async function unicorn(options = {}) {
219
219
  const { rules: overrideRules = {} } = options;
220
- const unicorn$1 = await loadPlugin('eslint-plugin-unicorn');
221
- return [unicorn$1.configs['flat/recommended'], {
222
- name: '@kazupon/unicorn',
223
- rules: {...overrideRules}
220
+ const unicorn$1 = await loadPlugin("eslint-plugin-unicorn");
221
+ return [unicorn$1.configs["flat/recommended"], {
222
+ name: "@kazupon/unicorn",
223
+ rules: { ...overrideRules }
224
224
  }];
225
225
  }
226
226
 
@@ -228,10 +228,10 @@ async function unicorn(options = {}) {
228
228
  //#region src/configs/prettier.ts
229
229
  async function prettier(options = {}) {
230
230
  const { rules: overrideRules = {} } = options;
231
- const prettier$1 = await loadPlugin('eslint-config-prettier');
231
+ const prettier$1 = await loadPlugin("eslint-config-prettier");
232
232
  return [prettier$1, {
233
- name: '@kazupon/prettier',
234
- rules: {...overrideRules}
233
+ name: "@kazupon/prettier",
234
+ rules: { ...overrideRules }
235
235
  }];
236
236
  }
237
237
 
@@ -239,9 +239,9 @@ async function prettier(options = {}) {
239
239
  //#region src/configs/jsonc.ts
240
240
  async function jsonc(options = {}) {
241
241
  const { rules: overrideRules = {} } = options;
242
- const kinds = [options.json ? 'json' : '', options.jsonc ? 'jsonc' : '', options.json5 ? 'json5' : ''];
242
+ const kinds = [options.json ? "json" : "", options.jsonc ? "jsonc" : "", options.json5 ? "json5" : ""];
243
243
  const usePrettier = !!options.prettier;
244
- const jsonc$1 = await loadPlugin('eslint-plugin-jsonc');
244
+ const jsonc$1 = await loadPlugin("eslint-plugin-jsonc");
245
245
  const configs = [];
246
246
  for (const kind of kinds) {
247
247
  if (kind) {
@@ -254,7 +254,7 @@ async function jsonc(options = {}) {
254
254
  }
255
255
  }
256
256
  if (usePrettier) {
257
- configs.push(...jsonc$1.configs['flat/prettier'].map((config, index) => {
257
+ configs.push(...jsonc$1.configs["flat/prettier"].map((config, index) => {
258
258
  return config.name ? config : {
259
259
  name: `jsonc/flat/prettier/${index}`,
260
260
  ...config
@@ -262,34 +262,34 @@ async function jsonc(options = {}) {
262
262
  }));
263
263
  }
264
264
  const overriddenConfig = {
265
- name: '@kazupon/jsonc',
265
+ name: "@kazupon/jsonc",
266
266
  files: [GLOB_JSON, GLOB_JSON5, GLOB_JSONC],
267
- rules: {...overrideRules}
267
+ rules: { ...overrideRules }
268
268
  };
269
269
  configs.push(...jsoncSort(), overriddenConfig);
270
270
  return configs;
271
271
  }
272
272
  function jsoncSort() {
273
273
  return [{
274
- name: '@kazupon/jsonc/sort/package.json',
275
- files: ['**/package.json'],
274
+ name: "@kazupon/jsonc/sort/package.json",
275
+ files: ["**/package.json"],
276
276
  rules: {
277
- 'jsonc/sort-array-values': ['error', {
278
- order: {type: 'asc'},
279
- pathPattern: '^files$'
277
+ "jsonc/sort-array-values": ["error", {
278
+ order: { type: "asc" },
279
+ pathPattern: "^files$"
280
280
  }],
281
- 'jsonc/sort-keys': ['error', {
282
- 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'],
283
- pathPattern: '^$'
281
+ "jsonc/sort-keys": ["error", {
282
+ 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"],
283
+ pathPattern: "^$"
284
284
  }, {
285
- order: {type: 'asc'},
286
- pathPattern: '^scripts$'
285
+ order: { type: "asc" },
286
+ pathPattern: "^scripts$"
287
287
  }, {
288
- order: {type: 'asc'},
289
- pathPattern: '^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$'
288
+ order: { type: "asc" },
289
+ pathPattern: "^(?:dev|peer|optional|bundled)?[Dd]ependencies(Meta)?$"
290
290
  }, {
291
- order: {type: 'asc'},
292
- pathPattern: '^(?:resolutions|overrides|pnpm.overrides)$'
291
+ order: { type: "asc" },
292
+ pathPattern: "^(?:resolutions|overrides|pnpm.overrides)$"
293
293
  }]
294
294
  }
295
295
  }];
@@ -300,16 +300,16 @@ function jsoncSort() {
300
300
  async function yml(options = {}) {
301
301
  const { rules: overrideRules = {} } = options;
302
302
  const usePrettier = !!options.prettier;
303
- const yml$1 = await loadPlugin('eslint-plugin-yml');
303
+ const yml$1 = await loadPlugin("eslint-plugin-yml");
304
304
  const configs = [];
305
- configs.push(...yml$1.configs['flat/standard'].map((config, index) => {
305
+ configs.push(...yml$1.configs["flat/standard"].map((config, index) => {
306
306
  return config.name ? config : {
307
307
  name: `yml/flat/standard/${index}`,
308
308
  ...config
309
309
  };
310
310
  }));
311
311
  if (usePrettier) {
312
- configs.push(...yml$1.configs['flat/prettier'].map((config, index) => {
312
+ configs.push(...yml$1.configs["flat/prettier"].map((config, index) => {
313
313
  return config.name ? config : {
314
314
  name: `yml/flat/prettier/${index}`,
315
315
  ...config
@@ -317,9 +317,9 @@ async function yml(options = {}) {
317
317
  }));
318
318
  }
319
319
  const overriddenConfig = {
320
- name: '@kazupon/yml',
320
+ name: "@kazupon/yml",
321
321
  files: [GLOB_YAML],
322
- rules: {...overrideRules}
322
+ rules: { ...overrideRules }
323
323
  };
324
324
  configs.push(overriddenConfig);
325
325
  return configs;
@@ -329,47 +329,153 @@ const yaml = yml;
329
329
  //#endregion
330
330
  //#region src/configs/vue.ts
331
331
  async function vue(options = {}) {
332
- const { rules: overrideRules = {}, parserOptions = {project: true} } = options;
332
+ const { rules: overrideRules = {}, parserOptions = { project: true } } = options;
333
333
  const useTypeScript = !!options.typescript;
334
- const vue$1 = await loadPlugin('eslint-plugin-vue');
335
- const vueParser = vue$1.configs['flat/base'][1]['languageOptions']['parser'];
334
+ const vue$1 = await loadPlugin("eslint-plugin-vue");
335
+ const vueParser = vue$1.configs["flat/base"][1]["languageOptions"]["parser"];
336
336
  async function getTypeScriptParser() {
337
- const ts = await loadPlugin('typescript-eslint');
337
+ const ts = await loadPlugin("typescript-eslint");
338
338
  return ts.parser;
339
339
  }
340
340
  const customConfig = {
341
- name: '@kazupon/vue',
341
+ name: "@kazupon/vue",
342
342
  files: [GLOB_VUE],
343
- rules: {...overrideRules}
343
+ rules: { ...overrideRules }
344
344
  };
345
345
  if (useTypeScript) {
346
346
  customConfig.languageOptions = {
347
347
  parser: vueParser,
348
348
  parserOptions: {
349
- sourceType: 'module',
349
+ sourceType: "module",
350
+ parser: await getTypeScriptParser(),
351
+ ecmaFeatures: { jsx: true },
352
+ extraFileExtensions: [".vue"],
353
+ ...parserOptions
354
+ }
355
+ };
356
+ }
357
+ return [...vue$1.configs["flat/recommended"], customConfig];
358
+ }
359
+
360
+ //#endregion
361
+ //#region src/configs/svelte.ts
362
+ async function svelte(options = {}) {
363
+ const { rules: overrideRules = {}, parserOptions = { project: true } } = options;
364
+ const useTypeScript = !!options.typescript;
365
+ const svelte$1 = await loadPlugin("eslint-plugin-svelte");
366
+ const svelteParser = svelte$1.configs["flat/base"][1]["languageOptions"]["parser"];
367
+ async function getTypeScriptParser() {
368
+ const ts = await loadPlugin("typescript-eslint");
369
+ return ts.parser;
370
+ }
371
+ const customConfig = {
372
+ name: "@kazupon/svelte",
373
+ files: [GLOB_SVELTE],
374
+ rules: { ...overrideRules }
375
+ };
376
+ if (useTypeScript) {
377
+ customConfig.languageOptions = {
378
+ parser: svelteParser,
379
+ parserOptions: {
380
+ sourceType: "module",
350
381
  parser: await getTypeScriptParser(),
351
- ecmaFeatures: {jsx: true},
352
- extraFileExtensions: ['.vue'],
382
+ ecmaFeatures: { jsx: true },
383
+ extraFileExtensions: [".svelte"],
353
384
  ...parserOptions
354
385
  }
355
386
  };
356
387
  }
357
- return [...(vue$1.configs['flat/recommended']), customConfig];
388
+ return [...svelte$1.configs["flat/recommended"], customConfig];
358
389
  }
359
390
 
360
391
  //#endregion
361
- Object.defineProperty(exports, '__esModule', { value: true });
362
- exports.comments = comments;
363
- exports.defineConfig = defineConfig;
364
- exports.javascript = javascript;
365
- exports.jsdoc = jsdoc;
366
- exports.jsonc = jsonc;
367
- exports.prettier = prettier;
368
- exports.promise = promise;
369
- exports.regexp = regexp;
370
- exports.toml = toml;
371
- exports.typescript = typescript;
372
- exports.unicorn = unicorn;
373
- exports.vue = vue;
374
- exports.yaml = yaml;
375
- exports.yml = yml;
392
+ Object.defineProperty(exports, 'comments', {
393
+ enumerable: true,
394
+ get: function () {
395
+ return comments;
396
+ }
397
+ });
398
+ Object.defineProperty(exports, 'defineConfig', {
399
+ enumerable: true,
400
+ get: function () {
401
+ return defineConfig;
402
+ }
403
+ });
404
+ Object.defineProperty(exports, 'javascript', {
405
+ enumerable: true,
406
+ get: function () {
407
+ return javascript;
408
+ }
409
+ });
410
+ Object.defineProperty(exports, 'jsdoc', {
411
+ enumerable: true,
412
+ get: function () {
413
+ return jsdoc;
414
+ }
415
+ });
416
+ Object.defineProperty(exports, 'jsonc', {
417
+ enumerable: true,
418
+ get: function () {
419
+ return jsonc;
420
+ }
421
+ });
422
+ Object.defineProperty(exports, 'prettier', {
423
+ enumerable: true,
424
+ get: function () {
425
+ return prettier;
426
+ }
427
+ });
428
+ Object.defineProperty(exports, 'promise', {
429
+ enumerable: true,
430
+ get: function () {
431
+ return promise;
432
+ }
433
+ });
434
+ Object.defineProperty(exports, 'regexp', {
435
+ enumerable: true,
436
+ get: function () {
437
+ return regexp;
438
+ }
439
+ });
440
+ Object.defineProperty(exports, 'svelte', {
441
+ enumerable: true,
442
+ get: function () {
443
+ return svelte;
444
+ }
445
+ });
446
+ Object.defineProperty(exports, 'toml', {
447
+ enumerable: true,
448
+ get: function () {
449
+ return toml;
450
+ }
451
+ });
452
+ Object.defineProperty(exports, 'typescript', {
453
+ enumerable: true,
454
+ get: function () {
455
+ return typescript;
456
+ }
457
+ });
458
+ Object.defineProperty(exports, 'unicorn', {
459
+ enumerable: true,
460
+ get: function () {
461
+ return unicorn;
462
+ }
463
+ });
464
+ Object.defineProperty(exports, 'vue', {
465
+ enumerable: true,
466
+ get: function () {
467
+ return vue;
468
+ }
469
+ });
470
+ Object.defineProperty(exports, 'yaml', {
471
+ enumerable: true,
472
+ get: function () {
473
+ return yaml;
474
+ }
475
+ });
476
+ Object.defineProperty(exports, 'yml', {
477
+ enumerable: true,
478
+ get: function () {
479
+ return yml;
480
+ }
481
+ });