2022-03-20 10:22:32 +08:00
|
|
|
local util = require 'lspconfig.util'
|
2021-10-05 15:13:10 +08:00
|
|
|
|
2022-03-20 10:22:32 +08:00
|
|
|
return {
|
2021-10-05 15:13:10 +08:00
|
|
|
default_config = {
|
2024-06-13 08:44:55 +08:00
|
|
|
cmd = { 'stylelint-lsp', '--stdio' },
|
2021-10-05 15:13:10 +08:00
|
|
|
filetypes = {
|
|
|
|
'css',
|
|
|
|
'less',
|
|
|
|
'scss',
|
|
|
|
'sugarss',
|
|
|
|
'vue',
|
|
|
|
'wxss',
|
|
|
|
'javascript',
|
|
|
|
'javascriptreact',
|
|
|
|
'typescript',
|
|
|
|
'typescriptreact',
|
|
|
|
},
|
|
|
|
root_dir = util.root_pattern('.stylelintrc', 'package.json'),
|
|
|
|
settings = {},
|
|
|
|
},
|
|
|
|
docs = {
|
2024-06-13 08:44:55 +08:00
|
|
|
package_json = 'https://raw.githubusercontent.com/bmatcuk/coc-stylelintplus/master/package.json',
|
2021-10-05 15:13:10 +08:00
|
|
|
description = [[
|
|
|
|
https://github.com/bmatcuk/stylelint-lsp
|
|
|
|
|
|
|
|
`stylelint-lsp` can be installed via `npm`:
|
|
|
|
|
|
|
|
```sh
|
|
|
|
npm i -g stylelint-lsp
|
|
|
|
```
|
|
|
|
|
|
|
|
Can be configured by passing a `settings.stylelintplus` object to `stylelint_lsp.setup`:
|
|
|
|
|
|
|
|
```lua
|
|
|
|
require'lspconfig'.stylelint_lsp.setup{
|
|
|
|
settings = {
|
|
|
|
stylelintplus = {
|
|
|
|
-- see available options in stylelint-lsp documentation
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
|
|
|
]],
|
|
|
|
default_config = {
|
|
|
|
root_dir = [[ root_pattern('.stylelintrc', 'package.json') ]],
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|