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

Already on GitHub? Sign in to your account

ESLint no-redeclare error, when using ES6 modules #269

Open
hpohlmeyer opened this Issue Nov 14, 2016 · 0 comments

Comments

Projects
None yet
1 participant

Quick, short summary:
When using ES6 Modules, ESLint throws a "module is allready defined (no-redeclare)" error, if one module is imported in multiple modules with the same path name.

Checking the same files manualy does not return an error.

Expected results:
CodeKit should throw the same report I get, when use ESLint from the CLI.

Actual results:
An error gets thrown.

Exact steps to reproduce:

  1. Create a main file, a module file and a submodule file
  2. Import the module file in the main file
  3. Import the submodule in the main file and the module file (the syntax has to be the same)
  4. Check the sytanx of the main file with CodeKit

A link to download a simplified project or file that shows the issue:
module_test.zip

Example project instructions

  1. Terminal: cd to the project
  2. Terminal: run npm install
  3. CodeKit: open the project
  4. CodeKit: check syntax of main.js (errors)
  5. Terminal: run node_modules/eslint/bin/eslint.js submodule.js module.js main.js (no errors)

Additional information
I realized, that I don’t get an error, when I put my modules in a subfolder. I think the reason for that is, that the filepaths of the imports differ.

I also noticed, that CodeKit does not go up the whole import tree and only performs syntax checking on the direct import of the checked file. (In my project submodule never gets checked) But that may be a case for another bug report.

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