-
Notifications
You must be signed in to change notification settings - Fork 71
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
Some side-effect imports are not autofixable #34
Comments
Hi! I pasted those imports quickly into a project that uses eslint-plugin-simple-import-sort and their order was preserved. What am I missing? There must be something different in your environment. Could you please make a reproduction repo? Try to remove stuff until it doesn’t happen anymore etc. |
Weird, let me continue to dig into further...thanks for the quick reply! |
Here's a repro: https://github.com/izhan/eslint-plugin-simple-import-sort-repro. Running Interestingly, deleting any line in |
Thanks!
|
Ah crap...
Looks like stable sorting was released in Node v12+ (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort). Updating to v12.13.1 solved this issue for me. Should we change the minimum Node version for this repo? https://github.com/lydell/eslint-plugin-simple-import-sort#development Or perhaps just implement a stable sort for |
Good catch! I think we should support Node 10. It might be as easy as changing eslint-plugin-simple-import-sort/src/sort.js Line 779 in 15ad031
|
Released in v5.0.1. |
Hi there - first off, thank you for creating this project!
We are having autofix issues when running
eslint --fix
on this particular set of side-effect imports:Expected behavior:
Actual behavior:
If I find an easier repro, I'll include it. Happy to also help dig into this further when I have a chance. Cheers.
The text was updated successfully, but these errors were encountered: