Skip to content

Conversation

@tlserver
Copy link

Since ESLint return the path in os format, so ignore regexp need to handle both \ and / as a separator. Consider this rule:

{
  regex: 'regA',
  files: {
    ignore: '^.*dirA/dirB/dirC/file\\.ts.*',
  },
},

It work on mac or linux, but not windows because ...\dirA\dirB\DirC\file.ts does not match ^.*dirA/dirB/dirC/file\\.ts.*. We need to change ignore regexp to ^.*dirA[\\\\/]dirB[\\\\/]dirC[\\\\/]file\\.ts.* in order to support windows also. It is hard to read and easy to forget when a developer is working on mac or linux.

Therefore, I created this PR. now regexp not only test for original path but also a "unified" path ( all \ are replaced to / ).

@gmullerb
Copy link
Owner

Ok, Got it! ✍️
I'll review your PR and add some tests.
Thank you so much! 🙏 👍

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants