npmtypescript95% confidence\u2191 541

Experimental decorators warning in TypeScript compilation

Full error message
I receive the warning...

  Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option `to remove this warning.

... even though my compilerOptions in tsconfig.json have the following settings:

"emitDecoratorMetadata": true,
"experimentalDecorators": true,

What is weird is that some random classes that use decorators do not show that warning but the rest in the same project do.

What could cause such behavior in the TypeScript compiler?

Although VS Code is a great editor for TypeScript projects, it needs a kick every now and again. Often, without warning, certain files cause it to freak out and complain. Mostly the fix seems to be to save and close all open files, then open tsconfig.json. After that you should be able to re-open the offending file without error. If it doesn't work, lather, rinse, and repeat. If your tsconfig.json specifies its source files using the files array, IntelliSense will only function correctly if the file in question is referenced such that VS Code can find it by traversing the input file tree. Edit: The 'reload window' command (added ages ago now) should solve this problem once and for all.

API access

Get this solution programmatically \u2014 free, no authentication.

curl https://depscope.dev/api/error/d8cdf17ad495d2306edf38b14258cfabf9bb0c76d4b39fff64f30b359fe9890c
hash \u00b7 d8cdf17ad495d2306edf38b14258cfabf9bb0c76d4b39fff64f30b359fe9890c
Experimental decorators warning in TypeScript compilation — DepScope fix | DepScope