@kazupon/eslint-config 0.26.1 → 0.28.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/dist/index.js CHANGED
@@ -7,6 +7,10 @@ import { mergeProcessors, processorPassThrough } from "eslint-merge-processors";
7
7
  //#region src/config.ts
8
8
  function defineConfig(...configs) {
9
9
  const baseConfigs = [];
10
+ /**
11
+ * built-in configurations
12
+ * baseConfigs.push(javascript().then(c => c))
13
+ */
10
14
  return new FlatConfigComposer().append(...baseConfigs, ...configs);
11
15
  }
12
16
 
@@ -345,6 +349,11 @@ function jsoncSort() {
345
349
  async function markdown(options = {}) {
346
350
  const { rules: overrideRules = {}, files = [GLOB_MARKDOWN], blockExtensions = [] } = options;
347
351
  const language = options.language || "gfm";
352
+ /**
353
+ * TODO: remove this option
354
+ * const fencedCodeBlocks =
355
+ * typeof options.fencedCodeBlocks === 'boolean' ? options.fencedCodeBlocks : true
356
+ */
348
357
  const markdown$1 = await loadPlugin("@eslint/markdown");
349
358
  const recommended = { ...markdown$1.configs["recommended"][0] };
350
359
  const codeblocks = markdown$1.configs.processor[2];
@@ -436,6 +445,14 @@ async function react(options = {}) {
436
445
  files: getGlobSourceFiles(useTypeScript),
437
446
  ...reactRefresh?.configs.recommended
438
447
  });
448
+ /**
449
+ * if (enableA11y) {
450
+ * configs.push({
451
+ * files: getFiles(),
452
+ * ...reactA11y.flatConfigs.recommended
453
+ * })
454
+ * }
455
+ */
439
456
  return [...configs, customConfig];
440
457
  }
441
458
 
@@ -454,6 +471,46 @@ async function regexp(options = {}) {
454
471
  }];
455
472
  }
456
473
 
474
+ //#endregion
475
+ //#region src/configs/stylistic.ts
476
+ async function stylistic(options = {}) {
477
+ const { rules: overrideRules = {}, customize = {
478
+ commaDangle: "never",
479
+ blockSpacing: true,
480
+ quoteProps: "as-needed",
481
+ pluginName: "@stylistic"
482
+ } } = options;
483
+ const stylistic$1 = await loadPlugin("@stylistic/eslint-plugin");
484
+ const config = stylistic$1.configs.customize(customize);
485
+ return [{
486
+ name: "@stylistic/eslint-plugin",
487
+ files: [GLOB_SRC, `${GLOB_MARKDOWN}/${GLOB_SRC}`],
488
+ plugins: { [customize.pluginName]: stylistic$1 },
489
+ rules: {
490
+ ...config.rules,
491
+ "@stylistic/brace-style": "off",
492
+ "@stylistic/arrow-parens": ["error", "as-needed"],
493
+ "@stylistic/lines-around-comment": ["error", {
494
+ beforeBlockComment: true,
495
+ beforeLineComment: true,
496
+ allowBlockStart: true,
497
+ allowObjectStart: true,
498
+ allowArrayStart: true,
499
+ allowClassStart: true,
500
+ allowEnumStart: true,
501
+ allowInterfaceStart: true,
502
+ allowModuleStart: true,
503
+ allowTypeStart: true
504
+ }],
505
+ "@stylistic/spaced-comment": ["error"],
506
+ "@stylistic/multiline-comment-style": ["error", "separate-lines"]
507
+ }
508
+ }, {
509
+ name: "@kazupon/@stylistic/overrides",
510
+ rules: { ...overrideRules }
511
+ }];
512
+ }
513
+
457
514
  //#endregion
458
515
  //#region src/configs/svelte.ts
459
516
  async function svelte(options = {}) {
@@ -657,6 +714,16 @@ async function vue(options = {}) {
657
714
  delete a11yRules.plugins;
658
715
  configs.push(a11yRules);
659
716
  }
717
+ if (options.i18n) {
718
+ const i18n = await loadPlugin("@intlify/eslint-plugin-vue-i18n");
719
+ configs.push(...i18n.configs["recommended"].map((config) => ({
720
+ ...config,
721
+ ignores: [GLOB_MARKDOWN]
722
+ })), {
723
+ name: "@intlify/vue-i18n/settings",
724
+ settings: { "vue-i18n": options.i18n }
725
+ });
726
+ }
660
727
  const customConfig = {
661
728
  name: "@kazupon/vue",
662
729
  files: [GLOB_VUE],
@@ -706,4 +773,4 @@ async function yml(options = {}) {
706
773
  const yaml = yml;
707
774
 
708
775
  //#endregion
709
- export { comments, css, defineConfig, imports, javascript, jsdoc, jsonc, markdown, md, prettier, promise, react, regexp, svelte, toml, typescript, unicorn, vitest, vue, yaml, yml };
776
+ export { comments, css, defineConfig, imports, javascript, jsdoc, jsonc, markdown, md, prettier, promise, react, regexp, stylistic, svelte, toml, typescript, unicorn, vitest, vue, yaml, yml };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kazupon/eslint-config",
3
3
  "description": "ESLint config for @kazupon",
4
- "version": "0.26.1",
4
+ "version": "0.28.0",
5
5
  "author": {
6
6
  "email": "kawakazu80@gmail.com",
7
7
  "name": "kazuya kawaguchi"
@@ -52,13 +52,15 @@
52
52
  "@eslint-community/eslint-plugin-eslint-comments": "^4.4.1",
53
53
  "@eslint/js": "^9.22.0",
54
54
  "@kazupon/jts-utils": "^0.6.0",
55
+ "@stylistic/eslint-plugin": "^4.2.0",
55
56
  "eslint-flat-config-utils": "^2.0.1",
56
57
  "eslint-merge-processors": "^2.0.0",
57
58
  "globals": "^16.0.0"
58
59
  },
59
60
  "peerDependencies": {
60
- "@eslint/css": ">=0.4.0",
61
+ "@eslint/css": ">=0.5.0",
61
62
  "@eslint/markdown": ">=6.1.0",
63
+ "@intlify/eslint-plugin-vue-i18n": ">=4.0.0",
62
64
  "@vitest/eslint-plugin": ">=1.0.0",
63
65
  "eslint": ">=8.56.0 || >=9.0.0",
64
66
  "eslint-config-prettier": ">=9.1.0",
@@ -91,6 +93,9 @@
91
93
  "@eslint/markdown": {
92
94
  "optional": true
93
95
  },
96
+ "@intlify/eslint-plugin-vue-i18n": {
97
+ "optional": true
98
+ },
94
99
  "@vitest/eslint-plugin": {
95
100
  "optional": true
96
101
  },
@@ -162,8 +167,9 @@
162
167
  }
163
168
  },
164
169
  "devDependencies": {
165
- "@eslint/css": "^0.5.0",
170
+ "@eslint/css": "^0.6.0",
166
171
  "@eslint/markdown": "^6.3.0",
172
+ "@intlify/eslint-plugin-vue-i18n": "^4.0.1",
167
173
  "@kazupon/prettier-config": "^0.1.1",
168
174
  "@types/eslint": "^9.6.1",
169
175
  "@types/node": "^22.13.11",
@@ -183,9 +189,9 @@
183
189
  "eslint-plugin-regexp": "^2.7.0",
184
190
  "eslint-plugin-svelte": "^2.46.1",
185
191
  "eslint-plugin-toml": "^0.12.0",
186
- "eslint-plugin-unicorn": "^57.0.0",
192
+ "eslint-plugin-unicorn": "^58.0.0",
187
193
  "eslint-plugin-unused-imports": "^4.1.4",
188
- "eslint-plugin-vue": "^9.33.0",
194
+ "eslint-plugin-vue": "^10.0.0",
189
195
  "eslint-plugin-vue-composable": "^1.0.0",
190
196
  "eslint-plugin-vue-scoped-css": "^2.9.0",
191
197
  "eslint-plugin-vuejs-accessibility": "^2.4.1",
@@ -196,7 +202,7 @@
196
202
  "knip": "^5.46.0",
197
203
  "lint-staged": "^15.5.0",
198
204
  "prettier": "^3.5.3",
199
- "svelte": "^4.2.19",
205
+ "svelte": "^5.0.0",
200
206
  "tsdown": "^0.6.9",
201
207
  "typescript": "^5.8.2",
202
208
  "typescript-eslint": "^8.27.0",