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

Also test separator unified path #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

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 / ).

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.

1 participant