Skip to content

linter: 0.11.0+ broke import/no-unassigned-import "allow" option #12949

@KieranP

Description

@KieranP

What version of Oxlint are you using?

0.11.1

What command did you run?

oxlint

What does your .oxlintrc.json config file look like?

{
  "$schema": "./node_modules/oxlint/configuration_schema.json",
  "ignorePatterns": ["/node_modules", "/dist", "/*.{js,ts}"],
  "plugins": ["eslint", "oxc", "typescript", "import", "promise", "unicorn"],
  "categories": {
    "correctness": "error",
    "nursery": "error",
    "pedantic": "error",
    "perf": "error",
    "restriction": "error",
    "style": "error",
    "suspicious": "error"
  },
  "rules": {
    "import/no-unassigned-import": ["error", { "allow": ["*.css"] }],
  }
}

What happened?

Prior to 0.11.0, I used to get 0 errors. Now I get this, even though css files shouldn't be assigned.

› yarn lint

  × eslint-plugin-import(no-unassigned-import): Imported module should be assigned
   ╭─[src/main.ts:1:1]
 1 │ import './reset.css'
   · ────────────────────
 2 │ import './global.css'
   ╰────
  help: Consider assigning the import to a variable or removing it if it's unused.

  × eslint-plugin-import(no-unassigned-import): Imported module should be assigned
   ╭─[src/main.ts:2:1]
 1 │ import './reset.css'
 2 │ import './global.css'
   · ─────────────────────
 3 │ 
   ╰────
  help: Consider assigning the import to a variable or removing it if it's unused.

Found 0 warnings and 2 errors.
Finished in 26ms on 13 files using 12 threads.

Seems related to this change:

78c311c

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions