Skip to content

Docs: Improve consistency of require-meta-* rule violation messages #166

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/rules/require-meta-docs-url.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = {
}],
messages: {
mismatch: '`meta.docs.url` property must be `{{expectedUrl}}`.',
missing: 'Rules should export a `meta.docs.url` property.',
missing: '`meta.docs.url` property is missing.',
wrongType: '`meta.docs.url` property must be a string.',
},
},
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/require-meta-fixable.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ module.exports = {
},
schema: [],
messages: {
invalid: '`meta.fixable` must be either `code`, `whitespace` or `null`.',
missing: 'Fixable rules must export a `meta.fixable` property.',
invalid: '`meta.fixable` must be either `code`, `whitespace`, or `null`.',
missing: '`meta.fixable` must be either `code` or `whitespace` for fixable rules.',
},
},

Expand Down
4 changes: 2 additions & 2 deletions lib/rules/require-meta-has-suggestions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ module.exports = {
},
schema: [],
messages: {
shouldBeSuggestable: 'Suggestable rules should specify a `meta.hasSuggestions` property with value `true`.',
shouldNotBeSuggestable: 'Non-suggestable rules should not specify a `meta.hasSuggestions` property with value `true`.',
shouldBeSuggestable: '`meta.hasSuggestions` must be `true` for suggestable rules.',
shouldNotBeSuggestable: '`meta.hasSuggestions` cannot be `true` for non-suggestable rules.',
},
},

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-meta-schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ module.exports = {
},
],
messages: {
foundOptionsUsage: 'Found usage of rule options but no options are defined in `meta.schema`.',
foundOptionsUsage: '`meta.schema` has no schema defined but rule has options.',
missing: '`meta.schema` is required (use [] if rule has no schema).',
wrongType: '`meta.schema` should be an array or object (use [] if rule has no schema).',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-meta-type.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module.exports = {
schema: [],
messages: {
missing: '`meta.type` is required (must be either `problem`, `suggestion`, or `layout`).',
unexpected: '`meta.type` must be either `problem`, `suggestion` or `layout`.',
unexpected: '`meta.type` must be either `problem`, `suggestion`, or `layout`.',
},
},

Expand Down