Proposal: introduce "suggested" #246
Andarist
started this conversation in
Specification
Replies: 2 comments 2 replies
-
But isn't |
Beta Was this translation helpful? Give feedback.
2 replies
-
If someone wants to suggest creating an object with certain properties, then that whole object should have a "default" that includes the suggested property. For example: {
type: "object",
default: { "strict": true }
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
At the moment "default" is used by IDE autocompletions (it's even labeled~ in the VS Code with "A default value. Used by suggestions.", I couldn't quickly find where the text of this tooltip comes from though).
However, there are times when the better value should be preferred by suggestions. A default can't always be immediately changed because of compatibility reasons.
The prominent case for this is the
compilerOptions.strict
in thetsconfig.json
: https://json.schemastore.org/tsconfig.json . The likelihood of somebody wanting to usestrict: false
is very low - it's highly recommended to usestrict: true
and I suspect that most people adding this property to theirtsconfig.json
want that value. It would be cool if the JSON schema would support this use case - changing thedefault
in this schema, without changing the runtime default wouldn't be semantically correct.Beta Was this translation helpful? Give feedback.
All reactions