@ntnyq/eslint-config 4.1.0 → 4.3.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.d.mts +301 -191
- package/dist/index.mjs +161 -59
- package/package.json +40 -43
package/dist/index.mjs
CHANGED
|
@@ -585,6 +585,11 @@ const configVue = (options = {}) => {
|
|
|
585
585
|
];
|
|
586
586
|
};
|
|
587
587
|
|
|
588
|
+
const disabledCoreRules$1 = {
|
|
589
|
+
"no-irregular-whitespace": "off",
|
|
590
|
+
"no-unused-vars": "off",
|
|
591
|
+
"spaced-comment": "off"
|
|
592
|
+
};
|
|
588
593
|
const configYml = (options = {}) => {
|
|
589
594
|
const { files = [GLOB_YAML] } = options;
|
|
590
595
|
return [
|
|
@@ -598,10 +603,47 @@ const configYml = (options = {}) => {
|
|
|
598
603
|
parser: parserYaml
|
|
599
604
|
},
|
|
600
605
|
rules: {
|
|
601
|
-
...pluginYml.configs.standard.rules,
|
|
602
|
-
...pluginYml.configs.prettier.rules,
|
|
603
606
|
"yml/no-empty-mapping-value": "off",
|
|
604
|
-
"yml/
|
|
607
|
+
"yml/block-mapping": "error",
|
|
608
|
+
"yml/block-mapping-question-indicator-newline": "error",
|
|
609
|
+
"yml/block-sequence": "error",
|
|
610
|
+
"yml/block-sequence-hyphen-indicator-newline": "error",
|
|
611
|
+
"yml/flow-mapping-curly-newline": "error",
|
|
612
|
+
"yml/flow-mapping-curly-spacing": "error",
|
|
613
|
+
"yml/flow-sequence-bracket-newline": "error",
|
|
614
|
+
"yml/flow-sequence-bracket-spacing": "error",
|
|
615
|
+
"yml/indent": "error",
|
|
616
|
+
"yml/key-spacing": "error",
|
|
617
|
+
"yml/no-empty-document": "error",
|
|
618
|
+
"yml/no-empty-key": "error",
|
|
619
|
+
"yml/no-empty-sequence-entry": "error",
|
|
620
|
+
"yml/no-irregular-whitespace": "error",
|
|
621
|
+
"yml/no-tab-indent": "error",
|
|
622
|
+
"yml/plain-scalar": "error",
|
|
623
|
+
"yml/quotes": [
|
|
624
|
+
"error",
|
|
625
|
+
{
|
|
626
|
+
avoidEscape: false,
|
|
627
|
+
prefer: "single"
|
|
628
|
+
}
|
|
629
|
+
],
|
|
630
|
+
"yml/spaced-comment": "error",
|
|
631
|
+
"yml/vue-custom-block/no-parsing-error": "error",
|
|
632
|
+
...disabledCoreRules$1,
|
|
633
|
+
...options.prettier ? {
|
|
634
|
+
"yml/block-mapping-colon-indicator-newline": "off",
|
|
635
|
+
"yml/block-mapping-question-indicator-newline": "off",
|
|
636
|
+
"yml/block-sequence-hyphen-indicator-newline": "off",
|
|
637
|
+
"yml/flow-mapping-curly-newline": "off",
|
|
638
|
+
"yml/flow-mapping-curly-spacing": "off",
|
|
639
|
+
"yml/flow-sequence-bracket-newline": "off",
|
|
640
|
+
"yml/flow-sequence-bracket-spacing": "off",
|
|
641
|
+
"yml/indent": "off",
|
|
642
|
+
"yml/key-spacing": "off",
|
|
643
|
+
"yml/no-multiple-empty-lines": "off",
|
|
644
|
+
"yml/no-trailing-zeros": "off",
|
|
645
|
+
"yml/quotes": "off"
|
|
646
|
+
} : {},
|
|
605
647
|
// Overrides rules
|
|
606
648
|
...options.overrides
|
|
607
649
|
}
|
|
@@ -1527,6 +1569,11 @@ const configJsdoc = (options = {}) => [
|
|
|
1527
1569
|
}
|
|
1528
1570
|
];
|
|
1529
1571
|
|
|
1572
|
+
const disabledCoreRules = {
|
|
1573
|
+
"no-unused-expressions": "off",
|
|
1574
|
+
"no-unused-vars": "off",
|
|
1575
|
+
strict: "off"
|
|
1576
|
+
};
|
|
1530
1577
|
const configJsonc = (options = {}) => {
|
|
1531
1578
|
const { files = [GLOB_JSON, GLOB_JSON5, GLOB_JSONC] } = options;
|
|
1532
1579
|
return [
|
|
@@ -1540,7 +1587,6 @@ const configJsonc = (options = {}) => {
|
|
|
1540
1587
|
parser: parserJsonc
|
|
1541
1588
|
},
|
|
1542
1589
|
rules: {
|
|
1543
|
-
...pluginJsonc.configs["recommended-with-jsonc"].rules,
|
|
1544
1590
|
"jsonc/array-bracket-spacing": ["error", "never"],
|
|
1545
1591
|
"jsonc/comma-dangle": ["error", "never"],
|
|
1546
1592
|
"jsonc/comma-style": ["error", "last"],
|
|
@@ -1552,7 +1598,29 @@ const configJsonc = (options = {}) => {
|
|
|
1552
1598
|
beforeColon: false
|
|
1553
1599
|
}
|
|
1554
1600
|
],
|
|
1601
|
+
"jsonc/no-bigint-literals": "error",
|
|
1602
|
+
"jsonc/no-binary-expression": "error",
|
|
1603
|
+
"jsonc/no-binary-numeric-literals": "error",
|
|
1604
|
+
"jsonc/no-dupe-keys": "error",
|
|
1605
|
+
"jsonc/no-escape-sequence-in-identifier": "error",
|
|
1606
|
+
"jsonc/no-floating-decimal": "error",
|
|
1607
|
+
"jsonc/no-hexadecimal-numeric-literals": "error",
|
|
1608
|
+
"jsonc/no-infinity": "error",
|
|
1609
|
+
"jsonc/no-multi-str": "error",
|
|
1610
|
+
"jsonc/no-nan": "error",
|
|
1611
|
+
"jsonc/no-number-props": "error",
|
|
1612
|
+
"jsonc/no-numeric-separators": "error",
|
|
1613
|
+
"jsonc/no-octal": "error",
|
|
1555
1614
|
"jsonc/no-octal-escape": "error",
|
|
1615
|
+
"jsonc/no-octal-numeric-literals": "error",
|
|
1616
|
+
"jsonc/no-parenthesized": "error",
|
|
1617
|
+
"jsonc/no-plus-sign": "error",
|
|
1618
|
+
"jsonc/no-regexp-literals": "error",
|
|
1619
|
+
"jsonc/no-sparse-arrays": "error",
|
|
1620
|
+
"jsonc/no-template-literals": "error",
|
|
1621
|
+
"jsonc/no-undefined-value": "error",
|
|
1622
|
+
"jsonc/no-unicode-codepoint-escapes": "error",
|
|
1623
|
+
"jsonc/no-useless-escape": "error",
|
|
1556
1624
|
"jsonc/object-curly-newline": [
|
|
1557
1625
|
"error",
|
|
1558
1626
|
{
|
|
@@ -1567,6 +1635,28 @@ const configJsonc = (options = {}) => {
|
|
|
1567
1635
|
allowMultiplePropertiesPerLine: true
|
|
1568
1636
|
}
|
|
1569
1637
|
],
|
|
1638
|
+
"jsonc/quote-props": "error",
|
|
1639
|
+
"jsonc/quotes": "error",
|
|
1640
|
+
"jsonc/space-unary-ops": "error",
|
|
1641
|
+
"jsonc/valid-json-number": "error",
|
|
1642
|
+
"jsonc/vue-custom-block/no-parsing-error": "error",
|
|
1643
|
+
...disabledCoreRules,
|
|
1644
|
+
...options.prettier ? {
|
|
1645
|
+
"jsonc/array-bracket-newline": "off",
|
|
1646
|
+
"jsonc/array-bracket-spacing": "off",
|
|
1647
|
+
"jsonc/array-element-newline": "off",
|
|
1648
|
+
"jsonc/comma-dangle": "off",
|
|
1649
|
+
"jsonc/comma-style": "off",
|
|
1650
|
+
"jsonc/indent": "off",
|
|
1651
|
+
"jsonc/key-spacing": "off",
|
|
1652
|
+
"jsonc/no-floating-decimal": "off",
|
|
1653
|
+
"jsonc/object-curly-newline": "off",
|
|
1654
|
+
"jsonc/object-curly-spacing": "off",
|
|
1655
|
+
"jsonc/object-property-newline": "off",
|
|
1656
|
+
"jsonc/quote-props": "off",
|
|
1657
|
+
"jsonc/quotes": "off",
|
|
1658
|
+
"jsonc/space-unary-ops": "off"
|
|
1659
|
+
} : {},
|
|
1570
1660
|
// Overrides rules
|
|
1571
1661
|
...options.overrides
|
|
1572
1662
|
}
|
|
@@ -1622,6 +1712,7 @@ const configPinia = (options = {}) => {
|
|
|
1622
1712
|
const configDepend = (options = {}) => {
|
|
1623
1713
|
const {
|
|
1624
1714
|
files = [GLOB_SRC],
|
|
1715
|
+
allowed = [],
|
|
1625
1716
|
// check package.json file
|
|
1626
1717
|
packageJson: enableCheckPackageJson = true
|
|
1627
1718
|
} = options;
|
|
@@ -1633,7 +1724,12 @@ const configDepend = (options = {}) => {
|
|
|
1633
1724
|
depend: pluginDepend
|
|
1634
1725
|
},
|
|
1635
1726
|
rules: {
|
|
1636
|
-
"depend/ban-dependencies":
|
|
1727
|
+
"depend/ban-dependencies": [
|
|
1728
|
+
"error",
|
|
1729
|
+
{
|
|
1730
|
+
allowed
|
|
1731
|
+
}
|
|
1732
|
+
],
|
|
1637
1733
|
// Overrides rules
|
|
1638
1734
|
...options.overrides
|
|
1639
1735
|
}
|
|
@@ -1650,7 +1746,12 @@ const configDepend = (options = {}) => {
|
|
|
1650
1746
|
parser: parserJsonc
|
|
1651
1747
|
},
|
|
1652
1748
|
rules: {
|
|
1653
|
-
"depend/ban-dependencies":
|
|
1749
|
+
"depend/ban-dependencies": [
|
|
1750
|
+
"error",
|
|
1751
|
+
{
|
|
1752
|
+
allowed
|
|
1753
|
+
}
|
|
1754
|
+
],
|
|
1654
1755
|
// Overrides rules
|
|
1655
1756
|
...options.overrides
|
|
1656
1757
|
}
|
|
@@ -1686,10 +1787,12 @@ const PRETTIER_DEFAULT_OPTIONS = {
|
|
|
1686
1787
|
vueIndentScriptAndStyle: false
|
|
1687
1788
|
};
|
|
1688
1789
|
|
|
1689
|
-
const
|
|
1790
|
+
const PERFECTIONIST_PLUGIN_SETTINGS = {
|
|
1690
1791
|
fallbackSort: { order: "asc", type: "alphabetical" },
|
|
1691
1792
|
ignoreCase: true,
|
|
1692
1793
|
order: "asc",
|
|
1794
|
+
partitionByNewLine: false,
|
|
1795
|
+
specialCharacters: "keep",
|
|
1693
1796
|
type: "alphabetical"
|
|
1694
1797
|
};
|
|
1695
1798
|
const PERFECTIONIST_EXTRA_RULE_OPTIONS = {
|
|
@@ -2085,6 +2188,10 @@ const disabledRules = {
|
|
|
2085
2188
|
* @see https://caniuse.com/?search=globalThis
|
|
2086
2189
|
*/
|
|
2087
2190
|
"unicorn/prefer-global-this": "off",
|
|
2191
|
+
/**
|
|
2192
|
+
* Required node v20.11
|
|
2193
|
+
*/
|
|
2194
|
+
"unicorn/prefer-import-meta-properties": "off",
|
|
2088
2195
|
"unicorn/prefer-top-level-await": "off"
|
|
2089
2196
|
};
|
|
2090
2197
|
const configUnicorn = (options = {}) => [
|
|
@@ -2171,12 +2278,15 @@ const configUnicorn = (options = {}) => [
|
|
|
2171
2278
|
* @pg Array
|
|
2172
2279
|
*/
|
|
2173
2280
|
"unicorn/no-array-method-this-argument": "error",
|
|
2174
|
-
"unicorn/no-array-push-push": "error",
|
|
2175
2281
|
"unicorn/no-new-array": "error",
|
|
2282
|
+
"unicorn/no-unnecessary-array-flat-depth": "error",
|
|
2283
|
+
"unicorn/no-unnecessary-array-splice-count": "error",
|
|
2284
|
+
"unicorn/no-unnecessary-slice-end": "error",
|
|
2176
2285
|
"unicorn/prefer-array-find": "error",
|
|
2177
2286
|
"unicorn/prefer-array-flat-map": "error",
|
|
2178
2287
|
"unicorn/prefer-array-index-of": "error",
|
|
2179
2288
|
"unicorn/prefer-array-some": "error",
|
|
2289
|
+
"unicorn/prefer-single-call": "error",
|
|
2180
2290
|
"unicorn/require-array-join-separator": "error",
|
|
2181
2291
|
/**
|
|
2182
2292
|
* @pg Set
|
|
@@ -2420,6 +2530,9 @@ const configSpecials = (options = {}) => {
|
|
|
2420
2530
|
"import-x": pluginImportX,
|
|
2421
2531
|
perfectionist: pluginPerfectionist
|
|
2422
2532
|
},
|
|
2533
|
+
settings: {
|
|
2534
|
+
perfectionist: PERFECTIONIST_PLUGIN_SETTINGS
|
|
2535
|
+
},
|
|
2423
2536
|
rules: {
|
|
2424
2537
|
"@typescript-eslint/explicit-function-return-type": "off",
|
|
2425
2538
|
"import-x/no-default-export": "off",
|
|
@@ -2427,7 +2540,6 @@ const configSpecials = (options = {}) => {
|
|
|
2427
2540
|
"perfectionist/sort-objects": [
|
|
2428
2541
|
"error",
|
|
2429
2542
|
{
|
|
2430
|
-
...PERFECTIONIST_COMMON_RULE_OPTIONS,
|
|
2431
2543
|
...PERFECTIONIST_EXTRA_RULE_OPTIONS,
|
|
2432
2544
|
groups: PERFECTIONIST_SORT_OBJECTS_GROUPS
|
|
2433
2545
|
}
|
|
@@ -2954,11 +3066,7 @@ const configESLintPlugin = async (options = {}) => {
|
|
|
2954
3066
|
};
|
|
2955
3067
|
|
|
2956
3068
|
const configGitHubAction = (options = {}) => {
|
|
2957
|
-
const {
|
|
2958
|
-
//
|
|
2959
|
-
files = [GLOB_GITHUB_ACTION],
|
|
2960
|
-
overrides: overridesRules = {}
|
|
2961
|
-
} = options;
|
|
3069
|
+
const { files = [GLOB_GITHUB_ACTION] } = options;
|
|
2962
3070
|
return [
|
|
2963
3071
|
{
|
|
2964
3072
|
name: "ntnyq/github-action",
|
|
@@ -2973,7 +3081,9 @@ const configGitHubAction = (options = {}) => {
|
|
|
2973
3081
|
"github-action/no-invalid-key": "error",
|
|
2974
3082
|
"github-action/prefer-file-extension": "error",
|
|
2975
3083
|
"github-action/require-action-name": "error",
|
|
2976
|
-
|
|
3084
|
+
"github-action/valid-timeout-minutes": "error",
|
|
3085
|
+
"github-action/valid-trigger-events": "error",
|
|
3086
|
+
...options.overrides
|
|
2977
3087
|
}
|
|
2978
3088
|
}
|
|
2979
3089
|
];
|
|
@@ -2986,26 +3096,15 @@ const configPerfectionist = (options = {}) => {
|
|
|
2986
3096
|
sortEnums: enableSortEnums = true,
|
|
2987
3097
|
sortTypes: enableSortTypes = true
|
|
2988
3098
|
} = options;
|
|
2989
|
-
const
|
|
2990
|
-
|
|
2991
|
-
};
|
|
2992
|
-
const commonRuleOptionsWithNewlinesBetween = {
|
|
2993
|
-
...commonRuleOptions,
|
|
2994
|
-
newlinesBetween: "ignore"
|
|
2995
|
-
};
|
|
2996
|
-
const commonRuleOptionsWithPartitionByComment = {
|
|
2997
|
-
...commonRuleOptions,
|
|
3099
|
+
const sharedOptionsWithNewlinesBetween = {
|
|
3100
|
+
newlinesBetween: "ignore",
|
|
2998
3101
|
partitionByComment
|
|
2999
3102
|
};
|
|
3000
|
-
const commonRuleOptionsWithBoth = {
|
|
3001
|
-
...commonRuleOptionsWithNewlinesBetween,
|
|
3002
|
-
...commonRuleOptionsWithPartitionByComment
|
|
3003
|
-
};
|
|
3004
3103
|
const commonRules = {
|
|
3005
3104
|
"perfectionist/sort-exports": [
|
|
3006
3105
|
"error",
|
|
3007
3106
|
{
|
|
3008
|
-
...
|
|
3107
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3009
3108
|
groups: PERFECTIONIST_SORT_EXPORTS_GROUPS,
|
|
3010
3109
|
type: "line-length"
|
|
3011
3110
|
}
|
|
@@ -3013,7 +3112,7 @@ const configPerfectionist = (options = {}) => {
|
|
|
3013
3112
|
"perfectionist/sort-imports": [
|
|
3014
3113
|
"error",
|
|
3015
3114
|
{
|
|
3016
|
-
...
|
|
3115
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3017
3116
|
groups: PERFECTIONIST_SORT_IMPORTS_GROUPS,
|
|
3018
3117
|
internalPattern: ["^~/.+", "^@/.+", "^#.+"]
|
|
3019
3118
|
}
|
|
@@ -3021,7 +3120,7 @@ const configPerfectionist = (options = {}) => {
|
|
|
3021
3120
|
"perfectionist/sort-named-exports": [
|
|
3022
3121
|
"error",
|
|
3023
3122
|
{
|
|
3024
|
-
...
|
|
3123
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3025
3124
|
groups: PERFECTIONIST_SORT_NAMED_EXPORTS_GROUPS,
|
|
3026
3125
|
ignoreAlias: false
|
|
3027
3126
|
}
|
|
@@ -3029,7 +3128,7 @@ const configPerfectionist = (options = {}) => {
|
|
|
3029
3128
|
"perfectionist/sort-named-imports": [
|
|
3030
3129
|
"error",
|
|
3031
3130
|
{
|
|
3032
|
-
...
|
|
3131
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3033
3132
|
groups: PERFECTIONIST_SORT_NAMED_IMPORTS_GROUPS,
|
|
3034
3133
|
ignoreAlias: false
|
|
3035
3134
|
}
|
|
@@ -3039,7 +3138,7 @@ const configPerfectionist = (options = {}) => {
|
|
|
3039
3138
|
"perfectionist/sort-enums": [
|
|
3040
3139
|
"error",
|
|
3041
3140
|
{
|
|
3042
|
-
...
|
|
3141
|
+
...sharedOptionsWithNewlinesBetween
|
|
3043
3142
|
}
|
|
3044
3143
|
]
|
|
3045
3144
|
};
|
|
@@ -3047,42 +3146,37 @@ const configPerfectionist = (options = {}) => {
|
|
|
3047
3146
|
"perfectionist/sort-modules": [
|
|
3048
3147
|
"error",
|
|
3049
3148
|
{
|
|
3050
|
-
...
|
|
3149
|
+
...sharedOptionsWithNewlinesBetween
|
|
3051
3150
|
}
|
|
3052
3151
|
]
|
|
3053
3152
|
};
|
|
3054
3153
|
const sortTypesRules = {
|
|
3055
|
-
"perfectionist/sort-heritage-clauses":
|
|
3056
|
-
"error",
|
|
3057
|
-
{
|
|
3058
|
-
...commonRuleOptions
|
|
3059
|
-
}
|
|
3060
|
-
],
|
|
3154
|
+
"perfectionist/sort-heritage-clauses": "error",
|
|
3061
3155
|
"perfectionist/sort-interfaces": [
|
|
3062
3156
|
"error",
|
|
3063
3157
|
{
|
|
3064
|
-
...
|
|
3158
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3065
3159
|
groups: PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS
|
|
3066
3160
|
}
|
|
3067
3161
|
],
|
|
3068
3162
|
"perfectionist/sort-intersection-types": [
|
|
3069
3163
|
"error",
|
|
3070
3164
|
{
|
|
3071
|
-
...
|
|
3165
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3072
3166
|
groups: PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS
|
|
3073
3167
|
}
|
|
3074
3168
|
],
|
|
3075
3169
|
"perfectionist/sort-object-types": [
|
|
3076
3170
|
"error",
|
|
3077
3171
|
{
|
|
3078
|
-
...
|
|
3172
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3079
3173
|
groups: PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS
|
|
3080
3174
|
}
|
|
3081
3175
|
],
|
|
3082
3176
|
"perfectionist/sort-union-types": [
|
|
3083
3177
|
"error",
|
|
3084
3178
|
{
|
|
3085
|
-
...
|
|
3179
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3086
3180
|
groups: PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS
|
|
3087
3181
|
}
|
|
3088
3182
|
]
|
|
@@ -3091,20 +3185,20 @@ const configPerfectionist = (options = {}) => {
|
|
|
3091
3185
|
"perfectionist/sort-maps": [
|
|
3092
3186
|
"error",
|
|
3093
3187
|
{
|
|
3094
|
-
...
|
|
3188
|
+
...sharedOptionsWithNewlinesBetween
|
|
3095
3189
|
}
|
|
3096
3190
|
],
|
|
3097
3191
|
"perfectionist/sort-objects": [
|
|
3098
3192
|
"error",
|
|
3099
3193
|
{
|
|
3100
|
-
...
|
|
3194
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3101
3195
|
groups: PERFECTIONIST_SORT_OBJECTS_GROUPS
|
|
3102
3196
|
}
|
|
3103
3197
|
],
|
|
3104
3198
|
"perfectionist/sort-sets": [
|
|
3105
3199
|
"error",
|
|
3106
3200
|
{
|
|
3107
|
-
...
|
|
3201
|
+
...sharedOptionsWithNewlinesBetween
|
|
3108
3202
|
}
|
|
3109
3203
|
]
|
|
3110
3204
|
};
|
|
@@ -3112,40 +3206,34 @@ const configPerfectionist = (options = {}) => {
|
|
|
3112
3206
|
"perfectionist/sort-array-includes": [
|
|
3113
3207
|
"error",
|
|
3114
3208
|
{
|
|
3115
|
-
...
|
|
3209
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3116
3210
|
groups: ["literal", "spread"]
|
|
3117
3211
|
}
|
|
3118
3212
|
],
|
|
3119
3213
|
"perfectionist/sort-classes": [
|
|
3120
3214
|
"error",
|
|
3121
3215
|
{
|
|
3122
|
-
...
|
|
3216
|
+
...sharedOptionsWithNewlinesBetween,
|
|
3123
3217
|
groups: PERFECTIONIST_SORT_CLASSES_GROUPS
|
|
3124
3218
|
}
|
|
3125
3219
|
],
|
|
3126
3220
|
"perfectionist/sort-decorators": [
|
|
3127
3221
|
"error",
|
|
3128
3222
|
{
|
|
3129
|
-
|
|
3223
|
+
partitionByComment
|
|
3130
3224
|
}
|
|
3131
3225
|
],
|
|
3132
3226
|
"perfectionist/sort-jsx-props": [
|
|
3133
3227
|
"error",
|
|
3134
3228
|
{
|
|
3135
|
-
...commonRuleOptions,
|
|
3136
3229
|
groups: ["shorthand", "multiline", "unknown"]
|
|
3137
3230
|
}
|
|
3138
3231
|
],
|
|
3139
|
-
"perfectionist/sort-switch-case":
|
|
3140
|
-
"error",
|
|
3141
|
-
{
|
|
3142
|
-
...commonRuleOptions
|
|
3143
|
-
}
|
|
3144
|
-
],
|
|
3232
|
+
"perfectionist/sort-switch-case": "error",
|
|
3145
3233
|
"perfectionist/sort-variable-declarations": [
|
|
3146
3234
|
"error",
|
|
3147
3235
|
{
|
|
3148
|
-
|
|
3236
|
+
partitionByComment
|
|
3149
3237
|
}
|
|
3150
3238
|
]
|
|
3151
3239
|
};
|
|
@@ -3155,6 +3243,9 @@ const configPerfectionist = (options = {}) => {
|
|
|
3155
3243
|
plugins: {
|
|
3156
3244
|
perfectionist: pluginPerfectionist
|
|
3157
3245
|
},
|
|
3246
|
+
settings: {
|
|
3247
|
+
perfectionist: PERFECTIONIST_PLUGIN_SETTINGS
|
|
3248
|
+
},
|
|
3158
3249
|
rules: {
|
|
3159
3250
|
...commonRules,
|
|
3160
3251
|
...options.all ? {
|
|
@@ -3179,6 +3270,9 @@ const configPerfectionist = (options = {}) => {
|
|
|
3179
3270
|
plugins: {
|
|
3180
3271
|
perfectionist: pluginPerfectionist
|
|
3181
3272
|
},
|
|
3273
|
+
settings: {
|
|
3274
|
+
perfectionist: PERFECTIONIST_PLUGIN_SETTINGS
|
|
3275
|
+
},
|
|
3182
3276
|
rules: {
|
|
3183
3277
|
...sharedRules,
|
|
3184
3278
|
...sortEnumsRules,
|
|
@@ -3194,6 +3288,9 @@ const configPerfectionist = (options = {}) => {
|
|
|
3194
3288
|
plugins: {
|
|
3195
3289
|
perfectionist: pluginPerfectionist
|
|
3196
3290
|
},
|
|
3291
|
+
settings: {
|
|
3292
|
+
perfectionist: PERFECTIONIST_PLUGIN_SETTINGS
|
|
3293
|
+
},
|
|
3197
3294
|
rules: {
|
|
3198
3295
|
...sharedRules,
|
|
3199
3296
|
...sortTypesRules,
|
|
@@ -3209,6 +3306,9 @@ const configPerfectionist = (options = {}) => {
|
|
|
3209
3306
|
plugins: {
|
|
3210
3307
|
perfectionist: pluginPerfectionist
|
|
3211
3308
|
},
|
|
3309
|
+
settings: {
|
|
3310
|
+
perfectionist: PERFECTIONIST_PLUGIN_SETTINGS
|
|
3311
|
+
},
|
|
3212
3312
|
rules: {
|
|
3213
3313
|
...sharedRules,
|
|
3214
3314
|
...sortConstantsRules,
|
|
@@ -3401,6 +3501,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3401
3501
|
if (enableYML) {
|
|
3402
3502
|
configs.push(
|
|
3403
3503
|
configYml({
|
|
3504
|
+
prettier: !!enablePrettier,
|
|
3404
3505
|
...resolveSubOptions(options, "yml"),
|
|
3405
3506
|
overrides: getOverrides(options, "yml")
|
|
3406
3507
|
})
|
|
@@ -3417,6 +3518,7 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3417
3518
|
if (enableJSONC) {
|
|
3418
3519
|
configs.push(
|
|
3419
3520
|
configJsonc({
|
|
3521
|
+
prettier: !!enablePrettier,
|
|
3420
3522
|
...resolveSubOptions(options, "jsonc"),
|
|
3421
3523
|
overrides: getOverrides(options, "jsonc")
|
|
3422
3524
|
})
|
|
@@ -3507,4 +3609,4 @@ function defineESLintConfig(options = {}, ...userConfigs) {
|
|
|
3507
3609
|
return composer;
|
|
3508
3610
|
}
|
|
3509
3611
|
|
|
3510
|
-
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSON_SCHEMA, GLOB_JSX, GLOB_JSX_ONLY, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_PNPM_WORKSPACE_YAML, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG_JSON, GLOB_TSX, GLOB_TSX_ONLY, GLOB_TYPES, GLOB_TYPE_TEST, GLOB_VUE, GLOB_YAML,
|
|
3612
|
+
export { GLOB_ALL_SRC, GLOB_ASTRO, GLOB_ASTRO_TS, GLOB_CSS, GLOB_DIST, GLOB_DTS, GLOB_EXCLUDE, GLOB_GITHUB_ACTION, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSON_SCHEMA, GLOB_JSX, GLOB_JSX_ONLY, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_MARKDOWN_CODE, GLOB_MARKDOWN_NESTED, GLOB_NODE_MODULES, GLOB_PACKAGE_JSON, GLOB_PINIA_STORE, GLOB_PNPM_WORKSPACE_YAML, GLOB_POSTCSS, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_SVELTE, GLOB_SVG, GLOB_TEST, GLOB_TOML, GLOB_TS, GLOB_TSCONFIG_JSON, GLOB_TSX, GLOB_TSX_ONLY, GLOB_TYPES, GLOB_TYPE_TEST, GLOB_VUE, GLOB_YAML, PERFECTIONIST_EXTRA_RULE_OPTIONS, PERFECTIONIST_PLUGIN_SETTINGS, PERFECTIONIST_SORT_CLASSES_GROUPS, PERFECTIONIST_SORT_EXPORTS_GROUPS, PERFECTIONIST_SORT_IMPORTS_GROUPS, PERFECTIONIST_SORT_INTERFACES_OR_OBJECT_TYPES_GROUPS, PERFECTIONIST_SORT_INTERSECTION_TYPES_OR_UNION_TYPES_GROUPS, PERFECTIONIST_SORT_NAMED_EXPORTS_GROUPS, PERFECTIONIST_SORT_NAMED_IMPORTS_GROUPS, PERFECTIONIST_SORT_OBJECTS_GROUPS, PRETTIER_DEFAULT_OPTIONS, combineConfigs, configAntfu, configCommand, configDeMorgan, configDepend, configESLintComments, configESLintPlugin, configFormat, configGitHubAction, configGitIgnore, configIgnores, configImportX, configJSX, configJavaScript, configJsdoc, configJsonc, configMarkdown, configNode, configNtnyq, configPerfectionist, configPinia, configPnpm, configPrettier, configRegexp, configSVGO, configSort, configSpecials, configTest, configToml, configTypeScript, configUnicorn, configUnoCSS, configUnusedImports, configVue, configYml, defineESLintConfig, ensurePackages, getOverrides, hasPinia, hasShadcnVue, hasTypeScript, hasUnoCSS, hasVitest, hasVue, interopDefault, isInGitHooksOrRunBySpecifyPackages, mergePrettierOptions, parserPlain, resolveSubOptions };
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.
|
|
5
|
-
"packageManager": "pnpm@10.9.0",
|
|
4
|
+
"version": "4.3.0",
|
|
6
5
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
7
6
|
"keywords": [
|
|
8
7
|
"eslint",
|
|
@@ -36,25 +35,6 @@
|
|
|
36
35
|
"publishConfig": {
|
|
37
36
|
"access": "public"
|
|
38
37
|
},
|
|
39
|
-
"scripts": {
|
|
40
|
-
"build": "run-s generate:type build:lib",
|
|
41
|
-
"build:inspector": "pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
|
|
42
|
-
"build:lib": "unbuild",
|
|
43
|
-
"dev": "unbuild --watch",
|
|
44
|
-
"docs:build": "pnpm -C docs run build",
|
|
45
|
-
"docs:dev": "pnpm -C docs run dev",
|
|
46
|
-
"generate:site": "run-s generate:type build:lib build:inspector",
|
|
47
|
-
"generate:type": "tsx scripts/generateType.ts",
|
|
48
|
-
"lint": "eslint --cache",
|
|
49
|
-
"prepare": "husky",
|
|
50
|
-
"release": "run-s release:check release:version release:publish",
|
|
51
|
-
"release:check": "run-s build lint typecheck",
|
|
52
|
-
"release:publish": "npm publish",
|
|
53
|
-
"release:version": "bumpp",
|
|
54
|
-
"stub": "unbuild --stub",
|
|
55
|
-
"test": "vitest",
|
|
56
|
-
"typecheck": "tsc --noEmit"
|
|
57
|
-
},
|
|
58
38
|
"peerDependencies": {
|
|
59
39
|
"eslint": "^9.20.0",
|
|
60
40
|
"eslint-plugin-eslint-plugin": "^6.4.0",
|
|
@@ -73,13 +53,13 @@
|
|
|
73
53
|
}
|
|
74
54
|
},
|
|
75
55
|
"dependencies": {
|
|
76
|
-
"@antfu/install-pkg": "^1.
|
|
56
|
+
"@antfu/install-pkg": "^1.1.0",
|
|
77
57
|
"@clack/prompts": "^0.10.1",
|
|
78
58
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
79
|
-
"@eslint/js": "^9.
|
|
59
|
+
"@eslint/js": "^9.26.0",
|
|
80
60
|
"@eslint/markdown": "^6.4.0",
|
|
81
|
-
"@unocss/eslint-plugin": "^66.1.
|
|
82
|
-
"@vitest/eslint-plugin": "^1.1.
|
|
61
|
+
"@unocss/eslint-plugin": "^66.1.1",
|
|
62
|
+
"@vitest/eslint-plugin": "^1.1.44",
|
|
83
63
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
84
64
|
"eslint-flat-config-utils": "^2.0.1",
|
|
85
65
|
"eslint-import-resolver-typescript": "^4.3.4",
|
|
@@ -87,52 +67,52 @@
|
|
|
87
67
|
"eslint-plugin-antfu": "^3.1.1",
|
|
88
68
|
"eslint-plugin-command": "^3.2.0",
|
|
89
69
|
"eslint-plugin-de-morgan": "^1.2.1",
|
|
90
|
-
"eslint-plugin-depend": "^1.
|
|
91
|
-
"eslint-plugin-github-action": "^0.0.
|
|
92
|
-
"eslint-plugin-import-x": "^4.11.
|
|
93
|
-
"eslint-plugin-jsdoc": "^50.6.
|
|
70
|
+
"eslint-plugin-depend": "^1.2.0",
|
|
71
|
+
"eslint-plugin-github-action": "^0.0.16",
|
|
72
|
+
"eslint-plugin-import-x": "^4.11.1",
|
|
73
|
+
"eslint-plugin-jsdoc": "^50.6.14",
|
|
94
74
|
"eslint-plugin-jsonc": "^2.20.0",
|
|
95
|
-
"eslint-plugin-n": "^17.
|
|
75
|
+
"eslint-plugin-n": "^17.18.0",
|
|
96
76
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
97
77
|
"eslint-plugin-ntnyq": "^0.11.0",
|
|
98
78
|
"eslint-plugin-perfectionist": "^4.12.3",
|
|
99
79
|
"eslint-plugin-pinia": "^0.4.1",
|
|
100
80
|
"eslint-plugin-pnpm": "^0.3.1",
|
|
101
|
-
"eslint-plugin-prettier": "^5.
|
|
81
|
+
"eslint-plugin-prettier": "^5.4.0",
|
|
102
82
|
"eslint-plugin-regexp": "^2.7.0",
|
|
103
|
-
"eslint-plugin-svgo": "^0.
|
|
83
|
+
"eslint-plugin-svgo": "^0.8.0",
|
|
104
84
|
"eslint-plugin-toml": "^0.12.0",
|
|
105
|
-
"eslint-plugin-unicorn": "^
|
|
106
|
-
"eslint-plugin-vue": "^10.
|
|
85
|
+
"eslint-plugin-unicorn": "^59.0.1",
|
|
86
|
+
"eslint-plugin-vue": "^10.1.0",
|
|
107
87
|
"eslint-plugin-yml": "^1.18.0",
|
|
108
88
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
109
|
-
"globals": "^16.
|
|
89
|
+
"globals": "^16.1.0",
|
|
110
90
|
"jsonc-eslint-parser": "^2.4.0",
|
|
111
91
|
"local-pkg": "^1.1.1",
|
|
112
92
|
"prettier": "^3.5.3",
|
|
113
93
|
"toml-eslint-parser": "^0.10.0",
|
|
114
|
-
"typescript-eslint": "^8.
|
|
94
|
+
"typescript-eslint": "^8.32.1",
|
|
115
95
|
"vue-eslint-parser": "^10.1.3",
|
|
116
96
|
"yaml-eslint-parser": "^1.3.0"
|
|
117
97
|
},
|
|
118
98
|
"devDependencies": {
|
|
119
99
|
"@ntnyq/prettier-config": "^2.0.0",
|
|
120
|
-
"@types/node": "^22.15.
|
|
100
|
+
"@types/node": "^22.15.17",
|
|
121
101
|
"bumpp": "^10.1.0",
|
|
122
|
-
"eslint": "^9.
|
|
102
|
+
"eslint": "^9.26.0",
|
|
123
103
|
"eslint-parser-plain": "^0.1.1",
|
|
124
104
|
"eslint-plugin-eslint-plugin": "^6.4.0",
|
|
125
|
-
"eslint-typegen": "^2.
|
|
105
|
+
"eslint-typegen": "^2.2.0",
|
|
126
106
|
"husky": "^9.1.7",
|
|
127
107
|
"jiti": "^2.4.2",
|
|
128
108
|
"nano-staged": "^0.8.0",
|
|
129
|
-
"npm-run-all2": "^
|
|
109
|
+
"npm-run-all2": "^8.0.1",
|
|
130
110
|
"tinyglobby": "^0.2.13",
|
|
131
|
-
"tsx": "^4.19.
|
|
111
|
+
"tsx": "^4.19.4",
|
|
132
112
|
"typescript": "^5.8.3",
|
|
133
113
|
"unbuild": "^3.5.0",
|
|
134
114
|
"uncase": "^0.1.0",
|
|
135
|
-
"vitest": "^3.1.
|
|
115
|
+
"vitest": "^3.1.3"
|
|
136
116
|
},
|
|
137
117
|
"engines": {
|
|
138
118
|
"node": ">=18.18.0"
|
|
@@ -140,5 +120,22 @@
|
|
|
140
120
|
"nano-staged": {
|
|
141
121
|
"*.{js,ts,mjs,cjs,md,vue,svg,yml,yaml,toml,json}": "eslint --fix",
|
|
142
122
|
"*.{css,scss,html}": "prettier -uw"
|
|
123
|
+
},
|
|
124
|
+
"scripts": {
|
|
125
|
+
"build": "run-s generate:type build:lib",
|
|
126
|
+
"build:inspector": "pnpm dlx @eslint/config-inspector build --config eslint-inspector.config.ts",
|
|
127
|
+
"build:lib": "unbuild",
|
|
128
|
+
"dev": "unbuild --watch",
|
|
129
|
+
"docs:build": "pnpm -C docs run build",
|
|
130
|
+
"docs:dev": "pnpm -C docs run dev",
|
|
131
|
+
"generate:site": "run-s generate:type build:lib build:inspector",
|
|
132
|
+
"generate:type": "tsx scripts/generateType.ts",
|
|
133
|
+
"lint": "eslint --cache",
|
|
134
|
+
"release": "run-s release:check release:version release:publish",
|
|
135
|
+
"release:check": "run-s build lint test typecheck",
|
|
136
|
+
"release:publish": "pnpm publish",
|
|
137
|
+
"release:version": "bumpp",
|
|
138
|
+
"test": "vitest",
|
|
139
|
+
"typecheck": "tsc --noEmit"
|
|
143
140
|
}
|
|
144
|
-
}
|
|
141
|
+
}
|