Skip to content

Commit 1c64c55

Browse files
Update package.json
Insert default value for each predefined key if selected. Also improve validation (currently only visible when editing JSON directly). Aim is to reduce the chance of people defining destructive mappings. Yellow warning squiggles will show in JSON, with details on hover and in Problems panel.
1 parent ee4cf54 commit 1c64c55

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -755,27 +755,27 @@
755755
"%(.*)": "_$1"
756756
}
757757
],
758-
"patternProperties": {
759-
".*": {
760-
"type": "string"
761-
}
762-
},
763-
"properties": {
764-
"%(.*)": {
765-
"description": "Catch any % items. Set value to `_$1` to replace `%` prefix with `_`",
766-
"type": "string",
767-
"examples": [
768-
"_$1"
769-
]
770-
},
771-
"(.*)": {
772-
"description": "Match everything. Set value to `$1` to leave unchanged",
773-
"type": "string",
774-
"examples": [
775-
"$1"
776-
]
777-
}
778-
}
758+
"patternProperties": {
759+
"\\(.*\\)": {
760+
"type": "string",
761+
"pattern": "\\$1"
762+
}
763+
},
764+
"properties": {
765+
"%(.*)": {
766+
"description": "Catch any % items. Set value to `_$1` to replace `%` prefix with `_`",
767+
"type": "string",
768+
"pattern": "\\$1",
769+
"default": "_$1"
770+
},
771+
"(.*)": {
772+
"description": "Match everything. Set value to `$1` to leave unchanged",
773+
"type": "string",
774+
"pattern": "\\$1",
775+
"default": "$1"
776+
}
777+
},
778+
"additionalProperties": false
779779
},
780780
"objectscript.export.atelier": {
781781
"description": "Export source code as Atelier did it, with packages as subfolders.",

0 commit comments

Comments
 (0)