Skip to content
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

import/order reports different results on Windows vs Linux #1692

Closed
TitaneBoy opened this issue Mar 23, 2020 · 8 comments
Closed

import/order reports different results on Windows vs Linux #1692

TitaneBoy opened this issue Mar 23, 2020 · 8 comments

Comments

@TitaneBoy
Copy link

Hello there..

When running eslint on my code (on Windows 10 OS), I was at a point where I didn't have any eslint issue. But when I was running eslint on the same code (without any changes) on a "Linux" platform (in my case, it was "Ubuntu 18.04.3 LTS" through WSL), the result was different only for the rule "import/order". I got something like tens of errors, with the SAME code and without any changes

image

Here is my setup:

Versions:
NodeJS: v12.14.1
Platform: Windows 10 + Ubuntu 18.04.3 LTS on WSL
"eslint": "6.8.0",
"eslint-plugin-header": "3.0.0",
"eslint-plugin-import": "2.20.1",
"@typescript-eslint/eslint-plugin": "2.24.0",
"@typescript-eslint/parser": "2.24.0",

@ljharb
Copy link
Member

ljharb commented Mar 24, 2020

Is there any chance that git is automatically changing the line-ending characters? What are the exact chars in use in that file on each machine?

@TitaneBoy
Copy link
Author

@ljharb Thanks for your reply..

I've checked the line-ending characters format of files and initially, it was CRLF. I tried to changed it to LF for only 1 file and run again eslint on this file, on both Windows and Linux (WSL) and I have the same result on both platform: No eslint errors on Windows, but got 1 error on Linux, for the rule import/order... Tried on both Windows (With Visual Studio Code Powershell console) and Linux (Through WSL)

image

@waterfoul
Copy link

waterfoul commented Mar 24, 2020

I'm seeing the same thing except it wants to sort the local paths first in windows and last in linux. I would expect the linux behavior to be the case in both oses. I tried converting the line endings from LF to CRLF or CR and none of them made a difference

@crudh
Copy link

crudh commented Mar 24, 2020

We had the same problem. It seems to be fixed in master, but not released yet: #1643

I downgraded to 2.19.1 to avoid the issue until the next release is out.

@ljharb
Copy link
Member

ljharb commented Mar 24, 2020

Ah, ok - fixed by #1643 then. Thanks!

@ghost
Copy link

ghost commented Apr 4, 2020

I found that there are differences between mac and windows10. Will the latest version solve these problems?

@ljharb
Copy link
Member

ljharb commented Apr 4, 2020

@shx996 it should. if it doesn't, please file a new issue.

@caiokoiti
Copy link

Sorry guys!

This hasn't been fixed for macs, importing modules on macs are still inconsistent.

Running on mohave.
nodejs 12.18.2
"eslint": "^7.3.1"
"eslint-plugin-import": "^2.18.2"

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

No branches or pull requests

5 participants