@sxzz/eslint-config 4.1.2 → 4.1.4
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 +9 -7
- package/dist/index.js +53 -35
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -11863,6 +11863,8 @@ declare const sortPackageJson: Linter.Config[];
|
|
|
11863
11863
|
declare const sortTsconfig: Linter.Config[];
|
|
11864
11864
|
declare const sortImports: Linter.Config[];
|
|
11865
11865
|
|
|
11866
|
+
declare const specialCases: Config[];
|
|
11867
|
+
|
|
11866
11868
|
declare const typescriptCore: Linter.Config[];
|
|
11867
11869
|
declare const typescript: Linter.Config[];
|
|
11868
11870
|
|
|
@@ -11926,13 +11928,13 @@ declare const pluginIgnore: any;
|
|
|
11926
11928
|
declare const configCommand: typeof _configCommand;
|
|
11927
11929
|
|
|
11928
11930
|
/** Ignore common files and include javascript support */
|
|
11929
|
-
declare const presetJavaScript:
|
|
11931
|
+
declare const presetJavaScript: Config[];
|
|
11930
11932
|
/** Includes basic json(c) file support and sorting json keys */
|
|
11931
|
-
declare const presetJsonc:
|
|
11933
|
+
declare const presetJsonc: Config[];
|
|
11932
11934
|
/** Includes markdown, yaml + `presetJsonc` support */
|
|
11933
|
-
declare const presetLangsExtensions:
|
|
11935
|
+
declare const presetLangsExtensions: Config[];
|
|
11934
11936
|
/** Includes `presetJavaScript` and typescript support */
|
|
11935
|
-
declare const presetBasic:
|
|
11937
|
+
declare const presetBasic: Config[];
|
|
11936
11938
|
/**
|
|
11937
11939
|
* Includes
|
|
11938
11940
|
* - `presetBasic` (JS+TS) support
|
|
@@ -11941,7 +11943,7 @@ declare const presetBasic: Linter.Config<Linter.RulesRecord>[];
|
|
|
11941
11943
|
* - UnoCSS support (`uno.config.ts` is required)
|
|
11942
11944
|
* - Prettier support
|
|
11943
11945
|
*/
|
|
11944
|
-
declare const presetAll:
|
|
11946
|
+
declare const presetAll: Config[];
|
|
11945
11947
|
|
|
11946
11948
|
/** `sxzz`'s preset. */
|
|
11947
11949
|
declare function sxzz(config?: Config | Config[], { command: enableCommand, markdown: enableMarkdown, prettier: enablePrettier, unocss: enableUnocss, vue: enableVue, }?: Partial<{
|
|
@@ -11955,6 +11957,6 @@ declare function sxzz(config?: Config | Config[], { command: enableCommand, mark
|
|
|
11955
11957
|
unocss: boolean;
|
|
11956
11958
|
sortKeys: boolean;
|
|
11957
11959
|
command: boolean;
|
|
11958
|
-
}>):
|
|
11960
|
+
}>): Config[];
|
|
11959
11961
|
|
|
11960
|
-
export { type Config, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropDefault, type Rules, presetAll as all, presetBasic as basic, command, comments, configCommand, configJs, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsdoc, jsonc, markdown, node, pluginAntfu, pluginComments, pluginIgnore, pluginJsdoc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPrettier, pluginUnicorn, pluginUnocss, pluginUnusedImports, pluginVue, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, sortImports, sortPackageJson, sortTsconfig, sxzz, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
|
11962
|
+
export { type Config, GLOB_ALL_SRC, GLOB_CSS, GLOB_DIST, GLOB_EXCLUDE, GLOB_HTML, GLOB_JS, GLOB_JSON, GLOB_JSON5, GLOB_JSONC, GLOB_JSX, GLOB_LESS, GLOB_LOCKFILE, GLOB_MARKDOWN, GLOB_NODE_MODULES, GLOB_SCSS, GLOB_SRC, GLOB_SRC_EXT, GLOB_STYLE, GLOB_TS, GLOB_TSX, GLOB_VUE, GLOB_YAML, type InteropDefault, type Rules, presetAll as all, presetBasic as basic, command, comments, configCommand, configJs, configPrettier, getVueVersion, hasTypeScript, hasUnocss, hasVue, ignores, imports, isInEditor, javascript, jsdoc, jsonc, markdown, node, pluginAntfu, pluginComments, pluginIgnore, pluginJsdoc, pluginMarkdown, pluginNode, pluginPerfectionist, pluginPrettier, pluginUnicorn, pluginUnocss, pluginUnusedImports, pluginVue, presetAll, presetBasic, presetJavaScript, presetJsonc, presetLangsExtensions, prettier, reactivityTransform, regexp, restrictedSyntaxJs, sortImports, sortPackageJson, sortTsconfig, specialCases, sxzz, typescript, typescriptCore, unicorn, unocss, vue, yml };
|
package/dist/index.js
CHANGED
|
@@ -156,23 +156,6 @@ var imports = [
|
|
|
156
156
|
"import/no-self-import": "error",
|
|
157
157
|
"import/no-webpack-loader-syntax": "error"
|
|
158
158
|
}
|
|
159
|
-
},
|
|
160
|
-
{
|
|
161
|
-
files: [
|
|
162
|
-
`**/*config*.${GLOB_SRC_EXT}`,
|
|
163
|
-
`**/{views,pages,routes,middleware,plugins,api}/${GLOB_SRC}`,
|
|
164
|
-
`**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.ts`,
|
|
165
|
-
"**/*.d.ts",
|
|
166
|
-
`${GLOB_MARKDOWN}/**`,
|
|
167
|
-
"**/.prettierrc*"
|
|
168
|
-
],
|
|
169
|
-
name: "sxzz/allow-default-export",
|
|
170
|
-
plugins: {
|
|
171
|
-
import: pluginImport
|
|
172
|
-
},
|
|
173
|
-
rules: {
|
|
174
|
-
"import/no-default-export": "off"
|
|
175
|
-
}
|
|
176
159
|
}
|
|
177
160
|
];
|
|
178
161
|
|
|
@@ -274,21 +257,6 @@ var javascript = [
|
|
|
274
257
|
"valid-typeof": ["error", { requireStringLiterals: true }],
|
|
275
258
|
"vars-on-top": "error"
|
|
276
259
|
}
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
files: ["**/scripts/*", "**/cli.*"],
|
|
280
|
-
name: "sxzz/cli-rules",
|
|
281
|
-
rules: {
|
|
282
|
-
"no-console": "off"
|
|
283
|
-
}
|
|
284
|
-
},
|
|
285
|
-
{
|
|
286
|
-
files: ["**/*.{test,spec}.js?(x)"],
|
|
287
|
-
name: "sxzz/test-rules",
|
|
288
|
-
rules: {
|
|
289
|
-
"no-unused-expressions": "off",
|
|
290
|
-
"unicorn/consistent-function-scoping": "off"
|
|
291
|
-
}
|
|
292
260
|
}
|
|
293
261
|
];
|
|
294
262
|
|
|
@@ -662,6 +630,42 @@ var sortImports = [
|
|
|
662
630
|
}
|
|
663
631
|
];
|
|
664
632
|
|
|
633
|
+
// src/configs/special-cases.ts
|
|
634
|
+
var specialCases = [
|
|
635
|
+
{
|
|
636
|
+
files: ["**/scripts/*", "**/cli.*"],
|
|
637
|
+
name: "sxzz/special/cli",
|
|
638
|
+
rules: {
|
|
639
|
+
"no-console": "off"
|
|
640
|
+
}
|
|
641
|
+
},
|
|
642
|
+
{
|
|
643
|
+
files: [`**/*.{test,spec}.${GLOB_SRC_EXT}`],
|
|
644
|
+
name: "sxzz/special/tests",
|
|
645
|
+
rules: {
|
|
646
|
+
"no-unused-expressions": "off",
|
|
647
|
+
"unicorn/consistent-function-scoping": "off"
|
|
648
|
+
}
|
|
649
|
+
},
|
|
650
|
+
{
|
|
651
|
+
files: [
|
|
652
|
+
`**/*config*.${GLOB_SRC_EXT}`,
|
|
653
|
+
`**/{views,pages,routes,middleware,plugins,api,modules}/${GLOB_SRC}`,
|
|
654
|
+
`**/{index,vite,esbuild,rollup,rolldown,webpack,rspack}.${GLOB_SRC_EXT}`,
|
|
655
|
+
"**/*.d.ts",
|
|
656
|
+
`${GLOB_MARKDOWN}/**`,
|
|
657
|
+
"**/.prettierrc*"
|
|
658
|
+
],
|
|
659
|
+
name: "sxzz/special/allow-default-export",
|
|
660
|
+
plugins: {
|
|
661
|
+
import: pluginImport
|
|
662
|
+
},
|
|
663
|
+
rules: {
|
|
664
|
+
"import/no-default-export": "off"
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
];
|
|
668
|
+
|
|
665
669
|
// src/configs/typescript.ts
|
|
666
670
|
var typescriptCore = tseslint.config({
|
|
667
671
|
extends: [...tseslint.configs.recommended],
|
|
@@ -973,9 +977,21 @@ var presetJavaScript = [
|
|
|
973
977
|
...jsdoc,
|
|
974
978
|
...regexp
|
|
975
979
|
];
|
|
976
|
-
var presetJsonc = [
|
|
977
|
-
|
|
978
|
-
|
|
980
|
+
var presetJsonc = [
|
|
981
|
+
...jsonc,
|
|
982
|
+
...sortPackageJson,
|
|
983
|
+
...sortTsconfig
|
|
984
|
+
];
|
|
985
|
+
var presetLangsExtensions = [
|
|
986
|
+
...markdown,
|
|
987
|
+
...yml,
|
|
988
|
+
...presetJsonc
|
|
989
|
+
];
|
|
990
|
+
var presetBasic = [
|
|
991
|
+
...presetJavaScript,
|
|
992
|
+
...typescript,
|
|
993
|
+
...sortImports
|
|
994
|
+
];
|
|
979
995
|
var presetAll = [
|
|
980
996
|
...presetBasic,
|
|
981
997
|
...presetLangsExtensions,
|
|
@@ -1009,6 +1025,7 @@ function sxzz(config = [], {
|
|
|
1009
1025
|
if (Object.keys(config).length > 0) {
|
|
1010
1026
|
configs2.push(...Array.isArray(config) ? config : [config]);
|
|
1011
1027
|
}
|
|
1028
|
+
configs2.push(...specialCases);
|
|
1012
1029
|
return configs2;
|
|
1013
1030
|
}
|
|
1014
1031
|
export {
|
|
@@ -1083,6 +1100,7 @@ export {
|
|
|
1083
1100
|
sortImports,
|
|
1084
1101
|
sortPackageJson,
|
|
1085
1102
|
sortTsconfig,
|
|
1103
|
+
specialCases,
|
|
1086
1104
|
sxzz,
|
|
1087
1105
|
tseslint,
|
|
1088
1106
|
typescript,
|