Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!