Skip to content
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

Breaking: Add meta.hasSuggestions property to meta-property-ordering rule #119

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 docs/rules/meta-property-ordering.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ This rule enforces that meta properties of a rule are placed in a consistent ord

This rule has an array option:

* `['type', 'docs', 'fixable', 'schema', 'messages', 'deprecated', 'replacedBy']` (default): The order that the properties of `meta` should be placed in.
* `['type', 'docs', 'fixable', 'hasSuggestions', 'schema', 'messages', 'deprecated', 'replacedBy']` (default): The order that the properties of `meta` should be placed in.

Examples of **incorrect** code for this rule:

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/meta-property-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ module.exports = {
const sourceCode = context.getSourceCode();
const info = getRuleInfo(sourceCode);

const order = context.options[0] || ['type', 'docs', 'fixable', 'schema', 'messages'];
const order = context.options[0] || ['type', 'docs', 'fixable', 'hasSuggestions', 'schema', 'messages'];

const orderMap = new Map(order.map((name, i) => [name, i]));

Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-only-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ module.exports = {
category: 'Tests',
recommended: false,
},
hasSuggestions: true,
schema: [],
messages: {
foundOnly:
'The test case property `only` can be used during development, but should not be checked-in, since it prevents all the tests from running.',
removeOnly: 'Remove `only`.',
},
hasSuggestions: true,
},

create (context) {
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 @@ -15,6 +15,7 @@ module.exports = {
category: 'Rules',
recommended: false, // TODO: enable it in a major release.
},
hasSuggestions: true,
schema: [
{
type: 'object',
Expand All @@ -33,7 +34,6 @@ module.exports = {
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).',
},
hasSuggestions: true,
},

create (context) {
Expand Down
1 change: 1 addition & 0 deletions tests/lib/rules/meta-property-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ ruleTester.run('test-case-property-ordering', rule, {
type: 'problem',
docs: {},
fixable: 'code',
hasSuggestions: true,
schema: [],
messages: {}
},
Expand Down