Skip to content

Commit

Permalink
Chore: enable meta-property-ordering rule internally (#139)
Browse files Browse the repository at this point in the history
  • Loading branch information
bmish authored Jun 20, 2021
1 parent 6ffddd7 commit 6c83ec6
Show file tree
Hide file tree
Showing 23 changed files with 26 additions and 27 deletions.
1 change: 0 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ module.exports = {
plugins: ['self'],
extends: ['plugin:self/all'],
rules: {
'self/meta-property-ordering': 'off',
'self/report-message-format': ['error', '^[^a-z].*.$'],
'self/require-meta-docs-url': 'off',
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/consistent-output.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce consistent use of output assertions in rule tests',
category: 'Tests',
recommended: false,
},
type: 'suggestion',
fixable: null, // or "code" or "whitespace"
schema: [
{
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/fixer-return.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'require fixer function to always return a value.',
category: 'Possible Errors',
recommended: true,
},
type: 'problem',
fixable: null,
schema: [],
},
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 @@ -12,12 +12,12 @@ const { getKeyName, getRuleInfo } = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce the order of meta properties',
category: 'Rules',
recommended: false,
},
type: 'suggestion',
fixable: 'code',
schema: [{
type: 'array',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated-context-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ const DEPRECATED_PASSTHROUGHS = {

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow usage of deprecated methods on rule context objects',
category: 'Rules',
recommended: false,
},
type: 'suggestion',
fixable: 'code',
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-deprecated-report-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow use of the deprecated context.report() API',
category: 'Rules',
recommended: true,
},
type: 'suggestion',
fixable: 'code', // or "code" or "whitespace"
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-identical-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow identical tests',
category: 'Tests',
recommended: true,
},
type: 'problem',
fixable: 'code',
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-missing-placeholders.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const { getStaticValue } = require('eslint-utils');

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow missing placeholders in rule report messages',
category: 'Rules',
recommended: true,
},
type: 'problem',
fixable: null,
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-unused-placeholders.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const { getStaticValue } = require('eslint-utils');

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'disallow unused placeholders in rule report messages',
category: 'Rules',
recommended: true,
},
type: 'problem',
fixable: null,
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/no-useless-token-range.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow unnecessary calls to sourceCode.getFirstToken and sourceCode.getLastToken',
category: 'Rules',
recommended: true,
},
type: 'suggestion',
fixable: 'code',
schema: [],
},
Expand Down
6 changes: 3 additions & 3 deletions lib/rules/prefer-object-rule.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow rule exports where the export is a function.',
category: 'Rules',
recommended: false,
},
fixable: 'code',
schema: [],
messages: {
preferObject: 'Rules should be declared using the object style.',
},
type: 'suggestion',
fixable: 'code',
schema: [],
},

create (context) {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/prefer-output-null.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow invalid RuleTester test cases with the output the same as the code.',
category: 'Tests',
recommended: false,
},
type: 'suggestion',
fixable: 'code',
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/prefer-placeholders.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const { findVariable } = require('eslint-utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'disallow template literals as report messages',
category: 'Rules',
recommended: false,
},
type: 'suggestion',
fixable: null,
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/prefer-replace-text.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'require using replaceText instead of replaceTextRange.',
category: 'Rules',
recommended: false,
},
type: 'suggestion',
fixable: null,
schema: [],
},
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/report-message-format.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce a consistent format for rule report messages',
category: 'Rules',
recommended: false,
},
type: 'suggestion',
fixable: null,
schema: [
{ type: 'string' },
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-meta-docs-description.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ const DEFAULT_PATTERN = new RegExp('^(enforce|require|disallow)');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'require rules to implement a meta.docs.description property with the correct format',
category: 'Rules',
recommended: false, // TODO: enable it in a major release.
},
type: 'suggestion',
fixable: null,
schema: [
{
Expand Down
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 @@ -17,12 +17,12 @@ const util = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'require rules to implement a meta.docs.url property',
category: 'Rules',
recommended: false,
},
type: 'suggestion',
fixable: 'code',
schema: [{
type: 'object',
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/require-meta-fixable.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'require rules to implement a meta.fixable property',
category: 'Rules',
recommended: true,
},
type: 'problem',
schema: [],
},

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 @@ -9,17 +9,17 @@ const { getStaticValue } = require('eslint-utils');

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'require suggestable rules to implement a `meta.hasSuggestions` property',
category: 'Rules',
recommended: false,
},
type: 'problem',
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`.',
},
schema: [],
},

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 @@ -9,12 +9,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'require rules to implement a meta.schema property',
category: 'Rules',
recommended: false, // TODO: enable it in a major release.
},
type: 'suggestion',
fixable: 'code',
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 @@ -14,12 +14,12 @@ const VALID_TYPES = new Set(['problem', 'suggestion', 'layout']);

module.exports = {
meta: {
type: 'problem',
docs: {
description: 'require rules to implement a meta.type property',
category: 'Rules',
recommended: false, // TODO: enable it in a major release.
},
type: 'problem',
fixable: null,
schema: [],
messages: {
Expand Down
2 changes: 1 addition & 1 deletion lib/rules/test-case-property-ordering.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'require the properties of a test case to be placed in a consistent order',
category: 'Tests',
recommended: false,
},
type: 'suggestion',
fixable: 'code',
schema: [{
type: 'array',
Expand Down
4 changes: 2 additions & 2 deletions lib/rules/test-case-shorthand-strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ const utils = require('../utils');

module.exports = {
meta: {
type: 'suggestion',
docs: {
description: 'enforce consistent usage of shorthand strings for test cases with no options',
category: 'Tests',
recommended: false,
},
type: 'suggestion',
schema: [{ enum: ['as-needed', 'never', 'consistent', 'consistent-as-needed'] }],
fixable: 'code',
schema: [{ enum: ['as-needed', 'never', 'consistent', 'consistent-as-needed'] }],
},

create (context) {
Expand Down

0 comments on commit 6c83ec6

Please sign in to comment.