I am getting the following error in VSCode whenever I open my workspace.
To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on.
Source: TypeScript and Javascript Language Feat... [BUTTON: CONFIGURE EXCLUDES]
I click the Configure Excludes
button on the message and it opens the following file
FRONTENDAPP/jsconfig.json
{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]}
It looks to me that is configured correctly according to the documentation below. : https://code.visualstudio.com/docs/languages/javascript
So why the error all the time?
My Workspace is setup as follows:
FOLDER: NOTES
FOLDER: FRONTENDAPP
FOLDER: BACKENDAPP
Each folder as a jsconfig.json
file.
The respective file in the NOTES and BACKENDAPP is the same and looks as follows:
{"compilerOptions":{"target":"es6","experimentalDecorators":true},"exclude":["node_modules","bower_components","tmp","vendor",".git","dist"]}
To enable project-wide JavaScript/TypeScript language features, exclude large folders with source files that you do not work on. Source: TypeScript and Javascript Language Feat... [BUTTON: CONFIGURE EXCLUDES] I click the Configure Excludes button on the message and it opens the following file FRONTENDAPP/jsconfig.json
There is some terminology you’ll frequently see in error messages that is helpful to understand. TypeScript considers a type assignable to another type if one is an acceptable substitute for the other.
Because its type system is structural, this often means providing somewhat lengthy descriptions of where it found a problem. There is some terminology you’ll frequently see in error messages that is helpful to understand. TypeScript considers a type assignable to another type if one is an acceptable substitute for the other.
The approach is called “wrapping exceptions”, because we take “low level” exceptions and “wrap” them into ReadError that is more abstract. It is widely used in object-oriented programming. We can inherit from Error and other built-in error classes normally. We just need to take care of the name property and don’t forget to call super.
I had the same issues and I realized:
node_modules
in subfoldersdist
(like dist1
, dist2
) for debugging, which where gitignored but not vscode ignored..npm
and .npm-tmp
folders with a lot of stuff inside.dist
I also had another tmp folder .app-cache
.I ended up with the following entry in /jsconfig.json
(slightly redundant for readability) to make the warning go away:
"exclude": [
".git",
".app-cache",
".npm",
".npm-tmp",
"dist",
"dist*",
"node_modules",
"subfolder/dist",
"subfolder/node_modules",
"**/dist/*",
"**/node_modules/*",
]
}
Identify folders with lots of files:
du -a | cut -d/ -f2 | sort | uniq -c | sort -nr
162114 node_modules
5837 .git
4967 concat-stats-for
443 app
77 tests
72 dist
8 config
7 public
Check folders that aren't excluded in jsconfig.json
for JS and TS files
find concat-stats-for -type f | sed -e 's/.*\.//' | sort | uniq -c | sort -n | grep -Ei '(js|ts)$'
42 ts
3003 js
If the folder isn't App code, add said folder to jsconfig.json
exclude.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With