@jiakun-zhao/eslint-config 4.0.8 → 4.0.10

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.mjs CHANGED
@@ -373,7 +373,7 @@ function jsonc() {
373
373
  ];
374
374
  }
375
375
 
376
- const version = "4.0.8";
376
+ const version = "4.0.10";
377
377
 
378
378
  const name$3 = "astro-multi-top-level-element-indent";
379
379
  const _astroMultiTopLevelElementIndent = createRule({
@@ -393,7 +393,7 @@ const _astroMultiTopLevelElementIndent = createRule({
393
393
  return {
394
394
  AstroFragment(node) {
395
395
  const children = node.children.filter((it) => it.type === "JSXElement" && it.loc.start.column !== 0);
396
- if (!children.length)
396
+ if (children.length === 0)
397
397
  return;
398
398
  context.report({
399
399
  loc: { line: 0, column: 0 },
@@ -512,7 +512,7 @@ const _noSpaceInEmptyObject = createRule({
512
512
  create(context) {
513
513
  return {
514
514
  ObjectExpression(node) {
515
- if (node.properties.length)
515
+ if (node.properties.length > 0)
516
516
  return;
517
517
  const code = context.sourceCode.getText(node);
518
518
  const replaceValue = "{}";
@@ -525,7 +525,7 @@ const _noSpaceInEmptyObject = createRule({
525
525
  }
526
526
  },
527
527
  ExportNamedDeclaration(node) {
528
- if (node.declaration || node.specifiers.length) {
528
+ if (node.declaration || node.specifiers.length > 0) {
529
529
  return;
530
530
  }
531
531
  const code = context.sourceCode.getText(node);
@@ -563,7 +563,8 @@ function mine() {
563
563
  mine: pluginMine
564
564
  },
565
565
  rules: {
566
- "mine/no-space-in-empty-block": "warn"
566
+ // use unicorn/empty-brace-spaces
567
+ // 'mine/no-space-in-empty-block': 'warn',
567
568
  }
568
569
  };
569
570
  }
@@ -576,7 +577,7 @@ function overrides() {
576
577
  name: "override/sort-config-files",
577
578
  files: [
578
579
  ...configFileNames.reduce(
579
- (acc, cur) => acc.concat(...extensions.map((ext) => `${cur}.config.${ext}`)),
580
+ (acc, cur) => [...acc, ...extensions.map((ext) => `${cur}.config.${ext}`)],
580
581
  []
581
582
  )
582
583
  ],
@@ -630,7 +631,8 @@ function perfectionist() {
630
631
  type: "natural"
631
632
  }],
632
633
  "perfectionist/sort-named-exports": ["warn", { order: "asc", type: "natural" }],
633
- "perfectionist/sort-named-imports": ["warn", { order: "asc", type: "natural" }]
634
+ // 'perfectionist/sort-named-imports': ['warn', { order: 'asc', type: 'natural' }],
635
+ "sort-imports": ["warn", { ignoreCase: false, ignoreDeclarationSort: true, ignoreMemberSort: false }]
634
636
  }
635
637
  };
636
638
  }
@@ -872,19 +874,29 @@ function unicorn() {
872
874
  },
873
875
  rules: {
874
876
  "unicorn/consistent-empty-array-spread": "warn",
877
+ "unicorn/empty-brace-spaces": "warn",
875
878
  "unicorn/error-message": "warn",
876
879
  "unicorn/escape-case": "warn",
880
+ "unicorn/explicit-length-check": "warn",
877
881
  "unicorn/new-for-builtins": "warn",
878
882
  "unicorn/no-instanceof-builtins": "warn",
883
+ "unicorn/no-negation-in-equality-check": "warn",
879
884
  "unicorn/no-new-array": "warn",
880
885
  "unicorn/no-new-buffer": "warn",
886
+ "unicorn/no-useless-length-check": "warn",
881
887
  "unicorn/number-literal-case": "warn",
888
+ "unicorn/prefer-array-flat-map": "warn",
882
889
  "unicorn/prefer-dom-node-text-content": "warn",
883
890
  "unicorn/prefer-includes": "warn",
891
+ "unicorn/prefer-logical-operator-over-ternary": "warn",
884
892
  "unicorn/prefer-node-protocol": "warn",
885
893
  "unicorn/prefer-number-properties": "warn",
886
894
  "unicorn/prefer-string-starts-ends-with": "warn",
895
+ "unicorn/prefer-string-trim-start-end": "warn",
896
+ "unicorn/prefer-ternary": "warn",
887
897
  "unicorn/prefer-type-error": "warn",
898
+ "unicorn/string-content": "warn",
899
+ "unicorn/switch-case-braces": "warn",
888
900
  "unicorn/throw-new-error": "warn"
889
901
  }
890
902
  };
@@ -914,7 +926,7 @@ function unusedImports() {
914
926
 
915
927
  async function vue() {
916
928
  const pluginVue = await findDynamicPlugin("eslint-plugin-vue");
917
- return pluginVue && {
929
+ return pluginVue && [{
918
930
  files: [
919
931
  "**/*.vue"
920
932
  ],
@@ -994,16 +1006,40 @@ async function vue() {
994
1006
  "vue/require-macro-variable-name": "warn",
995
1007
  "vue/require-typed-ref": "warn",
996
1008
  "vue/slot-name-casing": ["warn", "kebab-case"],
997
- "vue/static-class-names-order": "warn",
1009
+ // 'vue/static-class-names-order': 'warn',
998
1010
  // 'vue/v-bind-style': ['warn', 'shorthand', { sameNameShorthand: 'always' }],
999
1011
  "vue/v-bind-style": "warn",
1000
1012
  "vue/v-for-delimiter-style": ["warn", "of"],
1001
1013
  "vue/v-on-event-hyphenation": "warn",
1002
- "vue/v-on-handler-style": "warn",
1014
+ // 'vue/v-on-handler-style': 'warn',
1003
1015
  "vue/v-on-style": "warn",
1004
1016
  "vue/v-slot-style": "warn"
1005
1017
  }
1006
- };
1018
+ }, {
1019
+ files: [
1020
+ "**/*.vue"
1021
+ ],
1022
+ name: "vue/extension",
1023
+ rules: {
1024
+ "vue/array-bracket-newline": ["warn", "consistent"],
1025
+ "vue/array-bracket-spacing": "warn",
1026
+ "vue/arrow-spacing": "warn",
1027
+ "vue/block-spacing": "warn",
1028
+ "vue/comma-dangle": ["warn", "always-multiline"],
1029
+ "vue/comma-spacing": "warn",
1030
+ "vue/comma-style": "warn",
1031
+ "vue/key-spacing": "warn",
1032
+ "vue/keyword-spacing": "warn",
1033
+ "vue/no-multi-spaces": "warn",
1034
+ "vue/object-curly-newline": ["warn", { consistent: true }],
1035
+ "vue/object-curly-spacing": ["warn", "always"],
1036
+ "vue/operator-linebreak": ["warn", "before"],
1037
+ "vue/quote-props": ["warn", "consistent-as-needed"],
1038
+ "vue/space-in-parens": "warn",
1039
+ "vue/space-infix-ops": "warn",
1040
+ "vue/space-unary-ops": "warn"
1041
+ }
1042
+ }];
1007
1043
  }
1008
1044
 
1009
1045
  function index(options = {}) {
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.8",
4
+ "version": "4.0.10",
5
5
  "description": "Jiakun Zhao's ESLint config.",
6
6
  "author": "Jiakun Zhao <hi@zhaojiakun.com>",
7
7
  "license": "MIT",
@@ -56,7 +56,7 @@
56
56
  "@types/node": "^22.14.1",
57
57
  "@typescript-eslint/types": "^8.30.1",
58
58
  "bumpp": "^10.1.0",
59
- "eslint": "^9.24.0",
59
+ "eslint": "^9.25.0",
60
60
  "eslint-plugin-astro": "^1.3.1",
61
61
  "eslint-plugin-vue": "^10.0.0",
62
62
  "eslint-typegen": "^2.1.0",