@opendesignai/harness 0.0.0-stage → 0.2.0-alpha.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.
Files changed (39) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +132 -2
  3. package/dist/cli.d.mts +1 -0
  4. package/dist/cli.mjs +1723 -0
  5. package/dist/eslint-comments.d.mts +40 -0
  6. package/dist/eslint-comments.mjs +182 -0
  7. package/dist/paths-DBoYPrGy.mjs +59 -0
  8. package/dist/plugin.d.mts +41 -0
  9. package/dist/plugin.mjs +1410 -0
  10. package/docs/adopting.md +224 -0
  11. package/docs/baseline-move.md +56 -0
  12. package/docs/clones.md +51 -0
  13. package/docs/decisions/0001-oxlint.md +74 -0
  14. package/docs/decisions/0002-react-compiler-rules.md +34 -0
  15. package/docs/decisions/0003-agent-harness.md +37 -0
  16. package/docs/hooks.md +128 -0
  17. package/docs/ratchet.md +65 -0
  18. package/docs/rules/no-api-path-literal.md +35 -0
  19. package/docs/rules/no-cjk-literal.md +38 -0
  20. package/docs/rules/no-constant-flag.md +33 -0
  21. package/docs/rules/no-error-message-match.md +63 -0
  22. package/docs/rules/no-locale-branch.md +55 -0
  23. package/docs/rules/no-process-env.md +37 -0
  24. package/docs/rules/no-product-literal.md +41 -0
  25. package/docs/rules/no-raw-fetch.md +33 -0
  26. package/docs/rules/no-raw-storage.md +43 -0
  27. package/docs/rules/no-shell-imports-product.md +48 -0
  28. package/docs/rules/no-swallowed-catch.md +76 -0
  29. package/docs/rules/no-window-bus.md +35 -0
  30. package/docs/size.md +52 -0
  31. package/docs/unused.md +76 -0
  32. package/package.json +75 -3
  33. package/presets/base.json +7 -0
  34. package/presets/platform-boundary.json +4 -0
  35. package/presets/product.json +4 -0
  36. package/presets/react-compiler.json +13 -0
  37. package/presets/rules/base.json +49 -0
  38. package/presets/rules/platform-boundary.json +6 -0
  39. package/presets/rules/product.json +5 -0
@@ -0,0 +1,43 @@
1
+ # od/no-raw-storage
2
+
3
+ Preset: `base`
4
+
5
+ ## What it reports
6
+
7
+ References to the global `localStorage` or `sessionStorage`, directly, as `window.` / `globalThis.` / `self.` members (also computed, `window["localStorage"]`), or destructured from those objects:
8
+
9
+ ```ts
10
+ localStorage.getItem("k");
11
+ const s = window.sessionStorage;
12
+ const t = globalThis["localStorage"];
13
+ const { localStorage: ls } = window;
14
+ if (typeof sessionStorage !== "undefined") …
15
+ ```
16
+
17
+ Not reported: object keys, class members (fields, methods, `accessor`), enum members and labels (`localStorage:` and `break localStorage`) named `localStorage`; parameters, imports and local variables that shadow the global; type-only positions (`typeof localStorage` in a type, the type of `x as { localStorage(): void }`) and ambient declarations (`declare …`), which emit no code.
18
+
19
+ ## Why
20
+
21
+ Raw storage access bypasses the storage wrapper: no key prefixing per product, no handling of quota errors or private mode, and no single place to migrate keys. Once products run inside the shell, storage goes through the shell SDK, which prefixes keys per product; every raw access is a migration hazard.
22
+
23
+ ## How to fix
24
+
25
+ Read and write through the repository's storage wrapper (in opengame/openmotion: `studio/src/utils/safeStorage.ts`). Set the `wrapper` option so the message names it.
26
+
27
+ ## Exemptions
28
+
29
+ The wrapper itself is exempted with an `overrides` entry in the lint config:
30
+
31
+ ```json
32
+ { "files": ["studio/src/utils/safeStorage.ts"], "rules": { "od/no-raw-storage": "off" } }
33
+ ```
34
+
35
+ Inline disable comments are rejected; existing debt stays in `oxlint-suppressions.json` and may only shrink.
36
+
37
+ ## Options
38
+
39
+ ```json
40
+ ["error", { "wrapper": "studio/src/utils/safeStorage.ts" }]
41
+ ```
42
+
43
+ `wrapper` only changes the message text.
@@ -0,0 +1,48 @@
1
+ # od/no-shell-imports-product
2
+
3
+ Preset: `platform-boundary`
4
+
5
+ ## What it reports
6
+
7
+ A static `import`, `export … from` or `export * from` in a **shell** file whose target resolves into a **product** directory:
8
+
9
+ ```ts
10
+ // studio/src/motion/LocaleCases.tsx (shell)
11
+ import { GameStudio } from "./game/GameStudio"; // studio/src/motion/game/ is product
12
+ ```
13
+
14
+ Not reported: `import type` / `export type` (all specifiers type-only), dynamic `import()` (the registry's lazy entry point), files that are themselves inside a product directory, and files outside `shell`.
15
+
16
+ ## Why
17
+
18
+ The platform loads products through the product registry and talks to them through the contract and shell SDK. A static import from shell into product code makes the shell bundle depend on the product, blocks moving the product into its own package, and is how boundaries erode one import at a time.
19
+
20
+ ## How to fix
21
+
22
+ Reach the product through the registry (a lazy `import()` in the registry entry) and shared contracts or the shell SDK. If the shell needs data from the product, add it to the product manifest or a contract type.
23
+
24
+ ## Exemptions
25
+
26
+ The split itself is configuration: the `shell` and `product` options in the lint config are owner-reviewed. Known edges during the migration stay in `oxlint-suppressions.json` until the boundary work removes them. Inline disable comments are rejected.
27
+
28
+ ## Options
29
+
30
+ **The rule is inactive until both `shell` and `product` are set**: enabling it through the `platform-boundary` preset alone checks nothing and reports nothing. After configuring it, check that one known shell-to-product import is reported.
31
+
32
+ ```json
33
+ [
34
+ "error",
35
+ {
36
+ "shell": ["studio/src/"],
37
+ "product": ["studio/src/motion/game/", "studio/src/super-agent/gamePublish/"],
38
+ "aliases": { "@/": "studio/src/" }
39
+ }
40
+ ]
41
+ ```
42
+
43
+ - `shell`, `product`: repo-relative path patterns. `dir/` matches the directory and everything below it; globs support `**`, `*` and `?` (`dir/**` also matches `dir`); anything else is an exact path. A leading `./` is ignored (`./studio/src/` is `studio/src/`). A file is shell when it matches `shell` and does not match `product`.
44
+ - `aliases`: import specifier prefix → repo-relative path prefix, for path aliases such as `@/`. An alias matches whole path segments: `"@"` matches `@` and `@/motion/x` but not packages such as `@scope/pkg` or `@motion/game`, and `"@/"` matches specifiers that start with `@/`. The rest of the specifier is joined to the target as path segments, so a trailing slash on the key or the target does not matter (`"@/": "studio/src"` and `"@": "studio/src/"` resolve `@/motion/x` to `studio/src/motion/x`). Other bare specifiers (packages) are never product paths.
45
+
46
+ A bundler query on the specifier (`./game/logo.svg?url`, `./shader.glsl?raw`) is removed before resolving: it names the same module.
47
+
48
+ Paths are relative to the directory the linter runs in, so run Oxlint from the repository root.
@@ -0,0 +1,76 @@
1
+ # od/no-swallowed-catch
2
+
3
+ Preset: `base`
4
+
5
+ ## What it reports
6
+
7
+ - An empty `catch` block. Comments, `;` and empty blocks do not count as handling.
8
+ - A rejection handler, `.catch(handler)` or the second argument of `.then(onFulfilled, handler)`, that has an empty body or only produces a constant: a literal (`null`, `false`, `0`, `""`, `"none"`), `undefined`, `void …`, a template literal without expressions, `{}` or `[]`, or no value at all (`return;`).
9
+
10
+ ```ts
11
+ try {
12
+ await save();
13
+ } catch {}
14
+ const state = await readState().catch(() => null);
15
+ const config = await load().then(parse, () => ({}));
16
+ ```
17
+
18
+ Not reported:
19
+
20
+ - a `try` block that only calls cleanup functions (`close`, `cancel`, `abort`, `destroy`, `dispose`, `release`, `rm`, `unlink`, `removeItem`, …), and `.catch()` / `.then()` on such a call: `body.cancel().catch(() => {})`;
21
+ - handlers that use the error or return a real fallback value (`.catch(() => defaultConfig)`);
22
+ - a handler marked with a `// fail-open: <reason>` comment inside it, or on the line of (or just above) the `catch`.
23
+
24
+ ## Why
25
+
26
+ Swallowed errors make failures invisible: a failed write followed by "success" UI, a corrupt state file silently rebuilt, telemetry that never fires. In opengame 459 such sites were counted.
27
+
28
+ ## How to fix
29
+
30
+ Log with context and report to telemetry, return an explicit error result, or rethrow. If the caller can genuinely proceed, say why in code:
31
+
32
+ ```ts
33
+ try {
34
+ await warmCache();
35
+ } catch (error) {
36
+ // fail-open: the cache only speeds up the first paint; the page loads without it
37
+ logger.warn("cache warm-up failed", { error });
38
+ }
39
+ ```
40
+
41
+ ## Exemptions
42
+
43
+ `// fail-open: <reason>` (the reason is required). Cleanup calls listed in `cleanupCallees` are allowed without a comment. Inline disable comments are rejected.
44
+
45
+ ## Options
46
+
47
+ ```json
48
+ [
49
+ "error",
50
+ {
51
+ "cleanupCallees": [
52
+ "abort",
53
+ "cancel",
54
+ "close",
55
+ "destroy",
56
+ "disconnect",
57
+ "dispose",
58
+ "kill",
59
+ "release",
60
+ "removeItem",
61
+ "revokeObjectURL",
62
+ "rm",
63
+ "rmSync",
64
+ "rmdir",
65
+ "rmdirSync",
66
+ "terminate",
67
+ "unlink",
68
+ "unlinkSync"
69
+ ]
70
+ }
71
+ ]
72
+ ```
73
+
74
+ ## Limits
75
+
76
+ The rule cannot judge whether a returned fallback is correct (`.catch(() => game)` after a failed write is still a swallowed failure); that stays a review item.
@@ -0,0 +1,35 @@
1
+ # od/no-window-bus
2
+
3
+ Preset: `base`
4
+
5
+ ## What it reports
6
+
7
+ Using the global object as an untyped event bus:
8
+
9
+ - `dispatchEvent(...)` on `window`, `document`, `globalThis` or `self` (or the bare global `dispatchEvent`);
10
+ - `new CustomEvent(...)` anywhere (reported once, on the dispatch, when it is dispatched on a global object);
11
+ - `addEventListener` / `removeEventListener` on those objects for an application event name, that is, a name containing anything other than letters (`"motion:account-changed"`, `"od-theme"`). The name may be a literal or a same-file string `const`.
12
+
13
+ Standard DOM events (`resize`, `visibilitychange`, `DOMContentLoaded`) and events on elements (`el.dispatchEvent(new Event("change"))`) are not reported.
14
+
15
+ ## Why
16
+
17
+ Global string events have no types, no single owner and no check that every event has both a sender and a listener. In opengame `window.dispatchEvent` went from 20 to 37 sites and `motion:account-changed` from 5 to 14, and dead listeners appeared.
18
+
19
+ ## How to fix
20
+
21
+ Share state through a typed store or context, or call the owning module's API. If a cross-app event is really needed, declare it in the event registry and use its typed emit/subscribe helpers.
22
+
23
+ ## Exemptions
24
+
25
+ Events declared in the registry can be listed in `allowEvents`. The registry module itself is exempted with an `overrides` entry in the lint config (owner review). Inline disable comments are rejected; existing debt stays in `oxlint-suppressions.json` and may only shrink.
26
+
27
+ ## Options
28
+
29
+ ```json
30
+ ["error", { "allowEvents": ["od:ready"] }]
31
+ ```
32
+
33
+ ## Limits
34
+
35
+ Application events whose names are plain letters (`"accountchanged"`) look like DOM events and are not reported when only listened to.
package/docs/size.md ADDED
@@ -0,0 +1,52 @@
1
+ # od-harness size
2
+
3
+ File size budget: a file should be small enough for a person or an agent to read in one go.
4
+
5
+ | Files | Budget |
6
+ | --------------------------------------------------------------------- | ----------- |
7
+ | Source (`.ts`, `.tsx`, `.js`, `.jsx`, `.mjs`, `.cjs`, `.mts`, `.cts`) | 800 lines |
8
+ | Tests (`*.test.*`, `*.spec.*`, `__tests__/`) and stylesheets (`.css`) | 1,500 lines |
9
+
10
+ Files are those git tracks plus untracked files that are not ignored. Lines are counted like `wc -l` (a last line without a newline counts too).
11
+
12
+ - **Which files count as tests**: only the name decides. A file matching `*.test.*` or `*.spec.*`, or inside a `__tests__/` directory, gets 1,500 lines. Helpers in `test/` or `tests/` directories (`test/helpers.ts`, `tests/setup.ts`) are not test files by this rule and get 800 lines like other source.
13
+ - **Which files are not counted**: every other extension. Stylesheets other than `.css` (`.scss`, `.less`), single-file components (`.vue`, `.svelte`), and `.json`, `.md`, `.html` and similar files have no budget. Generated or vendored sources with a counted extension can be excluded (see below).
14
+
15
+ ## Baseline
16
+
17
+ Files that were already over budget when the repository adopted od-harness are frozen in `.harness/size-baseline.json` at their line count:
18
+
19
+ ```json
20
+ { "files": { "studio/src/motion/game/GameStudio.tsx": 1603 } }
21
+ ```
22
+
23
+ `od-harness size` fails when:
24
+
25
+ - a file that is not in the baseline is over budget;
26
+ - a frozen file grew;
27
+ - a frozen file shrank, is back within budget, or was deleted, and the baseline was not tightened.
28
+
29
+ ## Commands
30
+
31
+ ```sh
32
+ od-harness size # check (CI)
33
+ od-harness size --update # tighten the baseline after files shrank; never raises or adds entries
34
+ od-harness size --init # adoption only: create the baseline from the current oversized files
35
+ ```
36
+
37
+ ## How to fix a failure
38
+
39
+ - **New file over budget**: split it into smaller modules by responsibility. New files cannot be added to the baseline.
40
+ - **Frozen file grew**: move the code you added, or more, into a new or existing module.
41
+ - **Baseline not tightened**: run `od-harness size --update` and commit `.harness/size-baseline.json`.
42
+ - **Frozen file moved or renamed**: run [`od-harness baseline move <old path> <new path>`](baseline-move.md) instead of `--update`, so the frozen size moves with the file; the file is then judged by the entry under its new path.
43
+
44
+ ## Exclusions
45
+
46
+ Generated or vendored sources can be excluded in `.harness/config.json` (owner review):
47
+
48
+ ```json
49
+ { "size": { "ignore": ["studio/src/generated/**"] } }
50
+ ```
51
+
52
+ Patterns are repo-relative: `dir/` matches a directory, globs support `**`, `*` and `?`. A file that is not valid JSON fails with exit code 2 and the parse error.
package/docs/unused.md ADDED
@@ -0,0 +1,76 @@
1
+ # od-harness unused
2
+
3
+ No new unused files, exports or dependencies. `od-harness unused --base <ref>` runs [knip](https://knip.dev) on the working tree and on the base commit (in CI: `"$HARNESS_BASE_REF"`, the PR base) and fails on findings the base does not have. Existing findings are tolerated; there is no baseline file.
4
+
5
+ ```text
6
+ od-harness unused --base <ref>
7
+ ```
8
+
9
+ Exit codes: 0 nothing new, 1 new findings (or a new tag that hides an export, below), 2 usage or environment error (an unknown ref, no `package.json`, knip failed or printed no report).
10
+
11
+ ## What counts
12
+
13
+ | knip issue type | Reported as |
14
+ | ------------------------------------------------------------- | ----------------- |
15
+ | `files` | unused file |
16
+ | `exports` | unused export |
17
+ | `dependencies`, `devDependencies`, `optionalPeerDependencies` | unused dependency |
18
+
19
+ Unused types, enum members, unlisted or unresolved imports and duplicate exports are not checked. These are the issue types of the maintainability report openmotion and opengame ran before, plus unused `devDependencies`, which knip reports in a field of its own.
20
+
21
+ A finding is identified by its type, its file (relative to the directory od-harness runs in) and its name; line numbers do not matter. A finding is new when the working tree has it more often than the base. Before comparing, every base finding of a file that git sees as renamed (`git diff --find-renames <base>`) moves to the new path, so moving a file or a directory keeps its findings. Locally, stage a move (`git mv` or `git add`) so that git sees it.
22
+
23
+ New findings are also those a change causes elsewhere: deleting the last import of an export makes that export a new unused export. Moving an unused export that the base already has into another file (not a file git sees as renamed) makes it new as well, since it is identified by its file: delete it instead of moving it.
24
+
25
+ ### Tags that hide exports
26
+
27
+ knip never reports an export whose comment has `@public`, `@beta` or `@alias` (knip's `isAlwaysIgnored`; no option turns it off). knip reads these tags in block comments, `/* … */` as well as `/** … */`, and in line comments on a line of their own (`// @public`, also indented); a line comment after code on its line does not count. Comments with only spaces, tabs and line breaks between them form a group, and a tag in any of them applies to the code that follows the group. Such a tag would take a new export out of this gate without review, so `od-harness unused` fails when the change adds or edits, in a JavaScript or TypeScript file:
28
+
29
+ - a comment with one of these tags, or
30
+ - the declaration such a comment documents: every line from the tagged comment to the line where the code after its group starts, up to the closing brace of a multi-line `export { … }` list. This catches a new export put under an existing tag, also with another comment in between.
31
+
32
+ Only comments count. od-harness finds them with the parser knip reads the tags with (oxc-parser, at the version knip depends on), so `/**` or `//` in a string, a template literal, a regular expression or JSX text opens no comment: a glob such as `"src/**"` or test data that holds `/** @public */` is not a tag.
33
+
34
+ Only files with the extensions `.js`, `.jsx`, `.mjs`, `.cjs`, `.ts`, `.tsx`, `.mts` and `.cts` are checked. Their changed lines come from `git diff --text <base>`, so a `-diff` or `binary` attribute in `.gitattributes` does not hide them. knip also reads tags in the scripts of files it compiles, such as `.vue` components in a repository that depends on Vue; a tag in such a file is not caught.
35
+
36
+ Tagged exports the change does not touch are left alone. Other tags do not hide an export in od-harness's run (knip 6.50.0: `@internal` outside production mode, `@knipignore`, `@lintignore`); a `tags` entry in the knip configuration that excludes a tag is an exemption like any other, reviewed by the owner.
37
+
38
+ ### Files that .gitignore excludes
39
+
40
+ knip does not analyse files that `.gitignore` excludes, also tracked ones (`git add -f`), so a file the change adds or edits there, or an existing file the change newly ignores, would escape the gate. `od-harness unused` lists the tracked JavaScript and TypeScript files that ignore rules exclude (`git ls-files --cached --ignored --exclude-standard`, which also reads `.git/info/exclude` and `core.excludesFile` locally) and fails when the change adds or edits one of them, or edits a `.gitignore` file anywhere in the repository. Fix: change the rule so it no longer matches the file, or add a `!path` exception after it, so knip analyses the file. A rule that excludes a parent directory (`dir/`) cannot be undone with `!path`, because git does not look inside an excluded directory: exclude its contents instead (`dir/*`), then add `!dir/file`. A file knip must not analyse is then excluded in the knip configuration (`ignore`, or `entry` if it runs on its own), which the owner reviews. The knip configuration alone does not exempt a file that `.gitignore` excludes: this check reads only the ignore rules, so the rule has to change as well.
41
+
42
+ ## Configuration
43
+
44
+ knip runs with the repository's own configuration (`knip.json`, `knip.jsonc`, `.knip.json`, `.knip.jsonc`, `knip.ts`, `knip.js`, `knip.config.ts`, `knip.config.js` or `package.json#knip`) in the directory od-harness runs in; without one, knip's defaults apply.
45
+
46
+ Both sides run with the working tree's configuration: od-harness copies the configuration files into the base checkout (and the `knip` field of `package.json`), so only code changes count. The change that adds the knip configuration (for example the adoption change) does not turn every existing finding into a new one, and a configuration change neither creates nor hides findings by itself. A `knip.ts` that imports other local files is copied alone.
47
+
48
+ The knip configuration is where exemptions live, so it belongs to the platform owner in CODEOWNERS.
49
+
50
+ ## How the base is analysed
51
+
52
+ The base commit is written to a temporary directory with a temporary git index (`git read-tree` and `git checkout-index`; the repository and its index are not touched, no hooks run, Git LFS objects stay pointers). Every directory that holds a tracked `package.json` and has `node_modules` in the working tree gets a link to it, so knip resolves packages and loads plugin configurations (Vite, Vitest, …) at the base with the dependencies CI installed for the head. knip needs those dependencies: without `node_modules` in the working tree, it cannot load such configuration files and fails (exit 2, "install the dependencies first"). In `gates.yml` the install step comes first.
53
+
54
+ When knip fails on the base with the head's dependencies, typically because the change removed a package that a configuration file of the base imports (a Vite plugin), od-harness removes the links and installs the base's own dependencies in the checkout from its lockfile, as the maintainability report's CI did with `npm ci --prefix <base dir>`: the nearest `pnpm-lock.yaml` (`pnpm install --frozen-lockfile --ignore-scripts`) or `package-lock.json` (`npm ci --ignore-scripts --no-audit --no-fund`) from the working directory up to the repository root. Then knip runs on the base once more, and the output says so. This fallback needs the network and takes as long as a frozen install of the base (about 2 s for a small project with a warm npm cache; a large repository takes as long as its CI install); it only runs when the first attempt failed. If the base still cannot be analysed, or has no lockfile, `unused` stops with exit 2 and says which: the knip configuration of the change is applied to the base too, so a configuration change the base cannot satisfy belongs in a change of its own.
55
+
56
+ ## How to fix a failure
57
+
58
+ The report lists the new findings per type, with a fix and the exemption for each:
59
+
60
+ - **Unused file**: import it where it is needed, or delete it. A file that runs on its own (a script, a worker, a configuration) is an entry point: add it to `entry` in the knip configuration (owner review).
61
+ - **Unused export**: delete the export, or the code, if nothing needs it, or import it where it is meant to be used. Do not export code for later. An export used where knip cannot see it goes into the knip configuration (`entry`, `ignore`, `ignoreExportsUsedInFile`), reviewed by the owner.
62
+ - **Tag that hides an export** (`@public`, `@beta`, `@alias`): remove the tag, then treat the export as above. These tags are not an exemption; the knip configuration is.
63
+ - **Tracked file that `.gitignore` excludes**: change the rule so it no longer matches the file, or add a `!path` exception (for a file in an excluded directory, exclude `dir/*` instead of `dir/`, then add `!dir/file`); then, if knip must not analyse the file, exclude it in the knip configuration. The knip configuration alone is not enough while `.gitignore` still excludes the file.
64
+ - **Unused dependency**: remove it from `package.json` and the lockfile, or import it. A dependency used where knip cannot see it goes into `ignoreDependencies` (owner review).
65
+
66
+ ## Why knip is a dependency of od-harness
67
+
68
+ knip and jscpd are `dependencies` of `@opendesignai/harness`, pinned exactly, not peer dependencies like Oxlint:
69
+
70
+ - only od-harness runs them, never the repository's own scripts, so nothing in the repository has to agree with their version;
71
+ - the comparison runs both sides with the same binary, and the three repositories get the same results from the same harness version;
72
+ - an upgrade of either tool is a harness release, tested here, instead of a change in every repository.
73
+
74
+ A repository that also runs knip itself can keep its own copy at any version; od-harness uses its own.
75
+
76
+ oxc-parser is a dependency for the same reason, pinned to the version knip depends on (a test checks that they match): `unused` reads comments with it, so the tags `unused` finds are the ones knip reads.
package/package.json CHANGED
@@ -1,6 +1,78 @@
1
1
  {
2
2
  "name": "@opendesignai/harness",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
3
+ "version": "0.2.0-alpha.0",
4
+ "description": "OpenDesign harness: od/* lint rules for Oxlint (ESLint plugin format), presets, file size budget, baseline ratchet and incremental duplication and unused-code gates",
5
+ "keywords": [
6
+ "eslint-plugin",
7
+ "harness",
8
+ "opendesign",
9
+ "oxlint"
10
+ ],
11
+ "homepage": "https://github.com/nexu-io/od-harness#readme",
12
+ "bugs": "https://github.com/nexu-io/od-harness/issues",
13
+ "license": "Apache-2.0",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/nexu-io/od-harness.git"
17
+ },
18
+ "bin": {
19
+ "od-harness": "./dist/cli.mjs"
20
+ },
21
+ "files": [
22
+ "dist",
23
+ "presets",
24
+ "docs",
25
+ "!docs/upstream"
26
+ ],
27
+ "type": "module",
28
+ "exports": {
29
+ ".": {
30
+ "types": "./dist/plugin.d.mts",
31
+ "default": "./dist/plugin.mjs"
32
+ },
33
+ "./presets/*": "./presets/*",
34
+ "./package.json": "./package.json"
35
+ },
36
+ "publishConfig": {
37
+ "access": "public",
38
+ "tag": "alpha"
39
+ },
40
+ "dependencies": {
41
+ "@eslint-community/eslint-plugin-eslint-comments": "4.8.1",
42
+ "jscpd": "5.4.3",
43
+ "knip": "6.50.0",
44
+ "oxc-parser": "0.160.0"
45
+ },
46
+ "devDependencies": {
47
+ "@od-harness/ts-eslint-parser": "0.0.0",
48
+ "@types/node": "26.6.11",
49
+ "@typescript-eslint/types": "8.74.0",
50
+ "eslint": "10.16.0",
51
+ "oxfmt": "0.81.0",
52
+ "oxlint": "1.96.0",
53
+ "tsdown": "0.23.8",
54
+ "typescript": "7.0.2",
55
+ "vitest": "5.1.2",
56
+ "yaml": "2.9.1"
57
+ },
58
+ "peerDependencies": {
59
+ "oxlint": "1.96.0"
60
+ },
61
+ "engines": {
62
+ "node": ">=22.18.0"
63
+ },
64
+ "scripts": {
65
+ "build": "tsdown",
66
+ "typecheck": "tsc -p .",
67
+ "test": "vitest run",
68
+ "lint": "oxlint --deny-warnings",
69
+ "format": "oxfmt",
70
+ "format:check": "oxfmt --check",
71
+ "knip": "knip",
72
+ "size": "node src/cli/index.ts size",
73
+ "smoke": "node scripts/smoke-pack.ts",
74
+ "trial": "node scripts/trial.ts",
75
+ "hit-compare": "node scripts/hit-compare.ts",
76
+ "check": "pnpm format:check && pnpm lint && pnpm size && pnpm build && pnpm typecheck && pnpm test && pnpm knip"
77
+ }
6
78
  }
@@ -0,0 +1,7 @@
1
+ {
2
+ "extends": ["./rules/base.json"],
3
+ "jsPlugins": [
4
+ { "name": "od", "specifier": "../dist/plugin.mjs" },
5
+ { "name": "eslint-comments", "specifier": "../dist/eslint-comments.mjs" }
6
+ ]
7
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": ["./rules/platform-boundary.json"],
3
+ "jsPlugins": [{ "name": "od", "specifier": "../dist/plugin.mjs" }]
4
+ }
@@ -0,0 +1,4 @@
1
+ {
2
+ "extends": ["./rules/product.json"],
3
+ "jsPlugins": [{ "name": "od", "specifier": "../dist/plugin.mjs" }]
4
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "plugins": ["react"],
3
+ "rules": {
4
+ "react/refs": "error",
5
+ "react/set-state-in-effect": "error",
6
+ "react/immutability": "error",
7
+ "react/preserve-manual-memoization": "error",
8
+ "react/purity": "error",
9
+ "react/use-memo": "error",
10
+ "react/incompatible-library": "error",
11
+ "react/static-components": "error"
12
+ }
13
+ }
@@ -0,0 +1,49 @@
1
+ {
2
+ "options": { "reportUnusedDisableDirectives": "error", "denyWarnings": true },
3
+ "plugins": ["eslint", "typescript", "unicorn", "oxc", "react"],
4
+ "categories": {
5
+ "correctness": "error"
6
+ },
7
+ "rules": {
8
+ "od/no-locale-branch": "error",
9
+ "od/no-raw-storage": "error",
10
+ "od/no-swallowed-catch": "error",
11
+ "od/no-raw-fetch": "error",
12
+ "od/no-api-path-literal": "error",
13
+ "od/no-window-bus": "error",
14
+ "od/no-process-env": "error",
15
+ "od/no-error-message-match": "error",
16
+ "od/no-cjk-literal": "error",
17
+ "od/no-constant-flag": "error",
18
+ "react/rules-of-hooks": "error",
19
+ "react/exhaustive-deps": "error",
20
+ "react/refs": "off",
21
+ "react/set-state-in-effect": "off",
22
+ "react/immutability": "off",
23
+ "react/preserve-manual-memoization": "off",
24
+ "react/purity": "off",
25
+ "react/use-memo": "off",
26
+ "react/incompatible-library": "off",
27
+ "react/static-components": "off",
28
+ "unicorn/no-abusive-eslint-disable": "error",
29
+ "eslint-comments/no-restricted-disable": [
30
+ "error",
31
+ "od/*",
32
+ "eslint-comments/*",
33
+ "rules-of-hooks",
34
+ "no-abusive-eslint-disable"
35
+ ]
36
+ },
37
+ "overrides": [
38
+ {
39
+ "files": [
40
+ "**/*.test.*",
41
+ "**/*.spec.*",
42
+ "**/__tests__/**",
43
+ "**/__fixtures__/**",
44
+ "**/fixtures/**"
45
+ ],
46
+ "rules": { "od/no-cjk-literal": "off" }
47
+ }
48
+ ]
49
+ }
@@ -0,0 +1,6 @@
1
+ {
2
+ "rules": {
3
+ "od/no-product-literal": "error",
4
+ "od/no-shell-imports-product": "error"
5
+ }
6
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "rules": {
3
+ "od/no-product-literal": "error"
4
+ }
5
+ }