Ole
Ole

Reputation: 46940

VSCode Experimental Support for Decorators Warning When Trying to Create New Module

I just installed Angular 10 and upgraded VSCode to the latest.

When creating a new module:

import { NgModule } from '@angular/core';

const mm = []

@NgModule({
    imports: [ ...mm ],
    exports: [...mm
    ],
    providers: [     
    ]
})
export class MaterialModule {

}

This decorator error is created:

class MaterialModule
Experimental support for decorators is a feature that is subject to change in a future release. Set the 'experimentalDecorators' option in your 'tsconfig' or 'jsconfig' to remove this warning.ts(1219)

And it is only created for the new module. The existing app.module.ts is error free...so it's a bit confusing.

Thoughts? enter image description here

Upvotes: 1

Views: 605

Answers (2)

Sunny Goel
Sunny Goel

Reputation: 2132

Add this line in your tslint.config to avoid this lint error.

"experimentalDecorators": true

and also checked the enable experimental decorator option in visual studio setting like belowenter image description here

Hope it will help.

Upvotes: 6

Ole
Ole

Reputation: 46940

I uninstalled and reinstalled "Angular Language Support" in VSCode and that did the trick.

Upvotes: 0

Related Questions