8000 linter: eslint-plugin-import(extensions) false positives with non configured extensions · Issue #11818 · oxc-project/oxc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
linter: eslint-plugin-import(extensions) false positives with non configured extensions #11818
Open
@drvn-mr

Description

@drvn-mr

What version of Oxlint are you using?

1.2.0

What command did you run?

oxlint -c .oxlintrc.json test.ts

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

{
  "env": {
    "browser": true,
    "node": true
  },
  "plugins": [
    "import"
  ],
  "rules": {
    "import/extensions": [
      "error",
      "ignorePackages",
      {
        "js": "never",
        "ts": "never"
      }
    ]
  }
}

What happened?

Non configured extensions are detected as errors when present instead of being ignored.
With ESLint and eslint-plugin-import, there are no errors when the import extensions are not present in the config.

Code

import { Something } from './something.hooks';
import SomeComponent from './SomeComponent.vue';

Something
SomeComponent

oxlint output

oxlint -c .oxlintrc.json test.ts

  × eslint-plugin-import(extensions): File extension "vue" should not be included in the import declaration.
   ╭─[test.ts:2:1]
 1 │ import { Something } from './something.hooks';
 2 │ import SomeComponent from './SomeComponent.vue';
   · ────────────────────────────────────────────────
 3 │ 
   ╰────
  help: Remove the file extension from this import.

  × eslint-plugin-import(extensions): File extension "hooks" should not be included in the import declaration.
   ╭─[test.ts:1:1]
 1 │ import { Something } from './something.hooks';
   · ──────────────────────────────────────────────
 2 │ import SomeComponent from './SomeComponent.vue';
   ╰────
  help: Remove the file extension from this import.

Found 0 warnings and 2 errors.
Finished in 9ms on 1 file with 53 rules using 8 threads.

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

      0