Skip to content

ignore dotted files and folders#8484

Merged
zhengbli merged 2 commits into
microsoft:masterfrom
zhengbli:ignoreHiddenFiles
May 6, 2016
Merged

ignore dotted files and folders#8484
zhengbli merged 2 commits into
microsoft:masterfrom
zhengbli:ignoreHiddenFiles

Conversation

@zhengbli
Copy link
Copy Markdown

@zhengbli zhengbli commented May 5, 2016

Fix #6861

Comment thread src/compiler/commandLineParser.ts Outdated
// 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)) {
Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented May 5, 2016

👍

@zhengbli zhengbli merged commit d11ee08 into microsoft:master May 6, 2016
@zhengbli zhengbli deleted the ignoreHiddenFiles branch May 6, 2016 02:22
["/apath/test.ts", "/apath/.git/a.ts", "/apath/.b.ts", "/apath/..c.ts"],
["/apath/test.ts"]
)
})
Copy link
Copy Markdown
Contributor

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" ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Copy link
Copy Markdown
Contributor

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added at #8501

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants