@so1ve/eslint-config 3.15.0 → 3.17.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 CHANGED
@@ -884,6 +884,41 @@ interface RuleOptions {
884
884
  * @deprecated
885
885
  */
886
886
  'implicit-arrow-linebreak'?: Linter.RuleEntry<ImplicitArrowLinebreak>;
887
+ /**
888
+ * Enforce or ban the use of inline type-only markers for named imports.
889
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/consistent-type-specifier-style/README.md
890
+ */
891
+ 'import-lite/consistent-type-specifier-style'?: Linter.RuleEntry<ImportLiteConsistentTypeSpecifierStyle>;
892
+ /**
893
+ * Ensure all imports appear before other statements.
894
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/first/README.md
895
+ */
896
+ 'import-lite/first'?: Linter.RuleEntry<ImportLiteFirst>;
897
+ /**
898
+ * Enforce a newline after import statements.
899
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/newline-after-import/README.md
900
+ */
901
+ 'import-lite/newline-after-import'?: Linter.RuleEntry<ImportLiteNewlineAfterImport>;
902
+ /**
903
+ * Forbid default exports.
904
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-default-export/README.md
905
+ */
906
+ 'import-lite/no-default-export'?: Linter.RuleEntry<[]>;
907
+ /**
908
+ * Forbid repeated import of the same module in multiple places.
909
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-duplicates/README.md
910
+ */
911
+ 'import-lite/no-duplicates'?: Linter.RuleEntry<ImportLiteNoDuplicates>;
912
+ /**
913
+ * Forbid the use of mutable exports with `var` or `let`.
914
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-mutable-exports/README.md
915
+ */
916
+ 'import-lite/no-mutable-exports'?: Linter.RuleEntry<[]>;
917
+ /**
918
+ * Forbid named default exports.
919
+ * @see https://github.com/9romise/eslint-plugin-import-lite/blob/main/src/rules/no-named-default/README.md
920
+ */
921
+ 'import-lite/no-named-default'?: Linter.RuleEntry<[]>;
887
922
  /**
888
923
  * Enforce or ban the use of inline type-only markers for named imports.
889
924
  * @see https://github.com/un-ts/eslint-plugin-import-x/blob/v4.16.1/docs/rules/consistent-type-specifier-style.md
@@ -7749,6 +7784,20 @@ type IdMatch = [] | [string] | [string, {
7749
7784
  }];
7750
7785
  // ----- implicit-arrow-linebreak -----
7751
7786
  type ImplicitArrowLinebreak = [] | [("beside" | "below")];
7787
+ // ----- import-lite/consistent-type-specifier-style -----
7788
+ type ImportLiteConsistentTypeSpecifierStyle = [] | [("top-level" | "inline" | "prefer-top-level")];
7789
+ // ----- import-lite/first -----
7790
+ type ImportLiteFirst = [] | [("absolute-first" | "disable-absolute-first")];
7791
+ // ----- import-lite/newline-after-import -----
7792
+ type ImportLiteNewlineAfterImport = [] | [{
7793
+ count?: number;
7794
+ exactCount?: boolean;
7795
+ considerComments?: boolean;
7796
+ }];
7797
+ // ----- import-lite/no-duplicates -----
7798
+ type ImportLiteNoDuplicates = [] | [{
7799
+ "prefer-inline"?: boolean;
7800
+ }];
7752
7801
  // ----- import/consistent-type-specifier-style -----
7753
7802
  type ImportConsistentTypeSpecifierStyle = [] | [("prefer-top-level" | "prefer-inline")];
7754
7803
  // ----- import/dynamic-import-chunkname -----
package/dist/index.js CHANGED
@@ -3,6 +3,7 @@ import pluginComments from "@eslint-community/eslint-plugin-eslint-comments";
3
3
  import pluginSo1ve from "@so1ve/eslint-plugin";
4
4
  import pluginSortImports from "@so1ve/eslint-plugin-sort-imports";
5
5
  import pluginArrayFunc from "eslint-plugin-array-func";
6
+ import pluginImportLite from "eslint-plugin-import-lite";
6
7
  import pluginImport from "eslint-plugin-import-x";
7
8
  import pluginNode from "eslint-plugin-n";
8
9
  import * as pluginNoAwaitInPromise from "eslint-plugin-no-await-in-promise";
@@ -417,7 +418,10 @@ const ignores = () => [{
417
418
  const imports = (options = {}) => [
418
419
  {
419
420
  name: "so1ve/imports/setup",
420
- plugins: { import: pluginImport }
421
+ plugins: {
422
+ "import": pluginImport,
423
+ "import-lite": pluginImportLite
424
+ }
421
425
  },
422
426
  {
423
427
  name: "so1ve/imports/rules",
@@ -461,15 +465,14 @@ const imports = (options = {}) => [
461
465
  } : { node: { extensions: [".js", ".mjs"] } } }
462
466
  },
463
467
  rules: {
468
+ "import-lite/no-duplicates": "error",
469
+ "import-lite/no-named-default": "error",
464
470
  "import/default": "error",
465
471
  "import/export": "error",
466
472
  "import/first": "error",
467
473
  "import/named": "error",
468
474
  "import/namespace": "off",
469
- "import/no-duplicates": "error",
470
- "import/no-mutable-exports": "error",
471
475
  "import/no-named-as-default": "error",
472
- "import/no-named-default": "error",
473
476
  "import/no-useless-path-segments": ["error", { noUselessIndex: true }],
474
477
  "import/no-webpack-loader-syntax": "error"
475
478
  }
@@ -1548,21 +1551,57 @@ async function vue({ overrides, typescript: typescript$1 } = {}) {
1548
1551
  //#region src/configs/yaml.ts
1549
1552
  async function yaml({ overrides } = {}) {
1550
1553
  const [parserYaml, pluginYaml] = await Promise.all([interopDefault(import("yaml-eslint-parser")), interopDefault(import("eslint-plugin-yml"))]);
1551
- return [{
1552
- name: "so1ve/yaml/setup",
1553
- plugins: { yaml: pluginYaml }
1554
- }, {
1555
- name: "so1ve/yaml/rules",
1556
- languageOptions: { parser: parserYaml },
1557
- files: [GLOB_YAML],
1558
- rules: {
1559
- ...renameRules(pluginYaml.configs.prettier.rules, { yml: "yaml" }),
1560
- ...renameRules(pluginYaml.configs.recommended.rules, { yml: "yaml" }),
1561
- "style/spaced-comment": "off",
1562
- "yaml/no-empty-document": "off",
1563
- ...overrides
1554
+ return [
1555
+ {
1556
+ name: "so1ve/yaml/setup",
1557
+ plugins: { yaml: pluginYaml }
1558
+ },
1559
+ {
1560
+ name: "so1ve/yaml/rules",
1561
+ languageOptions: { parser: parserYaml },
1562
+ files: [GLOB_YAML],
1563
+ rules: {
1564
+ ...renameRules(pluginYaml.configs.prettier.rules, { yml: "yaml" }),
1565
+ ...renameRules(pluginYaml.configs.recommended.rules, { yml: "yaml" }),
1566
+ "style/spaced-comment": "off",
1567
+ "yaml/no-empty-document": "off",
1568
+ ...overrides
1569
+ }
1570
+ },
1571
+ {
1572
+ files: ["pnpm-workspace.yaml"],
1573
+ name: "so1ve/yaml/pnpm-workspace",
1574
+ rules: { "yaml/sort-keys": [
1575
+ "error",
1576
+ {
1577
+ order: [
1578
+ "packages",
1579
+ "overrides",
1580
+ "patchedDependencies",
1581
+ "hoistPattern",
1582
+ "allowedDeprecatedVersions",
1583
+ "allowNonAppliedPatches",
1584
+ "configDependencies",
1585
+ "ignoredBuiltDependencies",
1586
+ "ignoredOptionalDependencies",
1587
+ "neverBuiltDependencies",
1588
+ "onlyBuiltDependencies",
1589
+ "onlyBuiltDependenciesFile",
1590
+ "packageExtensions",
1591
+ "peerDependencyRules",
1592
+ "supportedArchitectures",
1593
+ "catalog",
1594
+ "catalogs"
1595
+ ],
1596
+ pathPattern: "^$"
1597
+ },
1598
+ {
1599
+ order: { type: "asc" },
1600
+ pathPattern: ".*"
1601
+ }
1602
+ ] }
1564
1603
  }
1565
- }];
1604
+ ];
1566
1605
  }
1567
1606
 
1568
1607
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@so1ve/eslint-config",
3
- "version": "3.15.0",
3
+ "version": "3.17.0",
4
4
  "author": "Ray <i@mk1.io> (https://github.com/so1ve/)",
5
5
  "type": "module",
6
6
  "description": "Ray's eslint config.",
@@ -50,6 +50,7 @@
50
50
  "eslint-plugin-case-police": "^2.1.1",
51
51
  "eslint-plugin-command": "^3.3.1",
52
52
  "eslint-plugin-html": "^8.1.3",
53
+ "eslint-plugin-import-lite": "^0.3.0",
53
54
  "eslint-plugin-import-x": "^4.16.1",
54
55
  "eslint-plugin-jest-formatting": "^3.1.0",
55
56
  "eslint-plugin-jsonc": "^2.21.0",
@@ -76,8 +77,8 @@
76
77
  "typescript-eslint": "^8.47.0",
77
78
  "vue-eslint-parser": "^10.2.0",
78
79
  "yaml-eslint-parser": "^1.3.0",
79
- "@so1ve/eslint-plugin-sort-imports": "3.15.0",
80
- "@so1ve/eslint-plugin": "3.15.0"
80
+ "@so1ve/eslint-plugin-sort-imports": "3.17.0",
81
+ "@so1ve/eslint-plugin": "3.17.0"
81
82
  },
82
83
  "peerDependencies": {
83
84
  "eslint": "^9.39.1",