Skip to content
This repository was archived by the owner on Oct 26, 2026. It is now read-only.

chore: parse rules with oxc-parser and drop TypeScript compiler installs - #43

Open
jan-kubica wants to merge 4 commits into
mainfrom
chore/typescript-toolchain-standard
Open

jan-kubica wants to merge 4 commits into
mainfrom
chore/typescript-toolchain-standard

Conversation

@jan-kubica

@jan-kubica jan-kubica commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

Summary

One type checker (bun check, already used by every workspace) and no TypeScript compiler in the published packages.

  • Rule parser: skillguard.js-ts-ast now parses with oxc-parser 0.155.0 instead of the TypeScript compiler API. The ESTree walker reproduces the previous traversal: destructuring-assignment defaults count as assignments, optional chains unwrap, JSX names and private member names resolve as before. @stll/skillguard-rules no longer depends on typescript.
  • Syntax errors: a JS/TS file that does not parse now yields one JSA10 scan-integrity finding (Medium) instead of a partial scan of whatever the tolerant parser recovered. The catalog documents the new pattern.
  • Declarations: tsdown builds with --dts.generator oxc, so no compiler is needed for .d.ts. That generator needs explicit export types: scanWithRecommendedRules is annotated, catalog entries use literal category and severity values, and RULE_CATALOG_BY_PATTERN is typed ReadonlyMap<RulePatternId, RuleCatalogEntry>, which also checks each entry's shape.
  • Toolchain: the check:typecheck-parity script, its CI step (and the change detector that gated it), the @typescript/native alias and the root typescript devDependency are removed: @stll/oxlint-config 2.0.0 reads the tsconfig projects for stll-toolchain-check without a TypeScript install, so no typescriptAllowlist entry is needed. The toolchain policy test now requires that no manifest declares a TypeScript compiler.
  • Shared tooling: @stll/oxlint-config 2.0.0, @stll/typescript-config 0.10.0, @stll/oxlint-plugin 0.6.3 and lefthook 2.2.2; the cloud setup and .github/dependabot.yml are regenerated and the actions/upload-artifact pin moves to the shared version. The shared TypeScript config now reports unreachable code, so the exhaustiveness checks after fully handled switches move into each switch's default clause (no behavior change).
  • Depends on chore: adopt Bun 1.4.4 and bun fmt #41: the remaining check:toolchain findings are the Bun 1.4.4 pins and the bun fmt formatter policy, which chore: adopt Bun 1.4.4 and bun fmt #41 adopts. After chore: adopt Bun 1.4.4 and bun fmt #41 lands, this branch takes main and the check passes.

Parity

The rule was run before and after the change over 30,493 real JavaScript/TypeScript files (this repository, a large TypeScript monorepo and its node_modules). Both runs produced 1,132 findings in 564 files, with every finding identical. The only difference was in the edited index.ts itself, where line numbers shifted. No corpus file had a syntax error under oxc-parser. A set of edge-case files (escaped identifiers, optional chains, destructuring defaults, JSX member tags, private names, script-mode with/octal/HTML comments, decorators, enums) also matched finding for finding. CLI scans of every fixture with --preset paranoid --format json are byte-identical. Scanning is faster: the rule over the full corpus no longer loads the TypeScript compiler.

Checks

check:toolchain, check:lockfile-versions, lint:ws, typecheck, lint, format:check, test, knip, build, intent:validate, pack:verify and scripts/tooling-adoption.test.ts pass. New tests cover the ESTree shapes above and the JSA10 finding.

The JavaScript/TypeScript AST rule now parses with oxc-parser 0.155.0
instead of the TypeScript compiler API. The ESTree walker reproduces the
previous traversal, including destructuring-assignment defaults, optional
chains, JSX names and private member names, so findings are unchanged on
valid input. Files with syntax errors now produce a JSA10 scan-integrity
finding instead of a partial scan.

Declarations build with tsdown's oxc generator, so exported values carry
explicit types and the catalog uses literal category and severity values.

The typecheck parity script, its CI step and the native TypeScript 7
alias are removed. The rules package no longer depends on typescript; the
root keeps typescript 7.0.2 only because stll-toolchain-check resolves its
tsc to list type-aware lint projects.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 25, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-26T06:37:48.784766Z 0867f26 New commits
🔒 Security Review ✅ Completed 2026-10-25T19:44:03.239814Z 811d2ae PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 811d2ae967

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread packages/rules/src/index.ts Resolved
A script with a syntax error produced only a medium JSA10 finding, which
the standard policy does not block, and its AST rules never ran. JSA10 is
now high severity, so an unanalyzable script fails the standard policy,
and the AST rules still run on the program oxc-parser recovers around the
error.
The toolchain check reads tsconfig projects without a TypeScript install,
so the root typescript devDependency goes, and the policy test and docs
now require that no manifest declares a TypeScript compiler. Bump
@stll/typescript-config to 0.10.0, @stll/oxlint-plugin to 0.6.3 and
lefthook to 2.2.2, regenerate the cloud setup and Dependabot config, and
move the upload-artifact pin to the shared version.
The shared TypeScript config now reports unreachable code, which flagged
the exhaustiveness checks after fully handled switches. Each check moves
into the switch default clause, so behavior is unchanged.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant