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:
- Created 6 years ago
- Comments:11 (8 by maintainers)
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
🤦♂️ 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
@j-f1 the proposal is specifically about a more convenient syntax for re-exporting
default
and has nothing to do with this issue.