Skip to content

docs(lint): add pages for oxc-correctness rule ports#3378

Open
bartlomieju wants to merge 1 commit into
mainfrom
oxlint-port-oxc-rule-docs
Open

docs(lint): add pages for oxc-correctness rule ports#3378
bartlomieju wants to merge 1 commit into
mainfrom
oxlint-port-oxc-rule-docs

Conversation

@bartlomieju

Copy link
Copy Markdown
Member

Adds lint/rules documentation pages for the oxc-correctness batch of oxlint
rule ports. These accompany the rule work in denoland/deno_linterasing-op
is implemented (denoland/deno_lint#1521) and the rest are documented ahead of
their ports so the spec and the docs land together.

Pages added:

  • erasing-op
  • const-comparisons
  • double-comparisons
  • bad-char-at-comparison
  • bad-comparison-sequence
  • bad-min-max-func
  • bad-object-literal-comparison
  • bad-replace-all-arg
  • bad-array-method-on-arguments
  • missing-throw
  • number-arg-out-of-range
  • only-used-in-recursion
  • uninvoked-array-callback

Each follows the existing rule-page format (front-matter tags, a description,
and Invalid/Valid examples) and the sidebar picks them up automatically via
lint/_data.ts. Content is grounded in the upstream oxc rule definitions, with
one correction: bad-replace-all-arg documents that a non-global regex passed
to replaceAll throws a TypeError (per the spec), rather than oxc's
description that only the first match is replaced.

The pages are tagged recommended, matching oxc's correctness classification.
If the rules ship opt-in instead, the front-matter tag should be dropped to
match — this tracks the same on-by-default decision as the rules themselves.

Note: a few of these pages describe rules that are not yet implemented in
deno_lint, so the corresponding /lint/rules/<name> entries will appear in the
sidebar before the rules are released.

Adds documentation pages for the oxc-correctness batch of oxlint rule
ports: erasing-op (implemented in denoland/deno_lint#1521) plus the
remaining bucket (const-comparisons, double-comparisons,
bad-char-at-comparison, bad-comparison-sequence, bad-min-max-func,
bad-object-literal-comparison, bad-replace-all-arg,
bad-array-method-on-arguments, missing-throw, number-arg-out-of-range,
only-used-in-recursion, uninvoked-array-callback).

Pages follow the existing lint/rules format and are tagged recommended,
matching oxc's correctness classification (subject to the same on-by-default
decision as the rules themselves).
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