Can't run typescript code with decorators

Viewed 696

I have this two simple files but every time I try to run the testClass.ts I get this error:

PS C:\Deno\pancakes> deno run testClass.ts
Compile file:///C:/Deno/pancakes/testClass.ts
error: TS1219 [ERROR]: 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.
    name: string;
    ~~~~
    at file:///C:/Deno/pancakes/testClass.ts:5:5

testClass.ts

import { notNull } from "./mod.ts";

class Person {
    @notNull
    name: string;

    constructor(name: string) {
        this.name = name;
    }
}

let newPerson = new Person("");

mod.ts

export function notNull(target: any, propertyKey: string) {
    console.log(target, propertyKey);
}

I have already enable the experimentalDecorators option in VSCode, create the tsconfig.json and everything but still can't run the program. I't doesn't show the error in VSCode but can't run.

Edit: this is what happens

1 Answers
Related