mix volt.lint (Volt v0.19.3)

Copy Markdown View Source

Lint project JavaScript and TypeScript assets using oxlint via NIF.

mix volt.lint

Scans all .js, .ts, .jsx, .tsx files under the configured :root directory (default: assets/).

Options

  • --plugin — enable an oxlint plugin (repeatable), such as react, unicorn, or jsx-a11y. Accepts the plugin names of an oxlint config file.

  • --fix — show fix suggestions in output

Configuration

Configure lint settings in config :volt, :lint:

config :volt, :lint,
  plugins: ["typescript", "react"],
  rules: %{
    "no-console" => :warn,
    "eqeqeq" => :deny,
    "typescript/no-explicit-any" => :warn
  },
  custom_rules: [
    {MyApp.NoConsoleLog, :warn}
  ],
  overrides: [
    %{
      files: ["colocated/**/*.js"],
      rules: %{"unicorn/filename-case" => :allow}
    }
  ]

Overrides are relative to the lint root and apply in order. They merge individual :rules, :env, and :globals entries; later matches win. Both lint commands share these settings. Plugins remain run-wide.