-
Notifications
You must be signed in to change notification settings - Fork 12.4k
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
ignore dotted files and folders #8484
Conversation
@@ -716,7 +716,8 @@ namespace ts { | |||
} | |||
|
|||
// Skip over any minified JavaScript files (ending in ".min.js") | |||
if (/\.min\.js$/.test(fileName)) { | |||
// Skip over dotted files and folders as well | |||
if (/\.min\.js$/.test(fileName) || /[\\/]\.[\w.]/.test(fileName)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider combining into one regex, and hosting it as a variable declaration outside the function call to avoid creating a new literal every time the function is called.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also can you add a unit test. something along the lines of https://github.com/Microsoft/TypeScript/blob/master/tests/cases/unittests/convertCompilerOptionsFromJson.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
👍 |
["/apath/test.ts", "/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"], | ||
["/apath/test.ts"] | ||
) | ||
}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Shouldn't there be a test "allow dotted files and folders when explicitly requested" ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zhengbli can you add a test for this please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added at #8501
Fix #6861