Skip to content

fix: resolve categories in type-aware linting - #7

Merged
dannote merged 2 commits into
elixir-volt:masterfrom
romankurakin:fix/type-aware-categories
Sep 30, 2026
Merged

dannote merged 2 commits into
elixir-volt:masterfrom
romankurakin:fix/type-aware-categories

Conversation

@romankurakin

@romankurakin romankurakin commented Sep 15, 2026 •

Copy link
Copy Markdown
Contributor

OXC.Lint.run/2 forwards category names to tsgolint as individual rules. This prevents callers from using the same category-based configuration for syntax and type-aware checks.

Resolve categories through the bundled native rule registry before invoking tsgolint. Select rules from enabled plugins and preserve explicit rule options and severities. Apply all first, then categories, then individual rules, so explicit exclusions take precedence.

The existing OXC.Lint.run/2 interface remains unchanged. For example, rules: %{"correctness" => :deny} now selects type-aware correctness rules without requiring callers to list them individually.

Closes #6.

Copilot AI lite review requested due to automatic review settings September 15, 2026 16:40

Copilot AI 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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Rebased onto 0.18: the native registry orders filters and reports the
category-selected rules with typed severities.

Co-authored-by: Danila Poyarkov <dev@dannote.net>
@dannote
dannote force-pushed the fix/type-aware-categories branch from b882349 to ce5640e Compare September 30, 2026 06:23
@dannote

dannote commented Sep 30, 2026

Copy link
Copy Markdown
Member

Thanks, this is the right fix. I rebased it onto 0.18 and pushed to your branch; your commit keeps you as the author.

Changes from the original, to match 0.18's typed lint interface:

  • build_lint_config sorts filters (all, then categories, then rules) by their parsed LintFilterKind, so the ordering fix covers syntax linting without a category list on the Elixir side.
  • type_aware_rules takes and returns RuleSeverity values, and selects rules only when all or a category filter is present. That keeps the current behavior for configs that name rules individually.
  • Named typescript/* rules keep their options and still reach tsgolint when oxlint doesn't know them. There's a test for this.
  • The tests use 0.18's string plugin names and :error/:warning severities.

Callers such as Volt batch files by the type-aware rules each file
resolves to, without their own list of category names.
@dannote
dannote merged commit 9a85e13 into elixir-volt:master Sep 30, 2026
2 checks passed
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.

Category filters do not work with type-aware linting

3 participants