Skip to content

Instantly share code, notes, and snippets.

@skellock
Last active January 17, 2018 12:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save skellock/74328c256df9ab3e182e3d05a0dcb6fb to your computer and use it in GitHub Desktop.
Save skellock/74328c256df9ab3e182e3d05a0dcb6fb to your computer and use it in GitHub Desktop.
Showing a subset of directories in vscode 🤦‍♀️
{
"files.exclude": {
// ## WHATS THE DEAL?
//
// VS Code doesn't support:
//
// * glob negation pattern (like globs usually have)
// * `false` values that can opt out
// * a `files.include`
// * support for auto excluding .gitignore
// * or any other seamingly sane way to do "not" patterns
//
// ## CREDIT
//
// https://github.com/Microsoft/vscode/issues/869#issuecomment-298878442
//
// ## EXAMPLE
//
// Hide everything except:
//
// * node_modules/react-n*
// * node_modules/reacto*
// * node_modules/ax*
// * node_modules/api*
//
/**/"**/node_modules/[^ra]*": true,
/* */"**/node_modules/r[^e]*": true,
/* */"**/node_modules/re[^a]*": true,
/* */"**/node_modules/rea[^c]*": true,
/* */"**/node_modules/reac[^t]*": true,
/* */"**/node_modules/react[^o-]*": true,
/* */"**/node_modules/react-[^n]*": true,
/* */"**/node_modules/a[^xp]*": true,
/* */"**/node_modules/ap[^i]*": true,
/**/"**/node_modules/react": true,
//
// ## INDENT MUCH?
//
// I added extra indentation to help illustrate the "tree" we're
// trying to build. With a little more effort, we could totally make
// a sailboat eh?
}
}
@skellock
Copy link
Author

It's actually a .json file, not a .js file. GitHub doesn't like comments in .json files and gives us horribly angry red lines everywhere.

VS Code supports comments in .json files though, so you can copy & paste that files.exclude section.

@GantMan
Copy link

GantMan commented Jan 16, 2018

Rename the file to .json5
...
profit

@skellock
Copy link
Author

Huh. I had tried that in one of the revisions. It didn't look right... but it must have been me. Thanks!

@skellock
Copy link
Author

Ok, we're back to a jackson 5 file. Thx!

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