Skip to content

feat(vscode): lint bridged folders from rstack.config via a generated shim - #10

Draft
fi3ework wants to merge 1 commit into
mainfrom
feat-vscode-lint-rstack-bridge
Draft

feat(vscode): lint bridged folders from rstack.config via a generated shim#10
fi3ework wants to merge 1 commit into
mainfrom
feat-vscode-lint-rstack-bridge

Conversation

@fi3ework

Copy link
Copy Markdown
Member

What

A workspace folder whose only lint signal is a root rstack.config.* now lints through the Rstack config. The extension writes a generated shim into the project (node_modules/.cache/rstack-editor/rslintConfig.mjs) that loads the config through rstack's published rstack/config export with the absolute config path baked in, and pins that folder's language server to the shim through the optional configPath of rslint/configRefresh (config-discovery protocol 2, added by web-infra-dev/rslint#1630).

  • Ownership stays folder-level: one native rslint.config.* anywhere in the folder and the bridge yields entirely. Only a folder-root rstack.config.* bridges (the explicit-config choice is fixed per server process, one server per folder, cwd = folder root). A mode flip restarts the server through the coordinator's existing replacement path.
  • Capability gate: bridged mode requires the project's @rslint/core/config-loader to report protocol >= 2. Below that (every released version today) the folder reports a version mismatch naming the resolved version — never crashed, since @rslint/core reaches such projects only as rstack's transitive dependency.
  • Native mode stays byte-identical to upstream: the configPath key is simply absent and the server keeps doing its own discovery. Every bridge line in the ported Rslint.ts sits inside paired --- rstack config bridge --- markers (adaptation refactor(vscode): split tests out of src into sibling tests/ and e2e/ trees #7 in AGENTS.md).

Why draft

No released @rslint/core speaks protocol 2 yet (latest 0.7.3 is protocol 1; rslint#1630 is merged but unreleased). The E2E bridge suite therefore asserts the gate path end to end against 0.7.3, and carries the explicit-mode happy path behind a runtime skip that unlocks when a protocol-2 release ships. Plan: when that release lands, bump the fixture, watch the skipped suite go live, and mark this ready for review.

Test plan

  • pnpm lint — 0 errors, 0 type errors
  • pnpm test:unit — 260 tests, 0 failures (bridge rule/shim/gate covered as pure units)
  • Full E2E chain (smoke / vscode / rstest / lint) green, including the new Rstack config bridge suite asserting the gate behavior against today's @rslint/core

… shim

A workspace folder with no native rslint.config.* and an rstack.config.*
at its root now lints through the Rstack config: the extension writes a
generated shim (loadRstackConfig with the absolute config path baked in,
lint section default-exported) and pins the language server to it through
the optional configPath of rslint/configRefresh (config-discovery
protocol 2, rslint PR web-infra-dev/rslint#1630).

Bridged mode is gated on the capability, not a version guess: the
project's @rslint/core/config-loader must report protocol >= 2. Below
that (every released version today) the folder reports a version
mismatch naming the resolved version instead of starting a half-bridge,
and never reports crashed - @rslint/core reaches such projects only as
rstack's transitive dependency. Ownership stays folder-level: one native
config anywhere and the bridge yields; a mode flip restarts the server
through the coordinator's replacement path, since the explicit-config
choice is fixed for a server process.

The E2E bridge suite asserts the gate path against today's @rslint/core
0.7.3 and carries the explicit-mode happy path behind a runtime skip
that unlocks when a protocol-2 release ships.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant