Skip to content

Declaration expected when using decorators #35910

@warpdesign

Description

@warpdesign
  • VSCode Version: 1.41.1
  • OS Version: OSX 10.15.2

Steps to Reproduce:

  1. add experimentalDecorators: true to tsconfig.json
  2. Use a decorator in a .js file

Here is the contents of my jsconfig.json:

{
    "compilerOptions": {
      "allowSyntheticDefaultImports": false,
      "experimentalDecorators": true,
      "baseUrl": ".",
      "paths": {
        "$src/*": ["./src/*"],
        "$config/*": ["./config/*"]
      }
    },
    "exclude": ["node_modules", "dist"]
  }

image

Example code with decorator:

import { authRequired } from './$src/authRequired';

const service = {
   @authRequired
   getPrice() {
       //...
   }
}

Does this issue occur when all extensions are disabled?: Yes

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions