@jiakun-zhao/eslint-config 4.0.5 → 4.0.8

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.d.mts CHANGED
@@ -4,7 +4,7 @@ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
4
4
 
5
5
  /* This file is generated by eslint-typegen, for augmenting rules types in ESLint */
6
6
  /* You might want to include this file in tsconfig.json but excluded from git */
7
- /* eslint-typegen-hash: pO9sA--WvvRHzqH6TbTpaT9k2jd5AX31nrPjLR7oOHs */
7
+ /* eslint-typegen-hash: TQHhqClWf45w96ekaecKHJx7rl7Dlt9vWYW8Bpb9sM0 */
8
8
 
9
9
 
10
10
 
@@ -1175,6 +1175,11 @@ interface RuleOptions {
1175
1175
  * @deprecated
1176
1176
  */
1177
1177
  'max-statements-per-line'?: Linter.RuleEntry<MaxStatementsPerLine>
1178
+ /**
1179
+ * Fix astro multi top level element indent
1180
+ * @see https://example.com/astro-multi-top-level-element-indent
1181
+ */
1182
+ 'mine/astro-multi-top-level-element-indent'?: Linter.RuleEntry<[]>
1178
1183
  /**
1179
1184
  * Enforce no blank before astro element
1180
1185
  * @see https://example.com/no-blank-before-astro-element
package/dist/index.d.ts CHANGED
@@ -4,7 +4,7 @@ import { FlatGitignoreOptions } from 'eslint-config-flat-gitignore';
4
4
 
5
5
  /* This file is generated by eslint-typegen, for augmenting rules types in ESLint */
6
6
  /* You might want to include this file in tsconfig.json but excluded from git */
7
- /* eslint-typegen-hash: pO9sA--WvvRHzqH6TbTpaT9k2jd5AX31nrPjLR7oOHs */
7
+ /* eslint-typegen-hash: TQHhqClWf45w96ekaecKHJx7rl7Dlt9vWYW8Bpb9sM0 */
8
8
 
9
9
 
10
10
 
@@ -1175,6 +1175,11 @@ interface RuleOptions {
1175
1175
  * @deprecated
1176
1176
  */
1177
1177
  'max-statements-per-line'?: Linter.RuleEntry<MaxStatementsPerLine>
1178
+ /**
1179
+ * Fix astro multi top level element indent
1180
+ * @see https://example.com/astro-multi-top-level-element-indent
1181
+ */
1182
+ 'mine/astro-multi-top-level-element-indent'?: Linter.RuleEntry<[]>
1178
1183
  /**
1179
1184
  * Enforce no blank before astro element
1180
1185
  * @see https://example.com/no-blank-before-astro-element
package/dist/index.mjs CHANGED
@@ -134,7 +134,7 @@ function createRule(rule) {
134
134
  async function astro() {
135
135
  const pluginAstro = await findDynamicPlugin("eslint-plugin-astro");
136
136
  return pluginAstro && createSharedAstroConfig(pluginAstro, {
137
- "mine/multi-root-element-indent": "warn",
137
+ "mine/astro-multi-top-level-element-indent": "warn",
138
138
  "mine/no-blank-before-astro-element": "warn",
139
139
  "mine/no-blank-in-astro-frontmatter-edge": "warn"
140
140
  });
@@ -373,14 +373,14 @@ function jsonc() {
373
373
  ];
374
374
  }
375
375
 
376
- const version = "4.0.5";
376
+ const version = "4.0.8";
377
377
 
378
- const name$3 = "multi-root-element-indent";
379
- const _multiRootElementIndent = createRule({
378
+ const name$3 = "astro-multi-top-level-element-indent";
379
+ const _astroMultiTopLevelElementIndent = createRule({
380
380
  name: name$3,
381
381
  meta: {
382
382
  docs: {
383
- description: "Fix astro multi root element index"
383
+ description: "Fix astro multi top level element indent"
384
384
  },
385
385
  schema: [],
386
386
  type: "layout",
@@ -440,13 +440,13 @@ const _noBlankBeforeAstroElement = createRule({
440
440
  if (!token && !isDocumentStart(node)) {
441
441
  context.report({
442
442
  fix: (fixer) => fixer.removeRange([0, node.range[0]]),
443
- loc: { line: 0, column: 0 },
443
+ loc: { start: { line: 1, column: 0 }, end: node.loc.start },
444
444
  messageId: "unexpectedBlank"
445
445
  });
446
446
  } else if (token && token.value === "---" && (!isLineStart(node) || numOfLines(token, node) !== 2)) {
447
447
  context.report({
448
448
  fix: (fixer) => fixer.replaceTextRange([token.range[1], node.range[0]], "\n\n"),
449
- loc: { line: 0, column: 0 },
449
+ loc: { start: token.loc.end, end: node.loc.start },
450
450
  messageId: "unexpectedBlank"
451
451
  });
452
452
  }
@@ -476,7 +476,7 @@ const _noBlankInAstroFrontmatterEdge = createRule({
476
476
  if (first && first.value === "---" && next && next.loc.start.line !== 2) {
477
477
  context.report({
478
478
  fix: (fixer) => fixer.replaceTextRange([3, next.range[0]], "\n"),
479
- loc: { line: 0, column: 0 },
479
+ loc: { start: { line: 1, column: 0 }, end: next.loc.start },
480
480
  messageId: "unexpectedBlank"
481
481
  });
482
482
  }
@@ -486,7 +486,7 @@ const _noBlankInAstroFrontmatterEdge = createRule({
486
486
  if (left && left.value !== "---" && right && right.value === "---" && numOfLines(left, right) !== 1) {
487
487
  context.report({
488
488
  fix: (fixer) => fixer.replaceTextRange([left.range[1], right.range[0]], "\n"),
489
- loc: { line: 0, column: 0 },
489
+ loc: { start: left.loc.end, end: right.loc.start },
490
490
  messageId: "unexpectedBlank"
491
491
  });
492
492
  }
@@ -520,7 +520,7 @@ const _noSpaceInEmptyObject = createRule({
520
520
  context.report({
521
521
  fix: (fixer) => fixer.replaceText(node, replaceValue),
522
522
  messageId: "unexpectedSpace",
523
- loc: { line: 0, column: 0 }
523
+ node
524
524
  });
525
525
  }
526
526
  },
@@ -534,7 +534,7 @@ const _noSpaceInEmptyObject = createRule({
534
534
  context.report({
535
535
  fix: (fixer) => fixer.replaceText(node, replaceValue),
536
536
  messageId: "unexpectedSpace",
537
- loc: { line: 0, column: 0 }
537
+ node
538
538
  });
539
539
  }
540
540
  }
@@ -543,10 +543,10 @@ const _noSpaceInEmptyObject = createRule({
543
543
  });
544
544
 
545
545
  const rules = {
546
- [name]: _noSpaceInEmptyObject,
546
+ [name$3]: _astroMultiTopLevelElementIndent,
547
547
  [name$2]: _noBlankBeforeAstroElement,
548
548
  [name$1]: _noBlankInAstroFrontmatterEdge,
549
- [name$3]: _multiRootElementIndent
549
+ [name]: _noSpaceInEmptyObject
550
550
  };
551
551
  const pluginMine = {
552
552
  meta: {
@@ -569,7 +569,7 @@ function mine() {
569
569
  }
570
570
 
571
571
  function overrides() {
572
- const configFileNames = ["eslint", "astro", "vite", "build", "uno", "unocss", "vitest"];
572
+ const configFileNames = ["eslint", "astro", "vite", "build", "nuxt", "unocss", "vitest"];
573
573
  const extensions = ["js", "mjs", "cjs", "ts", "mts", "cts"];
574
574
  return [
575
575
  {
@@ -602,10 +602,7 @@ function overrides() {
602
602
  ],
603
603
  rules: {
604
604
  "style/no-multiple-empty-lines": ["warn", { max: 0 }],
605
- "jsonc/sort-array-values": [
606
- "warn",
607
- { order: { type: "asc" }, pathPattern: "^files$" }
608
- ],
605
+ "jsonc/sort-array-values": ["warn", { order: { type: "asc" }, pathPattern: "^files$" }],
609
606
  "jsonc/sort-keys": [
610
607
  "warn",
611
608
  { order: packageJsonTopLevelOrder, pathPattern: "^$" },
@@ -741,7 +738,7 @@ function stylistic() {
741
738
  "style/jsx-closing-tag-location": "warn",
742
739
  "style/jsx-curly-brace-presence": "warn",
743
740
  "style/jsx-curly-newline": "warn",
744
- "style/jsx-curly-spacing": ["warn", { children: { when: "always" }, when: "never" }],
741
+ "style/jsx-curly-spacing": ["warn", { children: true, when: "never" }],
745
742
  "style/jsx-equals-spacing": "warn",
746
743
  "style/jsx-max-props-per-line": "off",
747
744
  "style/jsx-pascal-case": "warn",
@@ -959,7 +956,7 @@ async function vue() {
959
956
  ...pluginVue.configs["flat/essential"].map((c) => c.rules).reduce((acc, cur) => ({ ...acc, ...cur }), {}),
960
957
  "vue/attribute-hyphenation": "warn",
961
958
  "vue/attributes-order": ["warn", { alphabetical: true, order: ["UNIQUE", "DEFINITION", "CONDITIONALS", "LIST_RENDERING", "GLOBAL", "RENDER_MODIFIERS", "SLOT", "TWO_WAY_BINDING", "OTHER_DIRECTIVES", "CONTENT", "ATTR_SHORTHAND_BOOL", "ATTR_STATIC", "ATTR_DYNAMIC", "EVENTS"] }],
962
- "vue/block-order": "warn",
959
+ "vue/block-order": ["warn", { order: ["script", "template", "style"] }],
963
960
  "vue/block-tag-newline": "warn",
964
961
  "vue/component-name-in-template-casing": "warn",
965
962
  "vue/component-options-name-casing": ["warn", "PascalCase"],
@@ -977,6 +974,7 @@ async function vue() {
977
974
  "vue/html-indent": ["warn", indent],
978
975
  "vue/html-quotes": "warn",
979
976
  "vue/html-self-closing": ["warn", { html: { component: "always", normal: "never", void: "never" }, math: "always", svg: "always" }],
977
+ "vue/multi-word-component-names": "off",
980
978
  "vue/mustache-interpolation-spacing": "warn",
981
979
  "vue/no-import-compiler-macros": "warn",
982
980
  "vue/no-multi-spaces": "warn",
@@ -997,7 +995,8 @@ async function vue() {
997
995
  "vue/require-typed-ref": "warn",
998
996
  "vue/slot-name-casing": ["warn", "kebab-case"],
999
997
  "vue/static-class-names-order": "warn",
1000
- "vue/v-bind-style": ["wran", "shorthand", { sameNameShorthand: "always" }],
998
+ // 'vue/v-bind-style': ['warn', 'shorthand', { sameNameShorthand: 'always' }],
999
+ "vue/v-bind-style": "warn",
1001
1000
  "vue/v-for-delimiter-style": ["warn", "of"],
1002
1001
  "vue/v-on-event-hyphenation": "warn",
1003
1002
  "vue/v-on-handler-style": "warn",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jiakun-zhao/eslint-config",
3
3
  "type": "module",
4
- "version": "4.0.5",
4
+ "version": "4.0.8",
5
5
  "description": "Jiakun Zhao's ESLint config.",
6
6
  "author": "Jiakun Zhao <hi@zhaojiakun.com>",
7
7
  "license": "MIT",
@@ -69,7 +69,7 @@
69
69
  "scripts": {
70
70
  "build": "unbuild",
71
71
  "dev": "config-inspector --open=false",
72
- "release": "pnpm typegen && bumpp && pnpm publish && npx cnpm sync @jiakun-zhao/eslint-config",
72
+ "release": "bumpp && pnpm publish && npx cnpm sync @jiakun-zhao/eslint-config",
73
73
  "stub": "unbuild --stub",
74
74
  "test": "vitest",
75
75
  "typegen": "tsx ./scripts/typegen.ts"