Skip to content

chore: rename default export n - #556

Merged
aladdin-add merged 2 commits into
eslint-community:masterfrom
regseb:patch-1
Aug 8, 2026
Merged

chore: rename default export n#556
aladdin-add merged 2 commits into
eslint-community:masterfrom
regseb:patch-1

Conversation

@regseb

@regseb regseb commented Jul 29, 2026

Copy link
Copy Markdown

What is the purpose of this pull request?

When importing the default export, it's recommended to use the same name as the exported variable (cf. import-x/no-rename-default).

The variable name exported by eslint-plugin-n is plugin. With the following file:

import n from "eslint-plugin-n";

export default [
    {
        plugins: { n },
        extends: ["n/recommended-module"],
    }
];

ESLint and import-x/no-rename-default report this error:

Caution: index.js has a default export plugin. This imports plugin as n. Check if you meant to write import plugin from 'eslint-plugin-n' instead.

What changes did you make? (Give an overview)

With this pull request, we will be able to use the name n

Comment thread lib/index.js

/** @type {ESLint.Plugin & { configs: Configs }} */
const plugin = Object.assign(base, { configs })
const n = Object.assign(base, { configs })

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a comment to explain this, so it doesn’t get changed during future refactoring?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a comment.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"permissions": [
"webRequest"
]

@aladdin-add
aladdin-add merged commit d499fc1 into eslint-community:master Aug 8, 2026
12 checks passed
@regseb
regseb deleted the patch-1 branch August 24, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants