-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Rule: no-incomplete-schema
#296
Labels
Comments
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
or named
require-meta-schema-completeness
.This could also potentially be part of eslint-plugin/require-meta-schema but that's probably too much in one rule.
This rule would check for common useless / no-op schemas as discussed in eslint/rfcs#85 (comment) such as:
{}
{ type: "array" }
And ensure:
additionalProperties: false
to ensure all properties are includeduniqueItems: true
for arraysminItems: 1
for arraysBut the challenge is encouraging completeness while still allowing rules to have any valid schema / options format.
There's also strict mode in ajv that is related and that we could take ideas from to enforce. If ESLint ever upgraded ajv, like in the declined ajv v8 upgrade PR, it's worth considering enabling strict mode.
There are also a few other linters targeting JSON Schema:
The text was updated successfully, but these errors were encountered: