prettier-language-server 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +74 -0
- package/package.json +30 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Artur Kenzhaev
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
# prettier-language-server
|
|
2
|
+
|
|
3
|
+
## Features
|
|
4
|
+
|
|
5
|
+
The idea of this language server is to be as simple and fast as possible,
|
|
6
|
+
and the set of the features is quite limited.
|
|
7
|
+
|
|
8
|
+
- Out of the box Range Formatting
|
|
9
|
+
- Doesn't provide diagnostics, only formatting
|
|
10
|
+
- Resolves and caches the prettier config based on the workspace folder
|
|
11
|
+
|
|
12
|
+
## Requirements
|
|
13
|
+
|
|
14
|
+
- node.js >=13.2
|
|
15
|
+
|
|
16
|
+
## Installation
|
|
17
|
+
|
|
18
|
+
```sh
|
|
19
|
+
npm i -g prettier-language-server
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Neovim Language Server Configuration
|
|
23
|
+
|
|
24
|
+
<details>
|
|
25
|
+
<summary>lua/lspconfig/configs/prettierls.lua</summary>
|
|
26
|
+
|
|
27
|
+
```lua
|
|
28
|
+
local root_file = {
|
|
29
|
+
'.prettierrc',
|
|
30
|
+
'.prettierrc.json',
|
|
31
|
+
'.prettierrc.yml',
|
|
32
|
+
'.prettierrc.yaml',
|
|
33
|
+
'.prettierrc.json5',
|
|
34
|
+
'.prettierrc.js',
|
|
35
|
+
'prettier.config.js',
|
|
36
|
+
'.prettierrc.mjs',
|
|
37
|
+
'prettier.config.mjs',
|
|
38
|
+
'.prettierrc.cjs',
|
|
39
|
+
'prettier.config.cjs',
|
|
40
|
+
'.prettierrc.toml',
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return {
|
|
44
|
+
default_config = {
|
|
45
|
+
cmd = { 'prettier-language-server' },
|
|
46
|
+
filetypes = {
|
|
47
|
+
'javascript',
|
|
48
|
+
'javascriptreact',
|
|
49
|
+
'typescript',
|
|
50
|
+
'typescriptreact',
|
|
51
|
+
'vue',
|
|
52
|
+
'css',
|
|
53
|
+
'scss',
|
|
54
|
+
'less',
|
|
55
|
+
'html',
|
|
56
|
+
'json',
|
|
57
|
+
'jsonc',
|
|
58
|
+
'yaml',
|
|
59
|
+
'markdown',
|
|
60
|
+
'markdown.mdx',
|
|
61
|
+
'graphql',
|
|
62
|
+
'handlebars',
|
|
63
|
+
},
|
|
64
|
+
root_dir = function(fname)
|
|
65
|
+
local util = require('lspconfig.util')
|
|
66
|
+
|
|
67
|
+
root_file = util.insert_package_json(root_file, 'prettier', fname)
|
|
68
|
+
return util.root_pattern(unpack(root_file))(fname)
|
|
69
|
+
end,
|
|
70
|
+
},
|
|
71
|
+
}
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
</details>
|
package/package.json
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "prettier-language-server",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.0.1",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=13.2.0"
|
|
7
|
+
},
|
|
8
|
+
"engineStrict": true,
|
|
9
|
+
"publishConfig": {
|
|
10
|
+
"access": "public"
|
|
11
|
+
},
|
|
12
|
+
"files": ["bin/prettier-language-server"],
|
|
13
|
+
"bin": "./bin/prettier-language-server",
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build:node": "bun ./build/node.ts"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"prettier": "^3.4.2",
|
|
19
|
+
"vscode-languageserver": "^9.0.1",
|
|
20
|
+
"vscode-languageserver-textdocument": "^1.0.12",
|
|
21
|
+
"vscode-uri": "^3.0.8"
|
|
22
|
+
},
|
|
23
|
+
"devDependencies": {
|
|
24
|
+
"@biomejs/biome": "^1.9.4",
|
|
25
|
+
"@types/bun": "latest"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"typescript": "^5.0.0"
|
|
29
|
+
}
|
|
30
|
+
}
|