@astralarium/repo-config-eslint 0.1.0 → 0.2.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
@@ -9,12 +9,14 @@ import { config } from "@astralarium/repo-config-eslint";
9
9
  export default config({ react: true, router: true });
10
10
  ```
11
11
 
12
- Check package configs:
12
+ ## Workspace guards
13
+
14
+ `testWorkspace` checks a pnpm workspace:
13
15
 
14
16
  ```ts
15
- // eslint-config.test.ts; peer: vitest
17
+ // workspace.test.ts
18
+ import { testWorkspace } from "@astralarium/repo-config-eslint/testkit";
16
19
  import { workspaceRoot } from "@astralarium/repo-package-files";
17
- import { testToolConfigs } from "@astralarium/repo-config-eslint/testkit";
18
20
 
19
- testToolConfigs(workspaceRoot(import.meta.dirname)!);
21
+ testWorkspace(workspaceRoot(import.meta.dirname)!);
20
22
  ```
@@ -1,6 +1,4 @@
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 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;
3
+ /** Registers every workspace guard over the pnpm workspace at `root`. */
4
+ export declare function testWorkspace(root: string): void;
@@ -1,7 +1,10 @@
1
- /** Workspace guard: the config parses every package's tool config. */
1
+ /** Workspace guards: a pnpm workspace's package manifests, tool configs
2
+ * and l10n manifests. */
2
3
  import { existsSync } from "node:fs";
3
4
  import { join } from "node:path";
5
+ import { testL10nManifests } from "@astralarium/repo-l10n-manifest/testkit";
4
6
  import { workspacePackageDirs } from "@astralarium/repo-package-files";
7
+ import { testWorkspacePackages } from "@astralarium/repo-package-files/testkit";
5
8
  import { ESLint } from "eslint";
6
9
  import { expect, test } from "vitest";
7
10
  import { config } from "../config.js";
@@ -11,10 +14,16 @@ export function toolConfigs(root) {
11
14
  .map((dir) => join(dir, "eslint.config.mjs"))
12
15
  .filter((file) => existsSync(file));
13
16
  }
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) {
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) {
18
27
  test("the config parses every tool config of the workspace in one run", async () => {
19
28
  const all = new ESLint({
20
29
  cwd: root,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@astralarium/repo-config-eslint",
3
- "version": "0.1.0",
3
+ "version": "0.2.0",
4
4
  "license": "MIT",
5
5
  "homepage": "https://github.com/astralarium/repo/tree/main/packages/repo-config-eslint#readme",
6
6
  "repository": {
@@ -38,7 +38,7 @@
38
38
  "typescript-eslint": "^8.71.0",
39
39
  "@astralarium/icu-template": "^0.1.0",
40
40
  "@astralarium/repo-package-files": "^0.1.0",
41
- "@astralarium/repo-l10n-manifest": "^0.1.0"
41
+ "@astralarium/repo-l10n-manifest": "^0.1.1"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/node": "^24.2.0",