@seayoo-web/scripts 1.2.12 → 1.3.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 +31 -24
- package/package.json +1 -1
- package/types/src/eslint.d.ts +16 -7
package/dist/index.js
CHANGED
|
@@ -9,8 +9,7 @@ import { existsSync, readFileSync } from "fs";
|
|
|
9
9
|
import "colors";
|
|
10
10
|
import { g as getNowTime, a as getCommitInfo, c as createPageDeployTag } from "./git-BbsLu9cn.js";
|
|
11
11
|
import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
|
|
12
|
-
import { vueTsConfigs } from "@vue/eslint-config-typescript";
|
|
13
|
-
import { defineConfigWithVueTs } from "@vue/eslint-config-typescript";
|
|
12
|
+
import { vueTsConfigs, defineConfigWithVueTs } from "@vue/eslint-config-typescript";
|
|
14
13
|
import { flatConfigs } from "eslint-plugin-import";
|
|
15
14
|
import pluginVue from "eslint-plugin-vue";
|
|
16
15
|
function defineLibBuildConfig(option) {
|
|
@@ -152,7 +151,7 @@ function definePageBuildConfig(option) {
|
|
|
152
151
|
"regenerator-runtime/runtime.js",
|
|
153
152
|
"core-js/es/array/flat",
|
|
154
153
|
"core-js/es/global-this",
|
|
155
|
-
"core-js/es/promise
|
|
154
|
+
"core-js/es/promise",
|
|
156
155
|
"core-js/es/symbol"
|
|
157
156
|
]
|
|
158
157
|
}),
|
|
@@ -235,6 +234,14 @@ function defineAppBuildConfig(option) {
|
|
|
235
234
|
});
|
|
236
235
|
}
|
|
237
236
|
const vueEslintConfig = [
|
|
237
|
+
{
|
|
238
|
+
name: "app/files-to-lint",
|
|
239
|
+
files: ["**/*.{ts,mts,tsx,vue,mjs}"]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
name: "app/files-to-ignore",
|
|
243
|
+
ignores: ["*.mjs", "**/dist/**", "**/bin/**", "**/types/**", "**/dist-ssr/**", "**/coverage/**"]
|
|
244
|
+
},
|
|
238
245
|
pluginVue.configs["flat/essential"],
|
|
239
246
|
vueTsConfigs.recommended,
|
|
240
247
|
skipFormatting,
|
|
@@ -245,6 +252,20 @@ const vueEslintConfig = [
|
|
|
245
252
|
}
|
|
246
253
|
}
|
|
247
254
|
];
|
|
255
|
+
const importOrderRuleConfig = {
|
|
256
|
+
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type"],
|
|
257
|
+
pathGroups: [
|
|
258
|
+
{
|
|
259
|
+
pattern: "@/**",
|
|
260
|
+
group: "internal"
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"newlines-between": "always",
|
|
264
|
+
alphabetize: {
|
|
265
|
+
order: "asc",
|
|
266
|
+
caseInsensitive: true
|
|
267
|
+
}
|
|
268
|
+
};
|
|
248
269
|
const importEslintConfig = [
|
|
249
270
|
flatConfigs.recommended,
|
|
250
271
|
{
|
|
@@ -255,26 +276,13 @@ const importEslintConfig = [
|
|
|
255
276
|
"import/no-named-as-default": "off",
|
|
256
277
|
"import/no-named-as-default-member": "off",
|
|
257
278
|
"import/export": ["error"],
|
|
258
|
-
"import/order": [
|
|
259
|
-
"error",
|
|
260
|
-
{
|
|
261
|
-
groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type"],
|
|
262
|
-
pathGroups: [
|
|
263
|
-
{
|
|
264
|
-
pattern: "@/**",
|
|
265
|
-
group: "internal"
|
|
266
|
-
}
|
|
267
|
-
],
|
|
268
|
-
"newlines-between": "always",
|
|
269
|
-
alphabetize: {
|
|
270
|
-
order: "asc",
|
|
271
|
-
caseInsensitive: true
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
]
|
|
279
|
+
"import/order": ["error", importOrderRuleConfig]
|
|
275
280
|
}
|
|
276
281
|
}
|
|
277
282
|
];
|
|
283
|
+
function defineEslintConfig(...options) {
|
|
284
|
+
return defineConfigWithVueTs(vueEslintConfig, importEslintConfig, options);
|
|
285
|
+
}
|
|
278
286
|
const stylelintConfig = {
|
|
279
287
|
extends: ["stylelint-config-standard", "stylelint-config-recess-order"],
|
|
280
288
|
overrides: [
|
|
@@ -295,13 +303,12 @@ const stylelintConfig = {
|
|
|
295
303
|
export {
|
|
296
304
|
EnvPrefix,
|
|
297
305
|
defineAppBuildConfig,
|
|
298
|
-
|
|
306
|
+
defineEslintConfig,
|
|
299
307
|
defineLibBuildConfig,
|
|
300
308
|
definePageBuildConfig,
|
|
301
309
|
getBuildEnv,
|
|
302
310
|
htmlInjectPlugin,
|
|
303
|
-
|
|
311
|
+
importOrderRuleConfig,
|
|
304
312
|
stylelintConfig,
|
|
305
|
-
transformEnvs
|
|
306
|
-
vueEslintConfig
|
|
313
|
+
transformEnvs
|
|
307
314
|
};
|
package/package.json
CHANGED
package/types/src/eslint.d.ts
CHANGED
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { type TSESLint } from "@typescript-eslint/utils";
|
|
2
|
-
|
|
2
|
+
/** 默认的 import order 检查配置 */
|
|
3
|
+
export declare const importOrderRuleConfig: {
|
|
4
|
+
groups: string[];
|
|
5
|
+
pathGroups: {
|
|
6
|
+
pattern: string;
|
|
7
|
+
group: string;
|
|
8
|
+
}[];
|
|
9
|
+
"newlines-between": string;
|
|
10
|
+
alphabetize: {
|
|
11
|
+
order: string;
|
|
12
|
+
caseInsensitive: boolean;
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
export type ESLintFlatConfig = TSESLint.FlatConfig.Config;
|
|
3
16
|
/**
|
|
4
|
-
* vue eslint
|
|
17
|
+
* 导出默认的 eslint 配置,内置了 vue eslint 和 import lint
|
|
5
18
|
*/
|
|
6
|
-
export declare
|
|
7
|
-
/**
|
|
8
|
-
* import 规则,含排序配置
|
|
9
|
-
*/
|
|
10
|
-
export declare const importEslintConfig: TSESLint.FlatConfig.Config[];
|
|
19
|
+
export declare function defineEslintConfig(...options: ESLintFlatConfig[]): ESLintFlatConfig[];
|