Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[no-restricted-exports] Fails on export { default } from ... #2500

Open
milesj opened this issue Nov 10, 2021 · 3 comments
Open

[no-restricted-exports] Fails on export { default } from ... #2500

milesj opened this issue Nov 10, 2021 · 3 comments

Comments

@milesj
Copy link

@milesj milesj commented Nov 10, 2021

As the title states. Fails when re-exporting the default from another module.

export { default } from 'another-module';

This feels like it should pass, since this is not a named export. https://github.com/airbnb/javascript/blob/master/packages/eslint-config-airbnb-base/rules/es6.js#L67

@ljharb
Copy link
Collaborator

@ljharb ljharb commented Nov 10, 2021

You're right, it definitely should be acceptable. This seems like a bug in eslint itself, given https://eslint.org/docs/rules/no-restricted-exports#default-exports

Can you file that on eslint?

@patcon
Copy link

@patcon patcon commented Feb 17, 2022

Filed! :) eslint/eslint#15617

@tincho
Copy link

@tincho tincho commented Jul 28, 2022

just FTR, a quick workaround for me was adding

        "no-restricted-exports": ["error", {
          "restrictedNamedExports": [
            "then"
          ]
        }],

to rules object in my .eslintrc.json file

it would have been quicker to just add

        "no-restricted-exports": "off"

but I just wanted to remove the default keyword and keep the rest of the restricted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants