plugin-lua
plugin-lua copied to clipboard
Prettier Lua Plugin (WIP)
Prettier [sets](https://prettier.io/docs/en/options.html) `useTabs` to `false` and `tabWidth` to `2` by default, yet it is [changed](https://github.com/prettier/plugin-lua/blob/master/src/index.js#L59-L62) to `true` and `4` in this plugin. Is there any reason for this?
Input: ``` function x:PosToAbsolute( x, y ) return ( x - 1 ) * self.width, ( y - 1 ) * self.height end ``` Output: ``` function x:PosToAbsolute( x, y...
Current output: ``` if variable == some.nested.object and variable2 == another.object or variable == another.object and variable2 == some.nested.object then return end ``` Expected something like that: ``` if variable...
I don't want the comments to be moved around, is there any way to disable this?
Based on https://github.com/prettier/plugin-php/pull/1359.
Not at simple as jumping to prettier 2.1 ;) These are the comments from the commits below for some context on where this PR is currently at: luaparse 3.0 now...
There seems to be a bug when a conditional returns "end" it would break the parser. ```lua if condition then return "end" end ``` See https://github.com/danielpza/plugin-lua/commit/8a4c013f72c6692166070acb3d9982eb4c729175
Input: ```lua if foo then -- Run bar bar() else -- Run baz baz() end ``` Output: ```lua if foo then -- Run bar bar() -- Run baz else baz()...
Currently when a file is formatted no blank newline is added to the end, it should be added.
current output ```lua local variable = call_something_that_is_kind_of_long(with_some_long, arguments_that_are_long) ``` expected output ```lua local variable = call_something_that_is_kind_of_long( with_some_long, arguments_that_are_long ) ```