@haltcase/style 7.3.0 → 7.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.
@@ -2,3 +2,9 @@
2
2
  * @type {import("./internal/base.js").HaltcaseStyleCreator}
3
3
  */
4
4
  export const getEslintTypescriptConfig: import("./internal/base.js").HaltcaseStyleCreator;
5
+ /**
6
+ * @type {(options?: import("./internal/base.js").HaltcaseStyleOptions & {internal?: boolean}) => Awaited<import("typescript-eslint").Config>}
7
+ */
8
+ export const getEslintTypescriptConfigInternal: (options?: import("./internal/base.js").HaltcaseStyleOptions & {
9
+ internal?: boolean;
10
+ }) => Awaited<import("typescript-eslint").Config>;
@@ -22,7 +22,7 @@ import { importRules } from "../../rules/imports.js";
22
22
  import { possibleErrorsRules } from "../../rules/possible-errors.js";
23
23
  import { stylisticRules } from "../../rules/stylistic.js";
24
24
  import { variablesRules } from "../../rules/variables.js";
25
- import { getEslintTypescriptConfig } from "../typescript.js";
25
+ import { getEslintTypescriptConfigInternal } from "../typescript.js";
26
26
  import { getEslintCommonJsConfigInternal } from "./commonjs.js";
27
27
  import { eslintEs2015Config } from "./es2015.js";
28
28
  import { eslintSimpleImportSortConfig } from "./simple-import-sort.js";
@@ -58,7 +58,7 @@ export const getEslintBaseConfig = (options = {}) =>
58
58
  "import-x": eslintPluginImportX
59
59
  },
60
60
  rules: {
61
- ...eslintPluginImportX.configs.recommended.rules
61
+ ...eslintPluginImportX.flatConfigs.recommended.rules
62
62
  },
63
63
  settings: {
64
64
  "import-x/parsers": {
@@ -154,7 +154,7 @@ export const getEslintBaseConfig = (options = {}) =>
154
154
  }
155
155
  },
156
156
 
157
- ...getEslintTypescriptConfig(options),
157
+ ...getEslintTypescriptConfigInternal({ ...options, internal: true }),
158
158
 
159
159
  {
160
160
  name: "@haltcase/internal/Third-party config files (e.g., next.config.mjs)",
@@ -71,7 +71,12 @@ export const getEslintReactConfigInternal = (_options = {}) =>
71
71
 
72
72
  {
73
73
  name: "@haltcase/react/import-x",
74
- ...eslintPluginImportX.flatConfigs.react
74
+ ...eslintPluginImportX.flatConfigs.react,
75
+
76
+ // the base config already defines the `import-x` plugin, and if we
77
+ // don't omit it from this config, we get the error:
78
+ // Cannot redefine plugin "import-x"
79
+ plugins: {}
75
80
  }
76
81
  ],
77
82
  settings: {
@@ -12,7 +12,13 @@ import { eslintTsdocConfig } from "./internal/tsdoc.js";
12
12
  /**
13
13
  * @type {import("./internal/base.js").HaltcaseStyleCreator}
14
14
  */
15
- export const getEslintTypescriptConfig = (options = {}) => {
15
+ export const getEslintTypescriptConfig = (options = {}) =>
16
+ getEslintTypescriptConfigInternal(options);
17
+
18
+ /**
19
+ * @type {(options?: import("./internal/base.js").HaltcaseStyleOptions & {internal?: boolean}) => Awaited<import("typescript-eslint").Config>}
20
+ */
21
+ export const getEslintTypescriptConfigInternal = (options = {}) => {
16
22
  /** @type {import("typescript-eslint").ConfigWithExtends["languageOptions"]} */
17
23
  const languageOptions = {
18
24
  parser,
@@ -43,7 +49,12 @@ export const getEslintTypescriptConfig = (options = {}) => {
43
49
 
44
50
  {
45
51
  name: "import-x/typescript",
46
- ...eslintPluginImportX.configs.typescript
52
+ ...eslintPluginImportX.flatConfigs.typescript,
53
+
54
+ // the base config already defines the `import-x` plugin, and if we
55
+ // don't omit it from this config, we get the error:
56
+ // Cannot redefine plugin "import-x"
57
+ plugins: {}
47
58
  },
48
59
 
49
60
  { name: "prettier", ...eslintConfigPrettier },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haltcase/style",
3
- "version": "7.3.0",
3
+ "version": "7.3.1",
4
4
  "description": "haltcase's web ecosystem style guide & configurations",
5
5
  "keywords": [
6
6
  "eslint",