Skip to content

Commit 3e67aff

Browse files
committed
feat: add autocompletion to more fields in package.json
feat: add basic json schema for pnpm prop in package.json (and link to docs!)
1 parent c3c6c25 commit 3e67aff

File tree

2 files changed

+84
-1
lines changed

2 files changed

+84
-1
lines changed

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,13 @@
112112
"when": "resourcePath =~ /node_modules/"
113113
}
114114
]
115-
}
115+
},
116+
"jsonValidation": [
117+
{
118+
"fileMatch": "package.json",
119+
"url": "./resources/package-json.schema.json"
120+
}
121+
]
116122
},
117123
"type": "commonjs",
118124
"capabilities": {

resources/package-json.schema.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
{
2+
"$schema": "http://json-schema.org/draft-07/schema",
3+
"properties": {
4+
"version": {
5+
"defaultSnippets": [
6+
{
7+
"body": "0.0.0-dev"
8+
},
9+
{
10+
"body": "0.0.0-development"
11+
},
12+
{
13+
"body": "0.0.1"
14+
}
15+
]
16+
},
17+
"license": {
18+
"defaultSnippets": [
19+
{
20+
"body": "MIT"
21+
}
22+
]
23+
},
24+
"main": {
25+
"defaultSnippets": [
26+
{
27+
"body": "build/index.js"
28+
}
29+
]
30+
},
31+
"types": {
32+
"defaultSnippets": [
33+
{
34+
"body": "build/index.d.ts"
35+
}
36+
]
37+
},
38+
"scripts": {
39+
"properties": {
40+
"build": {
41+
"type": "string"
42+
}
43+
}
44+
},
45+
"pnpm": {
46+
"type": "object",
47+
"markdownDescription": "[pnpm docs](https://pnpm.io/package_json)",
48+
"properties": {
49+
"overrides": {
50+
"type": "object",
51+
"additionalProperties": {
52+
"type": "string"
53+
}
54+
},
55+
"packageExtensions": {
56+
"type": "object"
57+
},
58+
"peerDependencyRules": {
59+
"type": "object",
60+
"properties": {
61+
"ignoreMissing": {
62+
"type": "array"
63+
},
64+
"allowedVersions": {
65+
"description": "Unmet peer dependency warnings will not be printed for peer dependencies of the specified range.",
66+
"type": "object"
67+
}
68+
}
69+
},
70+
"neverBuiltDependencies": {
71+
"type": "object",
72+
"description": "This field allows to ignore the builds of specific dependencies. The \"preinstall\", \"install\", and \"postinstall\" scripts of the listed packages will not be executed during installation."
73+
}
74+
}
75+
}
76+
}
77+
}

0 commit comments

Comments
 (0)