Skip to content

chore(lint): forbid value imports of tool packages in extension source - #16

Merged
fi3ework merged 2 commits into
mainfrom
chore-lint-restrict-tool-imports
Aug 18, 2026
Merged

chore(lint): forbid value imports of tool packages in extension source#16
fi3ework merged 2 commits into
mainfrom
chore-lint-restrict-tool-imports

Conversation

@fi3ework

Copy link
Copy Markdown
Member

Summary

Resolve-from-project (packages/vscode/AGENTS.md, adaptation #3) means extension source may only take types from @rslint/core, @rstest/core, rstack and jiti at compile time; the runtime modules are loaded from the user's project through explicit paths (the lint worker's --core directory, the rstest package lookup). Until now that was a convention only.

This adds @typescript-eslint/no-restricted-imports (allowTypeImports: true) over packages/vscode/src/**/*.ts in the root rstack.config.ts, so a static value import of any of those packages fails pnpm lint with a message pointing at the rule, while import type stays allowed. Dynamic import(pathToFileURL(...)) of project paths is unaffected. AGENTS.md notes the enforcement.

Verified: the current tree passes (65 rules, 0 errors); a probe file with import { CONFIG_DISCOVERY_PROTOCOL_VERSION } from '@rslint/core/config-loader' is reported and import type { Reporter } from '@rstest/core' in the same file is not.

Related Links

Checklist

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

Resolve-from-project (adaptation #3) means the extension may only take types
from @rslint/core, @rstest/core, rstack and jiti at compile time; runtime
modules are loaded from the user's project through explicit paths. Enforce it
with @typescript-eslint/no-restricted-imports (allowTypeImports) over
packages/vscode/src so a static value import fails lint instead of bundling or
require()-ing the wrong copy.

@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: 2e64427123

ℹ️ 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 rstack.config.ts
@fi3ework
fi3ework merged commit 06f0417 into main Aug 18, 2026
3 checks passed
@fi3ework
fi3ework deleted the chore-lint-restrict-tool-imports branch August 18, 2026 07:11
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