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

"exclude" with glob does not exclude folders #12750

Closed
timocov opened this issue Dec 8, 2016 · 4 comments
Closed

"exclude" with glob does not exclude folders #12750

timocov opened this issue Dec 8, 2016 · 4 comments
Assignees
Labels
Bug A bug in TypeScript VS Code Tracked There is a VS Code equivalent to this issue

Comments

@timocov
Copy link
Contributor

timocov commented Dec 8, 2016

TypeScript Version: 2.1.4 / nightly (2.2.0-dev.20161208)

Steps to reproduce:

  1. Create empty folder and install TypeScript 2.1.4 (or @next)
mkdir test && cd test
npm install typescript@2.1.4
  1. Create empty tsconfig.json
./node_modules/.bin/tsc --init
  1. Add "exclude" to tsconfig.json like this:
"exclude": ["**/node_modules"]
  1. Create empty ts file:
touch test.ts
  1. Run the compiler
./node_modules/.bin/tsc

Expected behavior:
Compile successfully.

Actual behavior:
A lot of errors in node_modules/typescript folder

The same source code compiles fine on TypeScript 2.1.1.

More tests:
If I change "exclude" to ["node_modules"] the compilation passes without errors. But if I place "node_modules" in a sub-folder it is not excluded neither by ["node_modules"] nor by ["**/node_modules"] and it leads to errors during the compilation.

@mhegazy
Copy link
Contributor

mhegazy commented Dec 8, 2016

use "exclude": ["**/node_modules/*"] instead.

@mhegazy mhegazy added Help Wanted You can do this Bug A bug in TypeScript labels Dec 8, 2016
@mhegazy mhegazy added this to the Community milestone Dec 8, 2016
@timocov
Copy link
Contributor Author

timocov commented Dec 8, 2016

@mhegazy Thanks!

@wclr
Copy link

wclr commented Dec 11, 2016

Created this #12824 to find out which behaviour is consistent and it should be documented carefully.

@mjbvz mjbvz added the VS Code Tracked There is a VS Code equivalent to this issue label Jul 14, 2017
@mjbvz mjbvz marked this as a duplicate of microsoft/vscode#30498 Jul 14, 2017
@mjbvz
Copy link
Contributor

mjbvz commented Jul 25, 2017

@rbuckton We've seen a number of reports of this issue on the VSCode side. I'm planning to update our documentation to use the "exclude": ["**/node_modules/*"] pattern

Can we please look into this for TS 2.5 as well

mjbvz added a commit to microsoft/vscode-docs that referenced this issue Jul 25, 2017
@rbuckton rbuckton modified the milestones: TypeScript 2.5, Community Aug 4, 2017
@rbuckton rbuckton removed the Help Wanted You can do this label Aug 4, 2017
@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
Bug A bug in TypeScript VS Code Tracked There is a VS Code equivalent to this issue
Projects
None yet
Development

No branches or pull requests

6 participants