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-imports doesn't handle re-export #9678
Comments
The rule is supposed to only check |
|
@ilyavolodin, Because a re-export is essentially an import + export. So import {readFile} from 'fs';
export {readFile}; By ignoring re-exports you are leaving an escape hatch for @j-f1 I'm talking about ES2015 syntax; future proposals are out of scope. |
import foo from 'bar'
import { foo, bar as baz } from 'quux'
export const /* or let/var */ foo = 2
export {
foo as bar,
baz
}
export default foo
This is incorrect; see below. |
@j-f1 the proposal is specifically about a more convenient syntax for re-exporting |
🤦♂️ 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[?] |
@j-f1 There's no rush, but have you gotten a chance to take a look at this? |
I have not gotten a chance to look at this yet. |
I'll look at this. |
Linking to #11064. |
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.
The text was updated successfully, but these errors were encountered: