@seayoo-web/scripts 1.3.0 → 1.3.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
@@ -252,33 +252,36 @@ const vueEslintConfig = [
252
252
  }
253
253
  }
254
254
  ];
255
+ const importOrderRuleConfig = {
256
+ groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type"],
257
+ pathGroups: [
258
+ {
259
+ pattern: "@/**",
260
+ group: "internal"
261
+ }
262
+ ],
263
+ distinctGroup: true,
264
+ sortTypesGroup: true,
265
+ "newlines-between": "always",
266
+ "newlines-between-types": "never",
267
+ name: true,
268
+ alphabetize: {
269
+ order: "asc",
270
+ caseInsensitive: true
271
+ }
272
+ };
255
273
  const importEslintConfig = [
256
274
  flatConfigs.recommended,
257
275
  {
258
276
  rules: {
277
+ "import/no-deprecated": "on",
259
278
  "import/no-unresolved": "off",
260
279
  "import/named": "off",
261
280
  "import/namespace": "off",
262
281
  "import/no-named-as-default": "off",
263
282
  "import/no-named-as-default-member": "off",
264
283
  "import/export": ["error"],
265
- "import/order": [
266
- "error",
267
- {
268
- groups: ["builtin", "external", "internal", "parent", "sibling", "index", "type"],
269
- pathGroups: [
270
- {
271
- pattern: "@/**",
272
- group: "internal"
273
- }
274
- ],
275
- "newlines-between": "always",
276
- alphabetize: {
277
- order: "asc",
278
- caseInsensitive: true
279
- }
280
- }
281
- ]
284
+ "import/order": ["error", importOrderRuleConfig]
282
285
  }
283
286
  }
284
287
  ];
@@ -310,6 +313,7 @@ export {
310
313
  definePageBuildConfig,
311
314
  getBuildEnv,
312
315
  htmlInjectPlugin,
316
+ importOrderRuleConfig,
313
317
  stylelintConfig,
314
318
  transformEnvs
315
319
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seayoo-web/scripts",
3
- "version": "1.3.0",
3
+ "version": "1.3.2",
4
4
  "description": "scripts for seayoo web monorepos",
5
5
  "type": "module",
6
6
  "source": "index.ts",
@@ -1,6 +1,27 @@
1
1
  import { type TSESLint } from "@typescript-eslint/utils";
2
+ /**
3
+ * 默认的 import order 检查配置
4
+ *
5
+ * https://github.com/import-js/eslint-plugin-import/blob/HEAD/docs/rules/order.md
6
+ */
7
+ export declare const importOrderRuleConfig: {
8
+ groups: string[];
9
+ pathGroups: {
10
+ pattern: string;
11
+ group: string;
12
+ }[];
13
+ distinctGroup: boolean;
14
+ sortTypesGroup: boolean;
15
+ "newlines-between": string;
16
+ "newlines-between-types": string;
17
+ name: boolean;
18
+ alphabetize: {
19
+ order: string;
20
+ caseInsensitive: boolean;
21
+ };
22
+ };
2
23
  export type ESLintFlatConfig = TSESLint.FlatConfig.Config;
3
24
  /**
4
- * 导出默认的 eslint 配置,包括 vue 基本 eslint 和 import order lint
25
+ * 导出默认的 eslint 配置,内置了 vue eslint 和 import lint
5
26
  */
6
27
  export declare function defineEslintConfig(...options: ESLintFlatConfig[]): ESLintFlatConfig[];