Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

182
Visualizações
Decorators must precede the name and all keywords of property declarations

I created a decorator called @Inject in typescript file, like this

export class A{
    @Inject()
    private b!: string

    @Inject()
    private c!: string
}

But vscode told me there was a mistake

export class A{
    @Inject()
    private b!: string

    @Inject() //error : Decorators must precede the name and all keywords of property declarations.
    private c!: string
}

But when I execute the TSC command, the terminal does not display any errors.

The strangest thing is that when I end with a semicolon, the error disappears.

export class A{
    @Inject()
    private b!: string ;

    @Inject()
    private c!: string ;
}
over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

you must to change version typescript in visual studio code. for me version typescript is 4.3.2

over 4 years ago · Santiago Trujillo Relatório

0

You need to search after your Typescript version and change it to your current workspace version instead of the vscode typescript version which is currently a dev verison.

First search after >Typescript: Version

enter image description here

Than you can selest the current workspace verison

enter image description here

You also can click on the bottom right corner on the typscript version and change it to your current workspace version.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda