Skip to content

Lint categories do not enable type-aware rules #40

Description

@romankurakin

mix volt.js.check --type-aware runs type-aware rules only when they are named explicitly. Categories in config :volt, :lint affect syntax checks, but are removed before the type-aware runner receives the configuration.

As a result, a project using categories must also maintain a separate list of type-aware rules.

Environment

:volt 0.18.1, :oxc 0.17.8, Elixir 1.20.4, Erlang/OTP 29.

Example

With tsgolint installed and the source included in a TypeScript project:

config :volt, :lint,
  sources: ["assets/js/**/*.ts"],
  plugins: [:typescript],
  rules: %{"correctness" => :deny}
// assets/js/app.ts
Promise.resolve(1)
mix volt.js.check --type-aware

The category does not enable typescript/no-floating-promises. Adding "typescript/no-floating-promises" => :deny explicitly enables the check.

Expected behavior

Categories should select both syntax and type-aware rules when --type-aware is enabled. Individual rules and per-file overrides should still take precedence.

Proposed solution

Pass category filters and enabled plugins to OXC's type-aware runner after resolving each file's configuration. Category expansion belongs in OXC, which already contains the native rule registry.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions