@r3ps4j/tstl-external-no-self
v1.0.2
Published
Plugin for TSTL which adds the noSelfInFile tag to external libraries
Downloads
3
Readme
TSTL External No Self
Plugin for TypeScriptToLua which allows you to put the @noSelfInFile
in external libraries.
Installation
Install the package from npm:
npm i -D @r3ps4j/tstl-external-no-self
Add the plugin to your
tsconfig.json
:{ "tstl": { "luaPlugins": [ { "name": "@r3ps4j/tstl-external-no-self" } ] } }
Define which libraries (or files) to add
@noSelfInFile
to:{ "tstl": { "luaPlugins": [ { "name": "@r3ps4j/tstl-external-no-self", "targets": [ "@somescope/somelibrary", // Works "somelibrary/file.d.ts" // Also works ] } ] } }
Credits
Credits go to Perry van Wesel, most of the code from this package comes from his comment within issue #1489 on TypeScriptToLua's repository. I only added the logic for specifying libraries.
Contributing
Pull requests are much appreciated! If you think you can improve this package, please open a pull request and I will look at it as soon as possible.