ABuffSeagull / eslint-import-resolver-parcel

Parcel import resolution plugin for eslint-plugin-import
MIT License
12 stars 2 forks source link

Endless loop on Windows #62

Closed EEP-Benny closed 3 years ago

EEP-Benny commented 3 years ago

I tried to use this package on a Windows machine. After installing and enabling it, when I run eslint, nothing happens - the command hangs with a high CPU usage.

I investigated a bit and found out that findAliases ran into an endless loop. This is probably because the posix-specific commands of Nodes path API are used. On a Windows machine, this results in the following values for the variables defined in line 9 and 10:

currentPath: 'C:\Projekte\myproject',
packagePath: 'C:\Projekte\myproject/C:\Projekte\myproject/package.json'

Obviously such a file doesn't exist, no matter how much .. are appended.

I replaced the posix-specific with the normal commands (path.posix.xyz -> path.xyz in the compiled source), and everything worked again for me. Is there a special reason why the posix-specific commands are used?

ABuffSeagull commented 3 years ago

Apparently I misunderstood how the paths work in Node.js. For whatever reason I thought that path.posix would translate the paths into Posix for you, since I like those a bit better, but I guess not :laughing: Easy enough fix, thanks for letting me know!