@astralarium/repo-config-eslint 0.2.0 → 0.4.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/README.md CHANGED
@@ -8,15 +8,3 @@ import { config } from "@astralarium/repo-config-eslint";
8
8
 
9
9
  export default config({ react: true, router: true });
10
10
  ```
11
-
12
- ## Workspace guards
13
-
14
- `testWorkspace` checks a pnpm workspace:
15
-
16
- ```ts
17
- // workspace.test.ts
18
- import { testWorkspace } from "@astralarium/repo-config-eslint/testkit";
19
- import { workspaceRoot } from "@astralarium/repo-package-files";
20
-
21
- testWorkspace(workspaceRoot(import.meta.dirname)!);
22
- ```
package/dist/base.js CHANGED
@@ -140,10 +140,13 @@ export const baseLayer = defineConfig(globalIgnores([
140
140
  }, {
141
141
  plugins: {
142
142
  "simple-import-sort": simpleImportSort,
143
+ "import-x": importX,
143
144
  },
144
145
  rules: {
145
146
  "simple-import-sort/imports": "error",
146
147
  "simple-import-sort/exports": "error",
148
+ // Autofix merges imports of one module, types inline.
149
+ "import-x/no-duplicates": ["error", { "prefer-inline": true }],
147
150
  },
148
151
  }, {
149
152
  plugins: {
@@ -1,4 +1,6 @@
1
1
  /** The `eslint.config.mjs` of each package of the workspace at `root`. */
2
2
  export declare function toolConfigs(root: string): string[];
3
- /** Registers every workspace guard over the pnpm workspace at `root`. */
4
- export declare function testWorkspace(root: string): void;
3
+ /** Registers the guard over the workspace at `root`: one ESLint run of
4
+ * `config()` parses every package's tool config without a fatal
5
+ * message. */
6
+ export declare function testToolConfigs(root: string): void;
@@ -1,10 +1,7 @@
1
- /** Workspace guards: a pnpm workspace's package manifests, tool configs
2
- * and l10n manifests. */
1
+ /** Workspace guard: the config parses every package's tool config. */
3
2
  import { existsSync } from "node:fs";
4
3
  import { join } from "node:path";
5
- import { testL10nManifests } from "@astralarium/repo-l10n-manifest/testkit";
6
4
  import { workspacePackageDirs } from "@astralarium/repo-package-files";
7
- import { testWorkspacePackages } from "@astralarium/repo-package-files/testkit";
8
5
  import { ESLint } from "eslint";
9
6
  import { expect, test } from "vitest";
10
7
  import { config } from "../config.js";
@@ -14,16 +11,10 @@ export function toolConfigs(root) {
14
11
  .map((dir) => join(dir, "eslint.config.mjs"))
15
12
  .filter((file) => existsSync(file));
16
13
  }
17
- /** Registers every workspace guard over the pnpm workspace at `root`. */
18
- export function testWorkspace(root) {
19
- testWorkspacePackages(root);
20
- testToolConfigs(root);
21
- testL10nManifests(root);
22
- }
23
- /** Registers the tool config guard over the workspace at `root`: one
24
- * ESLint run of `config()` parses every package's tool config without a
25
- * fatal message. */
26
- function testToolConfigs(root) {
14
+ /** Registers the guard over the workspace at `root`: one ESLint run of
15
+ * `config()` parses every package's tool config without a fatal
16
+ * message. */
17
+ export function testToolConfigs(root) {
27
18
  test("the config parses every tool config of the workspace in one run", async () => {
28
19
  const all = new ESLint({
29
20
  cwd: root,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astralarium/repo-config-eslint",
3
- "version": "0.2.0",
3
+ "version": "0.4.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/astralarium/repo/tree/main/packages/repo-config-eslint#readme",
6
6
  "repository": {
@@ -37,8 +37,8 @@
37
37
  "globals": "^17.5.0",
38
38
  "typescript-eslint": "^8.71.0",
39
39
  "@astralarium/icu-template": "^0.1.0",
40
- "@astralarium/repo-package-files": "^0.1.0",
41
- "@astralarium/repo-l10n-manifest": "^0.1.1"
40
+ "@astralarium/repo-package-files": "^0.2.0",
41
+ "@astralarium/repo-l10n-manifest": "^0.2.0"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^24.2.0",