8000 GitHub - hshqwq/function-decorator-ts-plugin: A simple tsserver and ts-patch plugin that enables function decorators
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

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

License

Notifications You must be signed in to change notification settings

hshqwq/function-decorator-ts-plugin

< 10000 div>
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 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

Languages

  • TypeScript 100.0%
0