@seayoo-web/scripts 1.0.0 → 1.0.2

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
@@ -13,6 +13,9 @@ import { exec } from "child_process";
13
13
  import { Command } from "commander";
14
14
  import inquirer from "inquirer";
15
15
  import ora from "ora";
16
+ import skipFormatting from "@vue/eslint-config-prettier/skip-formatting";
17
+ import { flatConfigs } from "eslint-plugin-import";
18
+ import pluginVue from "eslint-plugin-vue";
16
19
  function defineLibBuildConfig(option) {
17
20
  return defineConfig({
18
21
  build: {
@@ -655,6 +658,46 @@ async function destroyRepo() {
655
658
  spinner.succeed("页面已经销毁!".green);
656
659
  }
657
660
  program.action(startCreateJob);
661
+ const vueConfig = [
662
+ ...pluginVue.configs["flat/essential"],
663
+ skipFormatting,
664
+ {
665
+ files: ["**/*.vue"],
666
+ rules: {
667
+ "vue/multi-word-component-names": "off"
668
+ }
669
+ }
670
+ ];
671
+ const importConfig = [
672
+ flatConfigs,
673
+ {
674
+ rules: {
675
+ "import/no-unresolved": "off",
676
+ "import/named": "off",
677
+ "import/namespace": "off",
678
+ "import/no-named-as-default": "off",
679
+ "import/no-named-as-default-member": "off",
680
+ "import/export": ["error"],
681
+ "import/order": [
682
+ "error",
683
+ {
684
+ groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type"],
685
+ pathGroups: [
686
+ {
687
+ pattern: "@/**",
688
+ group: "internal"
689
+ }
690
+ ],
691
+ "newlines-between": "always",
692
+ alphabetize: {
693
+ order: "asc",
694
+ caseInsensitive: true
695
+ }
696
+ }
697
+ ]
698
+ }
699
+ }
700
+ ];
658
701
  export {
659
702
  EnvPrefix,
660
703
  checkCommit,
@@ -662,7 +705,9 @@ export {
662
705
  definePageBuildConfig,
663
706
  getBuildEnv,
664
707
  htmlInjectPlugin,
708
+ importConfig,
665
709
  runCreateScript,
666
710
  runDestoryScript,
667
- transformEnvs
711
+ transformEnvs,
712
+ vueConfig
668
713
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/scripts",
3
- "version": "1.0.0",
3
+ "version": "1.0.2",
4
4
  "description": "scripts for seayoo web monorepos",
5
5
  "type": "module",
6
6
  "source": "index.ts",
@@ -24,8 +24,11 @@
24
24
  "@sentry/vite-plugin": "^3.2.1",
25
25
  "@vitejs/plugin-legacy": "^6.0.2",
26
26
  "@vitejs/plugin-vue": "^5.2.1",
27
+ "@vue/eslint-config-prettier": "^10.2.0",
27
28
  "colors": "^1.4.0",
28
29
  "commander": "^13.1.0",
30
+ "eslint-plugin-import": "^2.31.0",
31
+ "eslint-plugin-vue": "^9.32.0",
29
32
  "fs-extra": "^11.3.0",
30
33
  "inquirer": "^12.4.2",
31
34
  "ora": "^8.2.0",
@@ -36,6 +39,7 @@
36
39
  "devDependencies": {
37
40
  "@types/fs-extra": "^11.0.4",
38
41
  "@types/node": "^22.13.1",
42
+ "@typescript-eslint/utils": "^8.25.0",
39
43
  "@seayoo-web/tsconfig": "^1.0.2"
40
44
  },
41
45
  "scripts": {
package/types/index.d.ts CHANGED
@@ -5,3 +5,4 @@ export * from "./src/commit";
5
5
  export * from "./src/inject";
6
6
  export * from "./src/create";
7
7
  export * from "./src/destory";
8
+ export * from "./src/eslint";
@@ -0,0 +1,9 @@
1
+ import { type TSESLint } from "@typescript-eslint/utils";
2
+ /**
3
+ * vue eslint 规则
4
+ */
5
+ export declare const vueConfig: TSESLint.FlatConfig.Config[];
6
+ /**
7
+ * import 规则,含排序配置
8
+ */
9
+ export declare const importConfig: TSESLint.FlatConfig.Config[];
@@ -9,5 +9,5 @@ interface LibBuildOption {
9
9
  /**
10
10
  * 导出一个动态的配置工厂函数用于 lib 类工具的编译配置
11
11
  */
12
- export declare function defineLibBuildConfig(option: LibBuildOption): import("vite").UserConfig;
12
+ export declare function defineLibBuildConfig(option?: LibBuildOption): import("vite").UserConfig;
13
13
  export {};
@@ -9,5 +9,5 @@ interface ExternalConfig {
9
9
  /**
10
10
  * 导出一个动态的配置工厂函数
11
11
  */
12
- export declare function definePageBuildConfig(option: UserConfig & ExternalConfig): import("vite").UserConfigFnPromise;
12
+ export declare function definePageBuildConfig(option?: UserConfig & ExternalConfig): import("vite").UserConfigFnPromise;
13
13
  export {};