function-decorator-ts-plugin

0.1.2 • Public • Published

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

Readme

Keywords

none

Package Sidebar

Install

npm i function-decorator-ts-plugin

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

6.92 kB

Total Files

8

Last publish

Collaborators

  • exeteres