This is the prettier parser used to transform and clean the JavaScript output from LunaTea plugins. LunaTea plugins are written using the Haxe programming language, the compiled JavaScript can have minor style issues that need to be fixed with LunaTea Napkin.
-
Removes empty classes generated by Haxe or LunaTea
-
Changes bracket notation prototype access to dot notation, in both variable expressions and member expressions
-
Removes LunaTea modifications like the empty LTGlobals object access
-
Finally, it uses prettier's parser to clean the output following its opinionated code style.
npm install --save-dev @lunatechs/lunatea-napkin
By default LunaTea Napkin will convert all .js files in the dist
folder in the root of your project when you run it.
npx napkin
If you want to choose a custom directory, use the path argument
npx napkin --path=./game/js/plugins/
Sometimes you may only want to perform the transformation required after compiling a plugin with LunaTea.
npx napkin --no-pretty