-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Description
Tell us about your environment
- ESLint Version: v6.8.0
- Node Version: v12.14.0
- npm Version: v6.13.4
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
Configuration
module.exports = {
parserOptions: {
ecmaVersion: 2015,
sourceType: "module"
},
};
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
/* eslint no-duplicate-imports: ["error", { "includeExports": true }] */
import foo from 'foo';
export * from 'foo';
import { a } from 'bar';
export * from 'bar';
import * as ns from 'baz';
export * from 'baz';
export { a as b } from 'quux';
export * from 'quux';
export { default } from 'quuux';
export * from 'quuux';
eslint index.js
What did you expect to happen?
I think no errors. The rule requires only 1 import/export statement per source module. I'm not sure how to rewrite any of these 5 examples to achieve that. Or any other code with export *
and another import/export from the same source, including the test case:
{
code: "import os from \"os\";\nexport * from \"os\";",
options: [{ includeExports: true }],
errors: [{ messageId: "exportAs", data: { module: "os" }, type: "ExportAllDeclaration" }]
}
If I'm not missing something, this rule should probably ignore export *
.
What actually happened? Please include the actual, raw output from ESLint.
Errors for all 5 export *
declarations:
4:1 error 'foo' export is duplicated as import no-duplicate-imports
7:1 error 'bar' export is duplicated as import no-duplicate-imports
10:1 error 'baz' export is duplicated as import no-duplicate-imports
13:1 error 'quux' export is duplicated no-duplicate-imports
16:1 error 'quuux' export is duplicated no-duplicate-imports
Are you willing to submit a pull request to fix this bug?
Yes.