Commit fa8f77e
committed
feat(eslint-plugin-runner): new package for ESLint plugin compatibility runtime
Adds @rslint/eslint-plugin-runner as a self-contained npm package. The
runner runs unmodified ESLint plugin rules inside Node worker_threads
spawned by a future host (CLI / LSP server). No upstream caller in this
PR — package can be imported and used independently.
Surface
- WorkerPool: queued task model, per-task SharedArrayBuffer cancel flag,
worker_threads lifecycle (spawn / respawn-on-crash / shutdown drain),
per-task timeout + terminate path
- LintWorker entry: imports user rslint configs directly, extracts live
plugin instances per configDirectory, dispatches lint tasks by
configKey
- ESLint v10 surface fills: Rule.Context, SourceCode (lazy tokens +
getDisableDirectives), scope-manager / visitor-keys integration,
oxc-parser preserveParens:false to match espree
- Tokenizer (tokenizer.ts + tokenizer-jsx.ts): JS / TS lexer with
paren/brace context tracking, Unicode-escape identifiers, regex /
template / private-identifier scans. JSX is opt-in via
TokenizeOptions.jsx — separate state machine in tokenizer-jsx.ts
emits JSXIdentifier / JSXText / Punctuator per espree's contract;
TSX disambiguation rejects generic shapes (`<T,>`, `<T extends X>`,
`<T>(…)`) from JSX entry
- IPC client: framed protocol for the future host's reverse-RPC
- compat-task-builder: pure helpers projecting LSP/CLI wire shapes to
internal lint tasks
Tests
- 336 tests across 18 files, all pass standalone:
- worker-pool-e2e: queue model, cancel, timeout/respawn, shutdown
drain, postMessage failure modes, multi-worker mid-respawn race
- context-api / source-code / scope-factory / normalize-ast /
listener-merge / plugin-loader / cancel-flag / ipc-client /
language-options / lazy-cache / compat-task-builder
- regression-coverage: behavior-pinning tests across the v10
compatibility surface — disable-directive line/block carrier
contract, drain semantics under multi-worker respawn (including
mid-init crash), fix() result validation (array/iterable/string),
tokenizer regex-vs-division context tracking, Unicode-escape
identifiers, BOM stripping, unified bare+esquery specificity
dispatch, TS scope globalReturn + commonjs parity, .mts/.cts JSX
promotion, interpolate.js message template parity,
getInlineConfigNodes / getDisableDirectives line-vs-block +
label-boundary rules, boundary token getters returning null,
options deep-clone, init failure-on-any-rejection, getIndexFromLoc
throwing on invalid / out-of-range loc
- jsx-tokenizer: 72 espree-oracle differential tests covering basic
elements, attributes (name-only / string / expression / spread),
JSXText, dotted / namespaced / hyphenated names, nesting,
fragments, expression containers, template-literal interaction,
`<` disambiguation (comparison / shift / TSX generics), and
non-JSX regression
Build
- Standalone: \`pnpm --filter @rslint/eslint-plugin-runner build && test\`
- ESM-only ("type": "module"), runtime deps: @typescript-eslint/{scope-manager,
visitor-keys}, oxc-parser; devDep: espree (test oracle); peerDep: jiti1 parent d67ae07 commit fa8f77e
66 files changed
Lines changed: 20966 additions & 91 deletions
File tree
- .github/workflows
- packages/eslint-plugin-runner
- src
- ast
- lexer
- jsx
- linter
- plugin
- source-code
- tests
- ast
- fixtures
- cfgA
- cfgB
- cfgX
- cfgY
- lexer
- linter
- plugin
- source-code
- scripts
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
155 | 155 | | |
156 | 156 | | |
157 | 157 | | |
| 158 | + | |
158 | 159 | | |
159 | 160 | | |
160 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
| 16 | + | |
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
0 commit comments