@ntnyq/eslint-config 5.0.0 → 5.2.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.ts +280 -151
- package/dist/index.js +38 -11
- package/package.json +25 -25
package/dist/index.js
CHANGED
|
@@ -81,7 +81,7 @@ const GLOB_YAML = "**/*.y?(a)ml";
|
|
|
81
81
|
const GLOB_PNPM_WORKSPACE_YAML = "**/pnpm-workspace.yaml";
|
|
82
82
|
const GLOB_SVG = "**/*.svg";
|
|
83
83
|
const GLOB_VUE = "**/*.vue";
|
|
84
|
-
const GLOB_SVELTE = "**/*.svelte";
|
|
84
|
+
const GLOB_SVELTE = "**/*.svelte?(.{js,ts})";
|
|
85
85
|
const GLOB_TOML = "**/*.toml";
|
|
86
86
|
const GLOB_HTML = "**/*.htm?(l)";
|
|
87
87
|
const GLOB_ASTRO = "**/*.astro";
|
|
@@ -115,6 +115,7 @@ const GLOB_EXCLUDE = [
|
|
|
115
115
|
GLOB_NODE_MODULES,
|
|
116
116
|
GLOB_DIST,
|
|
117
117
|
...GLOB_LOCKFILE,
|
|
118
|
+
"**/.pnpm-store/**",
|
|
118
119
|
"!.github",
|
|
119
120
|
"!.vitepress",
|
|
120
121
|
"!.vuepress",
|
|
@@ -941,6 +942,11 @@ const configSort = (options = {}) => {
|
|
|
941
942
|
order: { type: "asc" },
|
|
942
943
|
pathPattern: "^contributes.*$"
|
|
943
944
|
},
|
|
945
|
+
(
|
|
946
|
+
/**
|
|
947
|
+
* pnpm publish config
|
|
948
|
+
* @see {@link https://pnpm.io/package_json#publishconfig}
|
|
949
|
+
*/
|
|
944
950
|
{
|
|
945
951
|
pathPattern: "^publishConfig.*$",
|
|
946
952
|
order: [
|
|
@@ -951,7 +957,7 @@ const configSort = (options = {}) => {
|
|
|
951
957
|
"default",
|
|
952
958
|
{ order: { type: "asc" } }
|
|
953
959
|
]
|
|
954
|
-
},
|
|
960
|
+
}),
|
|
955
961
|
{
|
|
956
962
|
order: { type: "asc" },
|
|
957
963
|
pathPattern: "^scripts$"
|
|
@@ -1114,7 +1120,16 @@ const configSVGO = (options = {}) => {
|
|
|
1114
1120
|
ignores,
|
|
1115
1121
|
plugins: { svgo: pluginSvgo },
|
|
1116
1122
|
languageOptions: { parser: parserPlain },
|
|
1117
|
-
rules: {
|
|
1123
|
+
rules: {
|
|
1124
|
+
"svgo/svgo": ["error", {
|
|
1125
|
+
plugins: ["preset-default"],
|
|
1126
|
+
js2svg: {
|
|
1127
|
+
indent: 2,
|
|
1128
|
+
pretty: true
|
|
1129
|
+
}
|
|
1130
|
+
}],
|
|
1131
|
+
...options.overrides
|
|
1132
|
+
}
|
|
1118
1133
|
}];
|
|
1119
1134
|
};
|
|
1120
1135
|
|
|
@@ -2028,8 +2043,10 @@ const disabledRules = {
|
|
|
2028
2043
|
"unicorn/better-regex": "off",
|
|
2029
2044
|
"unicorn/explicit-length-check": "off",
|
|
2030
2045
|
"unicorn/no-array-callback-reference": "off",
|
|
2046
|
+
"unicorn/no-array-reverse": "off",
|
|
2031
2047
|
"unicorn/prefer-global-this": "off",
|
|
2032
|
-
"unicorn/prefer-top-level-await": "off"
|
|
2048
|
+
"unicorn/prefer-top-level-await": "off",
|
|
2049
|
+
"unicorn/require-module-specifiers": "off"
|
|
2033
2050
|
};
|
|
2034
2051
|
/**
|
|
2035
2052
|
* Config for powerful rules
|
|
@@ -2058,6 +2075,7 @@ const configUnicorn = (options = {}) => [{
|
|
|
2058
2075
|
"unicorn/no-static-only-class": "error",
|
|
2059
2076
|
"unicorn/no-typeof-undefined": "error",
|
|
2060
2077
|
"unicorn/no-unnecessary-await": "error",
|
|
2078
|
+
"unicorn/prefer-class-fields": "error",
|
|
2061
2079
|
"unicorn/prefer-import-meta-properties": "error",
|
|
2062
2080
|
"unicorn/prefer-includes": "error",
|
|
2063
2081
|
"unicorn/prefer-keyboard-event-key": "error",
|
|
@@ -2076,6 +2094,7 @@ const configUnicorn = (options = {}) => [{
|
|
|
2076
2094
|
ignore: ["^_."]
|
|
2077
2095
|
}],
|
|
2078
2096
|
"unicorn/custom-error-definition": "error",
|
|
2097
|
+
"unicorn/no-useless-error-capture-stack-trace": "error",
|
|
2079
2098
|
"unicorn/prefer-type-error": "error",
|
|
2080
2099
|
"unicorn/throw-new-error": "error",
|
|
2081
2100
|
"unicorn/no-zero-fractions": "error",
|
|
@@ -2150,12 +2169,16 @@ const configMarkdown = (options = {}) => {
|
|
|
2150
2169
|
...config,
|
|
2151
2170
|
name: `ntnyq/${config.name}`
|
|
2152
2171
|
})),
|
|
2172
|
+
(
|
|
2173
|
+
/**
|
|
2174
|
+
* enhance `markdown/recommended/processor`
|
|
2175
|
+
*/
|
|
2153
2176
|
{
|
|
2154
2177
|
name: "ntnyq/markdown/processor",
|
|
2155
2178
|
files,
|
|
2156
2179
|
ignores: [GLOB_MARKDOWN_NESTED],
|
|
2157
2180
|
processor: mergeProcessors([pluginMarkdown.processors.markdown, processorPassThrough])
|
|
2158
|
-
},
|
|
2181
|
+
}),
|
|
2159
2182
|
{
|
|
2160
2183
|
name: "ntnyq/markdown/parser",
|
|
2161
2184
|
files,
|
|
@@ -2260,12 +2283,16 @@ const configPrettier = (options = {}) => {
|
|
|
2260
2283
|
"prettier/prettier": options.severity || "warn",
|
|
2261
2284
|
...options.overrides
|
|
2262
2285
|
}
|
|
2263
|
-
},
|
|
2286
|
+
}, (
|
|
2287
|
+
/**
|
|
2288
|
+
* Languages that prettier currently does not support
|
|
2289
|
+
*/
|
|
2290
|
+
{
|
|
2264
2291
|
name: "ntnyq/prettier/disabled",
|
|
2265
2292
|
files: [...disabledFiles, ...userDisabledFiles],
|
|
2266
2293
|
plugins: { prettier: pluginPrettier },
|
|
2267
2294
|
rules: { "prettier/prettier": "off" }
|
|
2268
|
-
}];
|
|
2295
|
+
})];
|
|
2269
2296
|
};
|
|
2270
2297
|
|
|
2271
2298
|
//#endregion
|
|
@@ -2839,7 +2866,7 @@ const configGitHubAction = (options = {}) => {
|
|
|
2839
2866
|
* @returns ESLint configs
|
|
2840
2867
|
*/
|
|
2841
2868
|
const configPerfectionist = (options = {}) => {
|
|
2842
|
-
const { partitionByComment = PERFECTIONIST.partialRuleOptions.partitionByComment, sortConstants: enableSortConstants = true, sortEnums: enableSortEnums = true, sortTypes: enableSortTypes = true } = options;
|
|
2869
|
+
const { filesEnums = [`**/enums/${GLOB_SRC}`, `**/enums.${GLOB_SRC_EXT}`], filesTypes = [...GLOB_TYPES], partitionByComment = PERFECTIONIST.partialRuleOptions.partitionByComment, sortConstants: enableSortConstants = true, sortEnums: enableSortEnums = true, sortTypes: enableSortTypes = true, filesConstants = [`**/constants/${GLOB_SRC}`, `**/constants.${GLOB_SRC_EXT}`] } = options;
|
|
2843
2870
|
const sharedOptionsWithNewlinesBetween = {
|
|
2844
2871
|
newlinesBetween: "ignore",
|
|
2845
2872
|
partitionByComment
|
|
@@ -2936,7 +2963,7 @@ const configPerfectionist = (options = {}) => {
|
|
|
2936
2963
|
if (options.all) return configs;
|
|
2937
2964
|
if (enableSortEnums) configs.push({
|
|
2938
2965
|
name: "ntnyq/perfectionist/enums",
|
|
2939
|
-
files:
|
|
2966
|
+
files: filesEnums,
|
|
2940
2967
|
plugins: { perfectionist: pluginPerfectionist },
|
|
2941
2968
|
settings: { perfectionist: PERFECTIONIST.pluginSettings },
|
|
2942
2969
|
rules: {
|
|
@@ -2947,7 +2974,7 @@ const configPerfectionist = (options = {}) => {
|
|
|
2947
2974
|
});
|
|
2948
2975
|
if (enableSortTypes) configs.push({
|
|
2949
2976
|
name: "ntnyq/perfectionist/types",
|
|
2950
|
-
files:
|
|
2977
|
+
files: filesTypes,
|
|
2951
2978
|
plugins: { perfectionist: pluginPerfectionist },
|
|
2952
2979
|
settings: { perfectionist: PERFECTIONIST.pluginSettings },
|
|
2953
2980
|
rules: {
|
|
@@ -2958,7 +2985,7 @@ const configPerfectionist = (options = {}) => {
|
|
|
2958
2985
|
});
|
|
2959
2986
|
if (enableSortConstants) configs.push({
|
|
2960
2987
|
name: "ntnyq/perfectionist/constants",
|
|
2961
|
-
files:
|
|
2988
|
+
files: filesConstants,
|
|
2962
2989
|
plugins: { perfectionist: pluginPerfectionist },
|
|
2963
2990
|
settings: { perfectionist: PERFECTIONIST.pluginSettings },
|
|
2964
2991
|
rules: {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ntnyq/eslint-config",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.2.0",
|
|
5
5
|
"description": "An opinionated ESLint config preset of ntnyq",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"eslint",
|
|
@@ -36,15 +36,15 @@
|
|
|
36
36
|
"tag": "latest"
|
|
37
37
|
},
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@html-eslint/eslint-plugin": "^0.
|
|
40
|
-
"@html-eslint/parser": "^0.
|
|
39
|
+
"@html-eslint/eslint-plugin": "^0.42.0",
|
|
40
|
+
"@html-eslint/parser": "^0.42.0",
|
|
41
41
|
"astro-eslint-parser": "^1.2.2",
|
|
42
42
|
"eslint": "^9.20.0",
|
|
43
43
|
"eslint-plugin-astro": "^1.3.1",
|
|
44
|
-
"eslint-plugin-eslint-plugin": "^6.
|
|
44
|
+
"eslint-plugin-eslint-plugin": "^6.5.0",
|
|
45
45
|
"eslint-plugin-format": "^1.0.1",
|
|
46
|
-
"eslint-plugin-pnpm": "^0.
|
|
47
|
-
"eslint-plugin-svelte": "^3.
|
|
46
|
+
"eslint-plugin-pnpm": "^1.0.0",
|
|
47
|
+
"eslint-plugin-svelte": "^3.10.1",
|
|
48
48
|
"eslint-plugin-unused-imports": "^4.1.4",
|
|
49
49
|
"svelte": "^5.31.1",
|
|
50
50
|
"svelte-eslint-parser": "^1.2.0"
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
"@antfu/install-pkg": "^1.1.0",
|
|
89
89
|
"@clack/prompts": "^0.11.0",
|
|
90
90
|
"@eslint-community/eslint-plugin-eslint-comments": "^4.5.0",
|
|
91
|
-
"@eslint/js": "^9.
|
|
92
|
-
"@eslint/markdown": "^
|
|
93
|
-
"@unocss/eslint-plugin": "^66.3.
|
|
94
|
-
"@vitest/eslint-plugin": "^1.3.
|
|
91
|
+
"@eslint/js": "^9.32.0",
|
|
92
|
+
"@eslint/markdown": "^7.1.0",
|
|
93
|
+
"@unocss/eslint-plugin": "^66.3.3",
|
|
94
|
+
"@vitest/eslint-plugin": "^1.3.4",
|
|
95
95
|
"eslint-config-flat-gitignore": "^2.1.0",
|
|
96
96
|
"eslint-flat-config-utils": "^2.1.0",
|
|
97
97
|
"eslint-import-resolver-typescript": "^4.4.4",
|
|
@@ -103,45 +103,45 @@
|
|
|
103
103
|
"eslint-plugin-depend": "^1.2.0",
|
|
104
104
|
"eslint-plugin-github-action": "^0.0.16",
|
|
105
105
|
"eslint-plugin-import-x": "^4.16.1",
|
|
106
|
-
"eslint-plugin-jsdoc": "^51.
|
|
106
|
+
"eslint-plugin-jsdoc": "^51.4.1",
|
|
107
107
|
"eslint-plugin-jsonc": "^2.20.1",
|
|
108
|
-
"eslint-plugin-n": "^17.
|
|
108
|
+
"eslint-plugin-n": "^17.21.0",
|
|
109
109
|
"eslint-plugin-no-only-tests": "^3.3.0",
|
|
110
110
|
"eslint-plugin-ntnyq": "^0.11.0",
|
|
111
111
|
"eslint-plugin-perfectionist": "^4.15.0",
|
|
112
112
|
"eslint-plugin-pinia": "^0.4.1",
|
|
113
|
-
"eslint-plugin-prettier": "^5.5.
|
|
113
|
+
"eslint-plugin-prettier": "^5.5.3",
|
|
114
114
|
"eslint-plugin-regexp": "^2.9.0",
|
|
115
|
-
"eslint-plugin-svgo": "^0.
|
|
115
|
+
"eslint-plugin-svgo": "^0.10.0",
|
|
116
116
|
"eslint-plugin-toml": "^0.12.0",
|
|
117
|
-
"eslint-plugin-unicorn": "^
|
|
118
|
-
"eslint-plugin-vue": "^10.
|
|
117
|
+
"eslint-plugin-unicorn": "^60.0.0",
|
|
118
|
+
"eslint-plugin-vue": "^10.3.0",
|
|
119
119
|
"eslint-plugin-yml": "^1.18.0",
|
|
120
120
|
"eslint-processor-vue-blocks": "^2.0.0",
|
|
121
|
-
"globals": "^16.
|
|
121
|
+
"globals": "^16.3.0",
|
|
122
122
|
"jsonc-eslint-parser": "^2.4.0",
|
|
123
123
|
"local-pkg": "^1.1.1",
|
|
124
124
|
"prettier": "^3.6.2",
|
|
125
125
|
"toml-eslint-parser": "^0.10.0",
|
|
126
|
-
"typescript-eslint": "^8.
|
|
127
|
-
"vue-eslint-parser": "^10.
|
|
126
|
+
"typescript-eslint": "^8.38.0",
|
|
127
|
+
"vue-eslint-parser": "^10.2.0",
|
|
128
128
|
"yaml-eslint-parser": "^1.3.0"
|
|
129
129
|
},
|
|
130
130
|
"devDependencies": {
|
|
131
131
|
"@ntnyq/prettier-config": "^3.0.1",
|
|
132
|
-
"@types/node": "^24.0
|
|
133
|
-
"@typescript-eslint/utils": "^8.
|
|
132
|
+
"@types/node": "^24.1.0",
|
|
133
|
+
"@typescript-eslint/utils": "^8.38.0",
|
|
134
134
|
"bumpp": "^10.2.0",
|
|
135
135
|
"consola": "^3.4.2",
|
|
136
|
-
"eslint": "^9.
|
|
136
|
+
"eslint": "^9.32.0",
|
|
137
137
|
"eslint-plugin-eslint-plugin": "^6.5.0",
|
|
138
|
-
"eslint-typegen": "^2.
|
|
138
|
+
"eslint-typegen": "^2.3.0",
|
|
139
139
|
"husky": "^9.1.7",
|
|
140
|
-
"jiti": "^2.
|
|
140
|
+
"jiti": "^2.5.1",
|
|
141
141
|
"nano-staged": "^0.8.0",
|
|
142
142
|
"npm-run-all2": "^8.0.4",
|
|
143
143
|
"tinyglobby": "^0.2.14",
|
|
144
|
-
"tsdown": "^0.
|
|
144
|
+
"tsdown": "^0.13.0",
|
|
145
145
|
"typescript": "^5.8.3",
|
|
146
146
|
"uncase": "^0.1.0",
|
|
147
147
|
"vitest": "^3.2.4"
|