Skip to content

feat(linter/eslint): implement id-denylist rule#24632

Open
baevm wants to merge 3 commits into
oxc-project:mainfrom
baevm:eslint/id-denylist
Open

feat(linter/eslint): implement id-denylist rule#24632
baevm wants to merge 3 commits into
oxc-project:mainfrom
baevm:eslint/id-denylist

Conversation

@baevm

@baevm baevm commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

this PR implements eslint/id-denylist, issue #479

@baevm

baevm commented Jul 17, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@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: 783e0006db

ℹ️ 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 on lines +48 to +50
array: Some(Box::new(ArrayValidation {
additional_items: Some(Box::new(r#gen.subschema_for::<String>())),
..Default::default()

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Require an array in the rule configuration schema

ArrayValidation alone does not constrain the instance type, so the generated configuration schema accepts non-array values such as "id-denylist": {} (all array keywords are ignored for objects), while TupleRuleConfig rejects them at runtime with “Expected array for rule configuration.” This leaves editor/schema consumers unable to flag invalid configs before Oxlint fails; set the schema object's instance type to Array (and ideally mirror ESLint's uniqueItems constraint).

Useful? React with 👍 / 👎.

@codspeed-hq

codspeed-hq Bot commented Jul 17, 2026

Copy link
Copy Markdown

Merging this PR will not alter performance

✅ 5 untouched benchmarks
⏩ 71 skipped benchmarks1


Comparing baevm:eslint/id-denylist (0e98b6d) with main (b1bcf72)

Open in CodSpeed

Footnotes

  1. 71 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.

#[derive(Debug, Default, Clone, Deserialize, Serialize)]
pub struct IdDenylist(Box<FxHashSet<String>>);

impl JsonSchema for IdDenylist {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

this rule uses weird config like this "id-denylist": ["error", "data", "err", "e", "cb", "callback"] without manually implementing JsonSchema it generates incorrect json config, i followed same pattern used by no-restricted-imports and no-restricted-properties

}

fn is_known_external_global(ident: &IdentifierReference, ctx: &LintContext) -> bool {
pub fn is_known_external_global(ident: &IdentifierReference, ctx: &LintContext) -> bool {

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

dont know if its ok to reexport some helpers like this if they’re only used in id-match and id-denylist, or if it’s better to create a helper file?

@baevm
baevm force-pushed the eslint/id-denylist branch from 46a8851 to 0e98b6d Compare July 19, 2026 15:08
@baevm
baevm marked this pull request as ready for review July 19, 2026 15:08
@baevm
baevm requested a review from camc314 as a code owner July 19, 2026 15:08
Copilot AI review requested due to automatic review settings July 19, 2026 15:08

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.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants