-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathformat.lua
29 lines (27 loc) · 991 Bytes
/
format.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
local eslint = {
lintCommand = 'eslint_d -f unix --stdin --stdin-filename ${INPUT}',
lintIgnoreExitCode = true,
lintStdin = true,
lintFormats = { '%f:%l:%c: %m' },
formatCommand = 'eslint_d --fix-to-stdout --stdin --stdin-filename=${INPUT}',
formatStdin = true,
}
local clang_format = { formatCommand = 'clang-format -style=LLVM ${INPUT}', formatStdin = true }
local prettier = { formatCommand = 'prettier --stdin-filepath ${INPUT}', formatStdin = true }
local stylua = { formatCommand = 'stylua -s -', formatStdin = true }
local black = { formatCommand = 'black --quiet -', formatStdin = true }
return {
-- cpp = { clang_format },
css = { prettier },
html = { prettier },
javascript = { prettier, eslint },
javascriptreact = { prettier, eslint },
json = { prettier },
lua = { stylua },
markdown = { prettier },
python = { black },
scss = { prettier },
typescript = { prettier, eslint },
typescriptreact = { prettier, eslint },
yaml = { prettier },
}