Skip to content

feat(linter): add schema for eslint/no-restricted-imports#23040

Closed
Sysix wants to merge 1 commit into
06-06-feat_linter_add_schema_for_eslint_no-restricted-exports_from
06-06-feat_linter_add_schema_for_eslint_no-restricted-imports_
Closed

feat(linter): add schema for eslint/no-restricted-imports#23040
Sysix wants to merge 1 commit into
06-06-feat_linter_add_schema_for_eslint_no-restricted-exports_from
06-06-feat_linter_add_schema_for_eslint_no-restricted-imports_

Conversation

@Sysix

@Sysix Sysix commented Jun 6, 2026

Copy link
Copy Markdown
Member

No description provided.

Sysix commented Jun 6, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@codspeed-hq

codspeed-hq Bot commented Jun 6, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 61 skipped benchmarks1


Comparing 06-06-feat_linter_add_schema_for_eslint_no-restricted-imports_ (44d6bee) with 06-06-feat_linter_add_schema_for_eslint_no-restricted-exports_ (21615eb)2

Open in CodSpeed

Footnotes

  1. 61 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

  2. No successful run was found on 06-06-feat_linter_add_schema_for_eslint_no-restricted-exports_ (780362e) during the generation of this report, so 52a9908 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

@Sysix Sysix force-pushed the 06-06-feat_linter_add_schema_for_eslint_no-restricted-imports_ branch from f854976 to a61b9d4 Compare June 6, 2026 19:02
@Sysix Sysix force-pushed the 06-06-feat_linter_add_schema_for_eslint_no-restricted-exports_ branch 2 times, most recently from f08cbe1 to d1f2a9c Compare June 6, 2026 19:49
@Sysix Sysix force-pushed the 06-06-feat_linter_add_schema_for_eslint_no-restricted-imports_ branch 2 times, most recently from 3a0a87c to 8509b6a Compare June 6, 2026 20:00
@Sysix Sysix requested a review from Copilot June 6, 2026 20:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Adds a concrete configuration schema for the eslint/no-restricted-imports rule so it can be represented in the generated JSON schema (used by the website/docs) and the generated TypeScript config types.

Changes:

  • Replaces the no-restricted-imports placeholder (DummyRule) schema with an explicit anyOf schema covering severity-only and the supported option shapes.
  • Introduces new schema definitions (RestrictedPath, RestrictedPattern, NoRestrictedImportsConfig, etc.) and propagates them into the generated JSON snapshot and TS types.
  • Removes eslint/no-restricted-imports from the “unverified schema” skip list so its schema is emitted.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tasks/website_linter/src/snapshots/schema_json.snap Updates the schema snapshot to include the new no-restricted-imports schema and definitions.
npm/oxlint/configuration_schema.json Updates the published configuration JSON schema with the new rule schema/definitions.
crates/oxc_linter/src/utils/schemars.rs Stops treating eslint/no-restricted-imports as “schema not verified”.
crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs Adds schemars/serde scaffolding to describe the rule’s config schema and updates regex deserialization approach.
apps/oxlint/src-js/package/config.generated.ts Regenerates TS types to reflect the new schema definitions and rule option shapes.

Comment thread crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs
Comment thread crates/oxc_linter/src/rules/eslint/no_restricted_imports.rs
@Sysix Sysix force-pushed the 06-06-feat_linter_add_schema_for_eslint_no-restricted-imports_ branch from 8509b6a to 197cd4a Compare June 6, 2026 20:06
@graphite-app graphite-app Bot force-pushed the 06-06-feat_linter_add_schema_for_eslint_no-restricted-exports_ branch from d1f2a9c to 21615eb Compare June 6, 2026 21:33
@graphite-app graphite-app Bot force-pushed the 06-06-feat_linter_add_schema_for_eslint_no-restricted-imports_ branch from 197cd4a to 8d24cb1 Compare June 6, 2026 21:33
@graphite-app graphite-app Bot force-pushed the 06-06-feat_linter_add_schema_for_eslint_no-restricted-exports_ branch from 21615eb to 780362e Compare June 6, 2026 21:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-linter Area - Linter A-linter-plugins Area - Linter JS plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants