@astralarium/repo-config-eslint 0.2.0 → 0.3.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 +0 -12
- package/dist/testkit/index.d.ts +4 -2
- package/dist/testkit/index.js +5 -14
- package/package.json +1 -1
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/testkit/index.d.ts
CHANGED
|
@@ -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
|
|
4
|
-
|
|
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;
|
package/dist/testkit/index.js
CHANGED
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
/** Workspace
|
|
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
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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,
|