Skip to content

feat: internal Rust napi parser + merge eslint-plugin-runner into @rslint/core#1035

Open
fansenze wants to merge 1 commit into
mainfrom
feat/eslint-parser-napi-20260530
Open

feat: internal Rust napi parser + merge eslint-plugin-runner into @rslint/core#1035
fansenze wants to merge 1 commit into
mainfrom
feat/eslint-parser-napi-20260530

Conversation

@fansenze
Copy link
Copy Markdown
Contributor

@fansenze fansenze commented May 30, 2026

Summary

Replaces @rslint/eslint-plugin-runner's npm parser + hand-written JS tokenizer with an internal Rust napi parser, and merges the runner into @rslint/core.

  • Parser — internal Rust napi crate: parse() → ESTree AST + parser-driven token stream + comments. The hand-written JS tokenizer is removed; visitorKeys are vendored.
  • Packaging — the parser binary ships in the per-platform subpackages alongside the Go CLI binary, resolved at runtime; @rslint/core depends on them.
  • Build & merge — runner src → src/eslint-plugin/, tests → tests/eslint-plugin/; removed @rslint/eslint-plugin-runner. A single rslib build covers both the library surface and the eslint-plugin worker (the worker bundles its ESLint-compat deps, so consumers need none). napi targets 3 → 8 + release CI matrix.

Related Links

N/A

Checklist

  • Tests updated (or not required).
  • Documentation updated (or not required).

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request replaces the hand-written JS tokenizer and the npm oxc-parser dependency with a new native Rust napi crate, crates/rslint-estree, which leverages oxc's parser-driven token stream. The former @rslint/eslint-plugin-runner package is merged directly into @rslint/core under packages/rslint/src/eslint-plugin. On the JS side, SourceCode now lazily rebuilds the token array from the columnar data sent from Rust. The review feedback highlights a bug in the language promotion logic where TypeScript definition files (.d.ts) are incorrectly promoted to .tsx when JSX is enabled, and suggests guarding against this by checking !st.is_typescript_definition().

Comment thread crates/rslint-native/src/parse.rs
@fansenze fansenze force-pushed the feat/eslint-parser-napi-20260530 branch from 31f590a to f32a009 Compare May 30, 2026 12:29
@fansenze fansenze changed the title feat: internal Rust napi parser (@rslint/estree) + merge eslint-plugin-runner into @rslint/core feat: internal Rust napi parser + merge eslint-plugin-runner into @rslint/core May 30, 2026
@fansenze fansenze force-pushed the feat/eslint-parser-napi-20260530 branch 22 times, most recently from cf3193b to 8b393ea Compare June 1, 2026 09:41
…lint/core

- Replace the npm parser + hand-written JS tokenizer with an internal Rust napi
  parser (ESTree AST + parser-driven tokens); visitorKeys vendored.
- Ship the parser binary in the per-platform subpackages next to the Go CLI
  binary, resolved at runtime; @rslint/core depends on them.
- Merge the runner into @rslint/core (src/eslint-plugin + tests/eslint-plugin);
  drop the @rslint/eslint-plugin-runner package.
- Single rslib build for both the library surface and the eslint-plugin worker
  (the worker bundles its ESLint-compat deps, so consumers need none).
- napi targets 3 -> 8 + release CI matrix.
@fansenze fansenze force-pushed the feat/eslint-parser-napi-20260530 branch from 8b393ea to 09cb991 Compare June 1, 2026 10:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant