question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

no-restricted-imports doesn't handle re-export

See original GitHub issue
  • ESLint Version: 4.12.1
{
    "parserOptions": {
        "ecmaVersion": 6,
        "sourceType": "module"
    },
    "rules": {
        "no-restricted-imports": ["error", "fs"]
    }
}
import fs from 'fs';
export * from 'fs';
export {default as fs} from 'fs';
export {readFile} from 'fs';

What did you expect to happen? All the statements including re-exports should be reported as errors.

What actually happened? Please include the actual, raw output from ESLint.

  1:1  error  'fs' import is restricted from being used  no-restricted-imports

Only import is reported; re-exports are ignored.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:11 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
j-f1commented, Dec 2, 2017

🤦‍♂️ sorry. Thanks for sharing that with me! I must’ve misread the proposals I linked to. I’ll take a look at this and see if I can fix it.

Notes to self: rule source, copy-paste[?] ImportDeclaration to "ExportAllDeclaration, ExportNamedDeclaration". ExportAll -> isRestrictedForEverythingImported, ExportNamed -> isRestrictedPath

1reaction
asapachcommented, Dec 2, 2017

@j-f1 the proposal is specifically about a more convenient syntax for re-exporting default and has nothing to do with this issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

no-restricted-imports - ESLint - Pluggable JavaScript Linter
This rule allows you to specify imports that you don't want to use in your application. It applies to static imports only, not...
Read more >
How to make ESLint error when import is any of package ...
I have the following ESLint rule. This disallows MyImport1 and MyImport2 of being imported from my-package . "no-restricted-imports": ["warn", ...
Read more >
Reexports and Offshore Transactions - BIS.doc.gov
Guidance on Reexports/Transfers (in-country) of U.S.-Origin Items or Non-U.S.-made Items Subject to the Export Administration Regulations ...
Read more >
Know the import and export laws and regulations
You can find basic information on importing to and exporting from the United ... tax programs for exporters, such as Canada's Non-Resident Importer...
Read more >
U.S. Export Controls - International Trade Administration
The U.S. participates in various multilateral export control regimes to prevent the ... The EAR does not regulate transactions involving all U.S. goods, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found