uhyo / eslint-plugin-import-access

https://www.npmjs.com/package/eslint-plugin-import-access
MIT License
355 stars 9 forks source link

fix bug check package incorrect on Windows #15

Closed nguyentringhia closed 10 months ago

nguyentringhia commented 10 months ago

Because the exporter (decl.getSourceFile().fileName) always has slashes (/) in the path regardless of the OS. Ex: Mac: /Users/project/src/pages/A/B/C/D/name.tsx Win: D:/project/src/pages/A/B/C/D/name.tsx

Therefore, it is necessary to hardcode the slash character (/) in the regex to get the correct result on the Windows environment.