Skip to content

import/extensions: ignorePackages doesn't work in .mjs file #3217

@dynst

Description

@dynst

Adding this rule:

      "import/extensions": ["warn", "ignorePackages"],

In a .ts file, there's no warning for this, the package import is successfully ignored:

import prettier from "eslint-plugin-prettier/recommended";

But in eslint.config.mjs, the package import isn't ignored by the ignorePackages setting:

eslint.config.mjs
  4:22  warning  Missing file extension "ts" for "eslint-plugin-prettier/recommended"  import/extensions

Not sure why it's recommending .ts in a non-TypeScript file, either. (adding .js wouldn't work either here though - it would be an error, because there's no ./recommended.js export, just a ./recommended. #3189)

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