TypeScriptToLua plugin that adds a statement to change local functions to nil
if you annotate them with @nullify
. This is only useful if you are using another plugin to inline the function, making the original function declaration redundant.
/**
* @nullify
*/
function foo() {
...
}
Becomes:
local function foo
...
end
foo = nil
Requires a modern version of TSTL. Tested on TSTL >= 1.22.0.
- Install this plugin
yarn add git+https://git@github.com/thinknathan/tstl-nullify-function.git#^1.0.0 -D
# or
npm install git+https://git@github.com/thinknathan/tstl-nullify-function.git#^1.0.0 --save-dev
- Add
tstl-nullify-function
totstl.luaPlugins
intsconfig.json
{
"tstl": {
"luaPlugins": [
+ { "name": "tstl-nullify-function" }
],
}
}
CC0