Skip to content

A simple tsserver and ts-patch plugin that enables function decorators

License

Notifications You must be signed in to change notification settings

Exeteres/function-decorator-ts-plugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Function Decorator TypeScript Plugin

A simple tsserver and ts-patch plugin that enables function decorators.

Installation

npm i function-decorator-ts-plugin -D
# or
yarn add function-decorator-ts-plugin -D

Usage

It is assumed that you will use ts-patch instead of ttypescript.

Just add this plugin to tsconfig.json:

{
    "compilerOptions": {
        "plugins": [{
            "name": "function-decorator-ts-plugin",
            "transform": "function-decorator-ts-plugin/transformer",
            "transformProgram": true
        }]
    }
}

If you use VSCode, you may need to switch the typescript version to local one by adding this setting in .vscode/settings.json:

{
    "typescript.tsdk": "node_modules\\typescript\\lib"
}

Limitations

  • Decorated functions are not hoisted
  • There is no type cheсking in decorator expressions

About

A simple tsserver and ts-patch plugin that enables function decorators

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published