@ntnyq/eslint-config 2.7.3 → 2.8.1

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
@@ -135,8 +135,9 @@ import { default as default9 } from "eslint-plugin-unicorn";
135
135
  import { default as default10 } from "eslint-plugin-import-x";
136
136
  import { default as default11 } from "eslint-plugin-prettier";
137
137
  import { default as default12 } from "eslint-plugin-markdown";
138
- import { default as default13 } from "@antfu/eslint-plugin-unused-imports";
139
- import { default as default14 } from "@eslint-community/eslint-plugin-eslint-comments";
138
+ import { default as default13 } from "eslint-plugin-perfectionist";
139
+ import { default as default14 } from "@antfu/eslint-plugin-unused-imports";
140
+ import { default as default15 } from "@eslint-community/eslint-plugin-eslint-comments";
140
141
  import * as parserToml from "toml-eslint-parser";
141
142
  import * as parserYaml from "yaml-eslint-parser";
142
143
  import * as parserVue from "vue-eslint-parser";
@@ -344,10 +345,10 @@ var comments = defineConfig([
344
345
  {
345
346
  name: "ntnyq/eslint-comments",
346
347
  plugins: {
347
- "@eslint-community/eslint-comments": default14
348
+ "@eslint-community/eslint-comments": default15
348
349
  },
349
350
  rules: {
350
- ...default14.configs.recommended.rules,
351
+ ...default15.configs.recommended.rules,
351
352
  "@eslint-community/eslint-comments/disable-enable-pair": ["error", { allowWholeFile: true }]
352
353
  }
353
354
  }
@@ -374,10 +375,6 @@ var javascript = defineConfig([
374
375
  rules: {
375
376
  // standard v17.0.0
376
377
  "accessor-pairs": ["error", { setWithoutGet: true, enforceForClassMembers: true }],
377
- "array-bracket-spacing": ["error", "never"],
378
- "arrow-spacing": ["error", { before: true, after: true }],
379
- "block-spacing": ["error", "always"],
380
- "brace-style": ["error", "1tbs", { allowSingleLine: true }],
381
378
  camelcase: [
382
379
  "error",
383
380
  {
@@ -386,60 +383,11 @@ var javascript = defineConfig([
386
383
  ignoreGlobals: true
387
384
  }
388
385
  ],
389
- "comma-spacing": ["error", { before: false, after: true }],
390
- "comma-style": ["error", "last"],
391
- "computed-property-spacing": ["error", "never", { enforceForClassMembers: true }],
392
386
  "constructor-super": "error",
393
387
  curly: ["error", "multi-line"],
394
388
  "default-case-last": "error",
395
- "dot-location": ["error", "property"],
396
389
  "dot-notation": ["error", { allowKeywords: true }],
397
- "eol-last": "error",
398
- "func-call-spacing": ["error", "never"],
399
- indent: [
400
- "error",
401
- 2,
402
- {
403
- SwitchCase: 1,
404
- VariableDeclarator: 1,
405
- outerIIFEBody: 1,
406
- MemberExpression: 1,
407
- FunctionDeclaration: { parameters: 1, body: 1 },
408
- FunctionExpression: { parameters: 1, body: 1 },
409
- CallExpression: { arguments: 1 },
410
- ArrayExpression: 1,
411
- ObjectExpression: 1,
412
- ImportDeclaration: 1,
413
- flatTernaryExpressions: false,
414
- ignoreComments: false,
415
- ignoredNodes: [
416
- "TemplateLiteral *",
417
- "JSXElement",
418
- "JSXElement > *",
419
- "JSXAttribute",
420
- "JSXIdentifier",
421
- "JSXNamespacedName",
422
- "JSXMemberExpression",
423
- "JSXSpreadAttribute",
424
- "JSXExpressionContainer",
425
- "JSXOpeningElement",
426
- "JSXClosingElement",
427
- "JSXFragment",
428
- "JSXOpeningFragment",
429
- "JSXClosingFragment",
430
- "JSXText",
431
- "JSXEmptyExpression",
432
- "JSXSpreadChild"
433
- ],
434
- offsetTernaryExpressions: true
435
- }
436
- ],
437
- "key-spacing": ["error", { beforeColon: false, afterColon: true }],
438
- "keyword-spacing": ["error", { before: true, after: true }],
439
- "lines-between-class-members": ["error", "always", { exceptAfterSingleLine: true }],
440
- "multiline-ternary": ["error", "always-multiline"],
441
390
  "new-cap": ["error", { newIsCap: true, capIsNew: false, properties: true }],
442
- "new-parens": "error",
443
391
  "no-array-constructor": "error",
444
392
  "no-async-promise-executor": "error",
445
393
  "no-caller": "error",
@@ -464,9 +412,7 @@ var javascript = defineConfig([
464
412
  "no-extend-native": "error",
465
413
  "no-extra-bind": "error",
466
414
  "no-extra-boolean-cast": "error",
467
- "no-extra-parens": ["error", "functions"],
468
415
  "no-fallthrough": "error",
469
- "no-floating-decimal": "error",
470
416
  "no-func-assign": "error",
471
417
  "no-global-assign": "error",
472
418
  "no-implied-eval": "error",
@@ -480,23 +426,8 @@ var javascript = defineConfig([
480
426
  "no-misleading-character-class": "error",
481
427
  "no-prototype-builtins": "error",
482
428
  "no-useless-catch": "error",
483
- "no-mixed-operators": [
484
- "error",
485
- {
486
- groups: [
487
- ["==", "!=", "===", "!==", ">", ">=", "<", "<="],
488
- ["&&", "||"],
489
- ["in", "instanceof"]
490
- ],
491
- allowSamePrecedence: true
492
- }
493
- ],
494
- "no-mixed-spaces-and-tabs": "error",
495
- "no-multiple-empty-lines": ["error", { max: 1, maxBOF: 0, maxEOF: 0 }],
496
429
  "no-new": "error",
497
430
  "no-new-func": "error",
498
- "no-new-object": "error",
499
- "no-new-symbol": "error",
500
431
  "no-new-wrappers": "error",
501
432
  "no-obj-calls": "error",
502
433
  "no-octal": "error",
@@ -509,11 +440,9 @@ var javascript = defineConfig([
509
440
  "no-sequences": "error",
510
441
  "no-shadow-restricted-names": "error",
511
442
  "no-sparse-arrays": "error",
512
- "no-tabs": "error",
513
443
  "no-template-curly-in-string": "error",
514
444
  "no-this-before-super": "error",
515
445
  "no-throw-literal": "error",
516
- "no-trailing-spaces": "error",
517
446
  "no-undef": "error",
518
447
  "no-undef-init": "error",
519
448
  "no-unexpected-multiline": "error",
@@ -545,23 +474,9 @@ var javascript = defineConfig([
545
474
  "no-useless-constructor": "error",
546
475
  "no-useless-rename": "error",
547
476
  "no-useless-return": "error",
548
- "no-whitespace-before-property": "error",
549
- "object-curly-newline": ["error", { multiline: true, consistent: true }],
550
- "object-curly-spacing": ["error", "always"],
551
- "object-property-newline": ["error", { allowMultiplePropertiesPerLine: true }],
552
- "padded-blocks": ["error", { blocks: "never", switches: "never", classes: "never" }],
553
477
  "prefer-promise-reject-errors": "error",
554
478
  "prefer-regex-literals": ["error", { disallowRedundantWrapping: true }],
555
- "quote-props": ["error", "as-needed"],
556
- "rest-spread-spacing": ["error", "never"],
557
- semi: ["error", "never"],
558
- "semi-spacing": ["error", { before: false, after: true }],
559
- "space-before-blocks": ["error", "always"],
560
- "space-in-parens": ["error", "never"],
561
- "space-infix-ops": "error",
562
- "space-unary-ops": ["error", { words: true, nonwords: false }],
563
479
  "symbol-description": "error",
564
- "template-tag-spacing": ["error", "never"],
565
480
  "unicode-bom": ["error", "never"],
566
481
  "use-isnan": [
567
482
  "error",
@@ -571,32 +486,14 @@ var javascript = defineConfig([
571
486
  }
572
487
  ],
573
488
  "valid-typeof": ["error", { requireStringLiterals: true }],
574
- "wrap-iife": ["error", "any", { functionPrototypeMethods: true }],
575
489
  yoda: ["error", "never"],
576
490
  // es6+
577
491
  "no-var": "error",
578
492
  "prefer-rest-params": "error",
579
493
  "prefer-spread": "error",
580
494
  "prefer-template": "error",
581
- "template-curly-spacing": "error",
582
- "generator-star-spacing": "off",
583
495
  "no-empty-static-block": "error",
584
496
  "no-new-native-nonconstructor": "error",
585
- "arrow-parens": [
586
- "error",
587
- "as-needed",
588
- {
589
- requireForBlockBody: false
590
- }
591
- ],
592
- quotes: [
593
- "error",
594
- "single",
595
- {
596
- avoidEscape: true,
597
- allowTemplateLiterals: false
598
- }
599
- ],
600
497
  "prefer-const": [
601
498
  "error",
602
499
  {
@@ -619,21 +516,6 @@ var javascript = defineConfig([
619
516
  avoidQuotes: true
620
517
  }
621
518
  ],
622
- "spaced-comment": [
623
- "error",
624
- "always",
625
- {
626
- line: {
627
- markers: ["/"],
628
- exceptions: ["/", "#"]
629
- },
630
- block: {
631
- markers: ["!"],
632
- exceptions: ["*"],
633
- balanced: true
634
- }
635
- }
636
- ],
637
519
  // best-practice
638
520
  eqeqeq: ["error", "smart"],
639
521
  complexity: ["error", { max: 30 }],
@@ -642,7 +524,6 @@ var javascript = defineConfig([
642
524
  "consistent-return": "off",
643
525
  "no-alert": "error",
644
526
  "no-case-declarations": "error",
645
- "no-multi-spaces": "error",
646
527
  "no-multi-str": "error",
647
528
  "no-with": "error",
648
529
  "no-void": "error",
@@ -651,12 +532,9 @@ var javascript = defineConfig([
651
532
  "require-await": "off",
652
533
  "no-return-assign": "off",
653
534
  "one-var": ["error", "never"],
654
- "operator-linebreak": ["error", "before"],
655
- "comma-dangle": ["error", "always-multiline"],
656
535
  "max-params": ["error", { max: 5 }],
657
536
  "max-depth": ["error", { max: 5 }],
658
537
  "max-nested-callbacks": ["error", { max: 10 }],
659
- "max-statements-per-line": ["error", { max: 2 }],
660
538
  "max-lines": [
661
539
  "error",
662
540
  {
@@ -681,19 +559,6 @@ var javascript = defineConfig([
681
559
  variables: true
682
560
  }
683
561
  ],
684
- "max-len": [
685
- "error",
686
- {
687
- code: 200,
688
- tabWidth: 2,
689
- comments: 200,
690
- ignoreUrls: true,
691
- ignoreStrings: true,
692
- ignoreRegExpLiterals: true,
693
- ignoreTemplateLiterals: true,
694
- ignoreTrailingComments: true
695
- }
696
- ],
697
562
  "sort-imports": [
698
563
  "error",
699
564
  {
@@ -825,9 +690,7 @@ var typescript = defineConfig([
825
690
  {
826
691
  name: "ntnyq/ts/cjs",
827
692
  files: [GLOB_JS],
828
- rules: {
829
- "@typescript-eslint/no-var-requires": "off"
830
- }
693
+ rules: {}
831
694
  }
832
695
  ]);
833
696
 
@@ -836,7 +699,7 @@ var unusedImports = defineConfig([
836
699
  {
837
700
  name: "ntnyq/unused-imports",
838
701
  plugins: {
839
- "unused-imports": default13
702
+ "unused-imports": default14
840
703
  },
841
704
  rules: {
842
705
  "@typescript-eslint/no-unused-vars": "off",
@@ -854,6 +717,43 @@ var unusedImports = defineConfig([
854
717
  }
855
718
  ]);
856
719
 
720
+ // src/configs/perfectionist.ts
721
+ var perfectionist = defineConfig([
722
+ {
723
+ name: "ntnyq/perfectionist",
724
+ plugins: {
725
+ perfectionist: default13
726
+ },
727
+ rules: {
728
+ "perfectionist/sort-imports": [
729
+ "error",
730
+ {
731
+ groups: [
732
+ "builtin",
733
+ "external",
734
+ "internal",
735
+ "internal-type",
736
+ "parent",
737
+ "parent-type",
738
+ "sibling",
739
+ "sibling-type",
740
+ "index",
741
+ "index-type",
742
+ "object",
743
+ "type",
744
+ "side-effect",
745
+ "side-effect-style"
746
+ ],
747
+ internalPattern: ["~/**", "@/**", "#**"],
748
+ newlinesBetween: "ignore"
749
+ }
750
+ ],
751
+ "perfectionist/sort-named-exports": ["warn", { groupKind: "values-first" }],
752
+ "perfectionist/sort-named-imports": ["warn", { groupKind: "values-first" }]
753
+ }
754
+ }
755
+ ]);
756
+
857
757
  // src/configs/regexp.ts
858
758
  var regexp = defineConfig([
859
759
  /**
@@ -896,8 +796,6 @@ var yml = defineConfig([
896
796
  yml: default4
897
797
  },
898
798
  rules: {
899
- // Avoid conflicts with js comment
900
- "spaced-comment": "off",
901
799
  ...default4.configs.standard.rules,
902
800
  ...default4.configs.prettier.rules,
903
801
  "yml/no-empty-mapping-value": "off",
@@ -918,8 +816,6 @@ var toml = defineConfig([
918
816
  toml: default5
919
817
  },
920
818
  rules: {
921
- // Avoid conflicts with js comment
922
- "spaced-comment": "off",
923
819
  "toml/comma-style": "error",
924
820
  "toml/keys-order": "error",
925
821
  "toml/no-space-dots": "error",
@@ -1225,7 +1121,6 @@ var markdown = defineConfig([
1225
1121
  "@typescript-eslint/no-redeclare": "off",
1226
1122
  "@typescript-eslint/no-namespace": "off",
1227
1123
  "@typescript-eslint/no-unused-vars": "off",
1228
- "@typescript-eslint/no-var-requires": "off",
1229
1124
  "@typescript-eslint/no-extraneous-class": "off",
1230
1125
  "@typescript-eslint/no-use-before-define": "off"
1231
1126
  }
@@ -1598,18 +1493,20 @@ export {
1598
1493
  parserToml,
1599
1494
  parserVue,
1600
1495
  parserYaml,
1601
- default14 as pluginComments,
1496
+ perfectionist,
1497
+ default15 as pluginComments,
1602
1498
  default10 as pluginImport,
1603
1499
  default7 as pluginJsdoc,
1604
1500
  default6 as pluginJsonc,
1605
1501
  default12 as pluginMarkdown,
1606
1502
  default2 as pluginNode,
1503
+ default13 as pluginPerfectionist,
1607
1504
  default11 as pluginPrettier,
1608
1505
  pluginRegexp,
1609
1506
  default5 as pluginToml,
1610
1507
  default9 as pluginUnicorn,
1611
1508
  default8 as pluginUnoCSS,
1612
- default13 as pluginUnusedImports,
1509
+ default14 as pluginUnusedImports,
1613
1510
  default3 as pluginVue,
1614
1511
  default4 as pluginYaml,
1615
1512
  prettier,
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@ntnyq/eslint-config",
3
3
  "type": "module",
4
- "version": "2.7.3",
5
- "packageManager": "pnpm@9.6.0",
4
+ "version": "2.8.1",
5
+ "packageManager": "pnpm@9.7.0",
6
6
  "description": "ESLint flat config of ntnyq",
7
7
  "keywords": [
8
8
  "eslint",
@@ -57,44 +57,45 @@
57
57
  "dependencies": {
58
58
  "@antfu/eslint-plugin-unused-imports": "^4.0.0",
59
59
  "@eslint-community/eslint-plugin-eslint-comments": "^4.3.0",
60
- "@eslint/js": "^9.7.0",
60
+ "@eslint/js": "^9.9.0",
61
61
  "@types/eslint": "^9.6.0",
62
- "@unocss/eslint-plugin": "^0.61.5",
62
+ "@unocss/eslint-plugin": "^0.61.9",
63
63
  "eslint-config-prettier": "^9.1.0",
64
- "eslint-flat-config-utils": "^0.2.5",
64
+ "eslint-flat-config-utils": "^0.3.0",
65
65
  "eslint-plugin-command": "^0.2.3",
66
66
  "eslint-plugin-import-x": "^3.1.0",
67
- "eslint-plugin-jsdoc": "^48.8.3",
67
+ "eslint-plugin-jsdoc": "^50.0.0",
68
68
  "eslint-plugin-jsonc": "^2.16.0",
69
69
  "eslint-plugin-markdown": "^5.1.0",
70
- "eslint-plugin-n": "^17.10.1",
70
+ "eslint-plugin-n": "^17.10.2",
71
+ "eslint-plugin-perfectionist": "^3.1.3",
71
72
  "eslint-plugin-prettier": "^5.2.1",
72
73
  "eslint-plugin-regexp": "^2.6.0",
73
74
  "eslint-plugin-toml": "^0.11.1",
74
75
  "eslint-plugin-unicorn": "^55.0.0",
75
76
  "eslint-plugin-vue": "^9.27.0",
76
77
  "eslint-plugin-yml": "^1.14.0",
77
- "globals": "^15.8.0",
78
+ "globals": "^15.9.0",
78
79
  "jsonc-eslint-parser": "^2.4.0",
79
80
  "local-pkg": "^0.5.0",
80
81
  "prettier": "^3.3.3",
81
82
  "toml-eslint-parser": "^0.10.0",
82
- "typescript-eslint": "^8.0.0-alpha.49",
83
+ "typescript-eslint": "^8.0.1",
83
84
  "vue-eslint-parser": "^9.4.3",
84
85
  "yaml-eslint-parser": "^1.2.3"
85
86
  },
86
87
  "devDependencies": {
87
88
  "@ntnyq/prettier-config": "^1.21.2",
88
- "@types/node": "^20.14.12",
89
- "bumpp": "^9.4.1",
90
- "eslint": "^9.7.0",
91
- "eslint-typegen": "^0.2.4",
92
- "husky": "^9.1.2",
89
+ "@types/node": "^20.14.15",
90
+ "bumpp": "^9.4.2",
91
+ "eslint": "^9.9.0",
92
+ "eslint-typegen": "^0.3.0",
93
+ "husky": "^9.1.4",
93
94
  "nano-staged": "^0.8.0",
94
95
  "npm-run-all2": "^6.2.2",
95
96
  "rimraf": "^6.0.1",
96
- "tsup": "^8.2.3",
97
- "tsx": "^4.16.2",
97
+ "tsup": "^8.2.4",
98
+ "tsx": "^4.17.0",
98
99
  "typescript": "^5.5.4",
99
100
  "zx": "^8.1.4"
100
101
  },