-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
import check breaks when exported objects contain spread #49
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
Comments
To make it easier for you to reproduce, I've put the files in a Gist you can download: https://gist.github.com/chase/a2da4eee17a14278ec33 I also included a non-spread version that returns no issues when running:
|
I think it's likely because Espree won't parse spread, and while you've got ESLint configured to use Babel instead, you have to add the If you add "settings": { "import/parser": "babel-eslint" } ...to your |
Sure enough that did the trick, I must be daft for missing it... what with that being mentioned in the README. Thanks again! |
No worries. I would much rather have the top-level parser be the source of truth for the plugin parser as well, but as of yet I haven't found a way to get at it. |
One change breaks something else with linting error so to test first change must fix next change, which breaks more stuff by the time we finally get rid of linting errors, we've changed SOO much ALL the problems revolve around: export * from 'somewhere' import {something} from 'somewhere' -> import something from 'somewhere' import {default as something} from 'somewhere' Read docs from following pages but still don't understand - VERY confusingly written: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/export https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import https://esdiscuss.org/topic/import-statements-destructuring babel/babel#3049 http://www.thedreaming.org/2017/04/28/es6-imports-babel/ babel/babel-loader#194 https://stackoverflow.com/questions/4832829/import-javascript-file-from-within-javascript-synchronously babel/babel#4996 https://github.com/benmosher/eslint-plugin-import/blob/master/docs/rules/prefer-default-export.md import-js/eslint-plugin-import#49 microsoft/TypeScript#2440 https://stackoverflow.com/questions/33505992/babel-6-changes-how-it-exports-default/33506169#33506169
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Here's a strange little edge case I just bumped into.
If any exported object contains a spread of another exported object,
import/named
andimport/namespace
breaks.package.json
dependencies:eslintrc
:test1.js
contains:test2.js
contains:Running local ESLint:
Outputs:
The text was updated successfully, but these errors were encountered: