From ecaf03799f701e5ab8b864436b44e5889fe6a26e Mon Sep 17 00:00:00 2001 From: "Azat S." Date: Mon, 18 Nov 2024 01:11:38 +0300 Subject: [PATCH] feat: capitalize default pattern of `require-meta-docs-description` rule --- eslint.config.js | 1 + lib/rules/consistent-output.js | 2 +- lib/rules/fixer-return.js | 2 +- lib/rules/meta-property-ordering.js | 2 +- lib/rules/no-deprecated-context-methods.js | 2 +- lib/rules/no-deprecated-report-api.js | 2 +- lib/rules/no-identical-tests.js | 2 +- lib/rules/no-missing-message-ids.js | 2 +- lib/rules/no-missing-placeholders.js | 2 +- lib/rules/no-only-tests.js | 2 +- lib/rules/no-property-in-node.js | 2 +- lib/rules/no-unused-message-ids.js | 2 +- lib/rules/no-unused-placeholders.js | 2 +- lib/rules/no-useless-token-range.js | 2 +- lib/rules/prefer-message-ids.js | 2 +- lib/rules/prefer-object-rule.js | 2 +- lib/rules/prefer-output-null.js | 2 +- lib/rules/prefer-placeholders.js | 2 +- lib/rules/prefer-replace-text.js | 2 +- lib/rules/report-message-format.js | 2 +- lib/rules/require-meta-docs-description.js | 6 ++-- lib/rules/require-meta-docs-recommended.js | 2 +- lib/rules/require-meta-docs-url.js | 2 +- lib/rules/require-meta-fixable.js | 2 +- lib/rules/require-meta-has-suggestions.js | 2 +- lib/rules/require-meta-schema-description.js | 2 +- lib/rules/require-meta-schema.js | 2 +- lib/rules/require-meta-type.js | 2 +- lib/rules/test-case-property-ordering.js | 2 +- lib/rules/test-case-shorthand-strings.js | 2 +- .../rules/require-meta-docs-description.js | 28 +++++++++---------- 31 files changed, 46 insertions(+), 45 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index ecc609db..0f529131 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -25,6 +25,7 @@ module.exports = [ '@eslint-community/eslint-comments/no-unused-disable': 'error', '@eslint-community/eslint-comments/require-description': 'error', + 'unicorn/expiring-todo-comments': 'off', 'unicorn/consistent-function-scoping': 'off', 'unicorn/no-array-callback-reference': 'off', 'unicorn/no-array-for-each': 'off', diff --git a/lib/rules/consistent-output.js b/lib/rules/consistent-output.js index 57beac64..9566221c 100644 --- a/lib/rules/consistent-output.js +++ b/lib/rules/consistent-output.js @@ -17,7 +17,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'enforce consistent use of `output` assertions in rule tests', + 'Enforce consistent use of `output` assertions in rule tests', category: 'Tests', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/consistent-output.md', diff --git a/lib/rules/fixer-return.js b/lib/rules/fixer-return.js index 0ea7c857..66362857 100644 --- a/lib/rules/fixer-return.js +++ b/lib/rules/fixer-return.js @@ -21,7 +21,7 @@ module.exports = { meta: { type: 'problem', docs: { - description: 'require fixer functions to return a fix', + description: 'Require fixer functions to return a fix', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/fixer-return.md', diff --git a/lib/rules/meta-property-ordering.js b/lib/rules/meta-property-ordering.js index e3de8cf1..01304dec 100644 --- a/lib/rules/meta-property-ordering.js +++ b/lib/rules/meta-property-ordering.js @@ -15,7 +15,7 @@ module.exports = { meta: { type: 'suggestion', docs: { - description: 'enforce the order of meta properties', + description: 'Enforce the order of meta properties', category: 'Rules', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/meta-property-ordering.md', diff --git a/lib/rules/no-deprecated-context-methods.js b/lib/rules/no-deprecated-context-methods.js index e72580ca..ed24d44a 100644 --- a/lib/rules/no-deprecated-context-methods.js +++ b/lib/rules/no-deprecated-context-methods.js @@ -40,7 +40,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'disallow usage of deprecated methods on rule context objects', + 'Disallow usage of deprecated methods on rule context objects', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-deprecated-context-methods.md', diff --git a/lib/rules/no-deprecated-report-api.js b/lib/rules/no-deprecated-report-api.js index 266cb71d..966a3f23 100644 --- a/lib/rules/no-deprecated-report-api.js +++ b/lib/rules/no-deprecated-report-api.js @@ -17,7 +17,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'disallow the version of `context.report()` with multiple arguments', + 'Disallow the version of `context.report()` with multiple arguments', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-deprecated-report-api.md', diff --git a/lib/rules/no-identical-tests.js b/lib/rules/no-identical-tests.js index c0744fad..617983e7 100644 --- a/lib/rules/no-identical-tests.js +++ b/lib/rules/no-identical-tests.js @@ -16,7 +16,7 @@ module.exports = { meta: { type: 'problem', docs: { - description: 'disallow identical tests', + description: 'Disallow identical tests', category: 'Tests', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-identical-tests.md', diff --git a/lib/rules/no-missing-message-ids.js b/lib/rules/no-missing-message-ids.js index 1066b855..7dcbe825 100644 --- a/lib/rules/no-missing-message-ids.js +++ b/lib/rules/no-missing-message-ids.js @@ -12,7 +12,7 @@ module.exports = { type: 'problem', docs: { description: - 'disallow `messageId`s that are missing from `meta.messages`', + 'Disallow `messageId`s that are missing from `meta.messages`', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-missing-message-ids.md', diff --git a/lib/rules/no-missing-placeholders.js b/lib/rules/no-missing-placeholders.js index 364c340f..8184c3c9 100644 --- a/lib/rules/no-missing-placeholders.js +++ b/lib/rules/no-missing-placeholders.js @@ -17,7 +17,7 @@ module.exports = { meta: { type: 'problem', docs: { - description: 'disallow missing placeholders in rule report messages', + description: 'Disallow missing placeholders in rule report messages', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-missing-placeholders.md', diff --git a/lib/rules/no-only-tests.js b/lib/rules/no-only-tests.js index 816fedd1..bdc63a8d 100644 --- a/lib/rules/no-only-tests.js +++ b/lib/rules/no-only-tests.js @@ -12,7 +12,7 @@ module.exports = { meta: { type: 'problem', docs: { - description: 'disallow the test case property `only`', + description: 'Disallow the test case property `only`', category: 'Tests', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-only-tests.md', diff --git a/lib/rules/no-property-in-node.js b/lib/rules/no-property-in-node.js index 1f6563f6..336a3e53 100644 --- a/lib/rules/no-property-in-node.js +++ b/lib/rules/no-property-in-node.js @@ -50,7 +50,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'disallow using `in` to narrow node types instead of looking at properties', + 'Disallow using `in` to narrow node types instead of looking at properties', category: 'Rules', recommended: false, requiresTypeChecking: true, diff --git a/lib/rules/no-unused-message-ids.js b/lib/rules/no-unused-message-ids.js index 978fad10..737d5e12 100644 --- a/lib/rules/no-unused-message-ids.js +++ b/lib/rules/no-unused-message-ids.js @@ -11,7 +11,7 @@ module.exports = { meta: { type: 'problem', docs: { - description: 'disallow unused `messageId`s in `meta.messages`', + description: 'Disallow unused `messageId`s in `meta.messages`', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-unused-message-ids.md', diff --git a/lib/rules/no-unused-placeholders.js b/lib/rules/no-unused-placeholders.js index ca95c952..89b3d716 100644 --- a/lib/rules/no-unused-placeholders.js +++ b/lib/rules/no-unused-placeholders.js @@ -17,7 +17,7 @@ module.exports = { meta: { type: 'problem', docs: { - description: 'disallow unused placeholders in rule report messages', + description: 'Disallow unused placeholders in rule report messages', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-unused-placeholders.md', diff --git a/lib/rules/no-useless-token-range.js b/lib/rules/no-useless-token-range.js index 998c0059..f1181003 100644 --- a/lib/rules/no-useless-token-range.js +++ b/lib/rules/no-useless-token-range.js @@ -17,7 +17,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'disallow unnecessary calls to `sourceCode.getFirstToken()` and `sourceCode.getLastToken()`', + 'Disallow unnecessary calls to `sourceCode.getFirstToken()` and `sourceCode.getLastToken()`', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-useless-token-range.md', diff --git a/lib/rules/prefer-message-ids.js b/lib/rules/prefer-message-ids.js index 1d932748..c8ea7f87 100644 --- a/lib/rules/prefer-message-ids.js +++ b/lib/rules/prefer-message-ids.js @@ -13,7 +13,7 @@ module.exports = { type: 'problem', docs: { description: - 'require using `messageId` instead of `message` or `desc` to report rule violations', + 'Require using `messageId` instead of `message` or `desc` to report rule violations', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/prefer-message-ids.md', diff --git a/lib/rules/prefer-object-rule.js b/lib/rules/prefer-object-rule.js index 4a9351bf..d9e397a5 100644 --- a/lib/rules/prefer-object-rule.js +++ b/lib/rules/prefer-object-rule.js @@ -15,7 +15,7 @@ module.exports = { meta: { type: 'suggestion', docs: { - description: 'disallow function-style rules', + description: 'Disallow function-style rules', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/prefer-object-rule.md', diff --git a/lib/rules/prefer-output-null.js b/lib/rules/prefer-output-null.js index d9be111b..563ddb9b 100644 --- a/lib/rules/prefer-output-null.js +++ b/lib/rules/prefer-output-null.js @@ -17,7 +17,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'disallow invalid RuleTester test cases where the `output` matches the `code`', + 'Disallow invalid RuleTester test cases where the `output` matches the `code`', category: 'Tests', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/prefer-output-null.md', diff --git a/lib/rules/prefer-placeholders.js b/lib/rules/prefer-placeholders.js index a1555945..b20126e4 100644 --- a/lib/rules/prefer-placeholders.js +++ b/lib/rules/prefer-placeholders.js @@ -17,7 +17,7 @@ module.exports = { meta: { type: 'suggestion', docs: { - description: 'require using placeholders for dynamic report messages', + description: 'Require using placeholders for dynamic report messages', category: 'Rules', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/prefer-placeholders.md', diff --git a/lib/rules/prefer-replace-text.js b/lib/rules/prefer-replace-text.js index 100c618c..294dce6f 100644 --- a/lib/rules/prefer-replace-text.js +++ b/lib/rules/prefer-replace-text.js @@ -17,7 +17,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'require using `replaceText()` instead of `replaceTextRange()`', + 'Require using `replaceText()` instead of `replaceTextRange()`', category: 'Rules', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/prefer-replace-text.md', diff --git a/lib/rules/report-message-format.js b/lib/rules/report-message-format.js index 4d9d09ce..965d40a7 100644 --- a/lib/rules/report-message-format.js +++ b/lib/rules/report-message-format.js @@ -17,7 +17,7 @@ module.exports = { meta: { type: 'suggestion', docs: { - description: 'enforce a consistent format for rule report messages', + description: 'Enforce a consistent format for rule report messages', category: 'Rules', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/report-message-format.md', diff --git a/lib/rules/require-meta-docs-description.js b/lib/rules/require-meta-docs-description.js index 52918e19..e0be48c2 100644 --- a/lib/rules/require-meta-docs-description.js +++ b/lib/rules/require-meta-docs-description.js @@ -7,7 +7,7 @@ const utils = require('../utils'); // Rule Definition // ------------------------------------------------------------------------------ -const DEFAULT_PATTERN = new RegExp('^(enforce|require|disallow)'); +const DEFAULT_PATTERN = new RegExp('^(Enforce|Require|Disallow)'); /** @type {import('eslint').Rule.RuleModule} */ module.exports = { @@ -15,7 +15,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'require rules to implement a `meta.docs.description` property with the correct format', + 'Require rules to implement a `meta.docs.description` property with the correct format', category: 'Rules', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-docs-description.md', @@ -29,7 +29,7 @@ module.exports = { type: 'string', description: "A regular expression that the description must match. Use `'.+'` to allow anything.", - default: '^(enforce|require|disallow)', + default: '^(Enforce|Require|Disallow)', }, }, additionalProperties: false, diff --git a/lib/rules/require-meta-docs-recommended.js b/lib/rules/require-meta-docs-recommended.js index f2cdeee8..17396815 100644 --- a/lib/rules/require-meta-docs-recommended.js +++ b/lib/rules/require-meta-docs-recommended.js @@ -9,7 +9,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'require rules to implement a `meta.docs.recommended` property', + 'Require rules to implement a `meta.docs.recommended` property', category: 'Rules', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-docs-recommended.md', diff --git a/lib/rules/require-meta-docs-url.js b/lib/rules/require-meta-docs-url.js index d5039eee..e3510039 100644 --- a/lib/rules/require-meta-docs-url.js +++ b/lib/rules/require-meta-docs-url.js @@ -21,7 +21,7 @@ module.exports = { meta: { type: 'suggestion', docs: { - description: 'require rules to implement a `meta.docs.url` property', + description: 'Require rules to implement a `meta.docs.url` property', category: 'Rules', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-docs-url.md', diff --git a/lib/rules/require-meta-fixable.js b/lib/rules/require-meta-fixable.js index 8e275f6d..762f3047 100644 --- a/lib/rules/require-meta-fixable.js +++ b/lib/rules/require-meta-fixable.js @@ -17,7 +17,7 @@ module.exports = { meta: { type: 'problem', docs: { - description: 'require rules to implement a `meta.fixable` property', + description: 'Require rules to implement a `meta.fixable` property', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-fixable.md', diff --git a/lib/rules/require-meta-has-suggestions.js b/lib/rules/require-meta-has-suggestions.js index 1759eecf..a52deccf 100644 --- a/lib/rules/require-meta-has-suggestions.js +++ b/lib/rules/require-meta-has-suggestions.js @@ -13,7 +13,7 @@ module.exports = { type: 'problem', docs: { description: - 'require suggestable rules to implement a `meta.hasSuggestions` property', + 'Require suggestable rules to implement a `meta.hasSuggestions` property', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-has-suggestions.md', diff --git a/lib/rules/require-meta-schema-description.js b/lib/rules/require-meta-schema-description.js index e267e487..994f4d42 100644 --- a/lib/rules/require-meta-schema-description.js +++ b/lib/rules/require-meta-schema-description.js @@ -13,7 +13,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'require rules `meta.schema` properties to include descriptions', + 'Require rules `meta.schema` properties to include descriptions', category: 'Rules', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-schema-description.md', diff --git a/lib/rules/require-meta-schema.js b/lib/rules/require-meta-schema.js index 61f956b7..b595ddbf 100644 --- a/lib/rules/require-meta-schema.js +++ b/lib/rules/require-meta-schema.js @@ -11,7 +11,7 @@ module.exports = { meta: { type: 'suggestion', docs: { - description: 'require rules to implement a `meta.schema` property', + description: 'Require rules to implement a `meta.schema` property', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-schema.md', diff --git a/lib/rules/require-meta-type.js b/lib/rules/require-meta-type.js index 24036071..776cb252 100644 --- a/lib/rules/require-meta-type.js +++ b/lib/rules/require-meta-type.js @@ -18,7 +18,7 @@ module.exports = { meta: { type: 'problem', docs: { - description: 'require rules to implement a `meta.type` property', + description: 'Require rules to implement a `meta.type` property', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-type.md', diff --git a/lib/rules/test-case-property-ordering.js b/lib/rules/test-case-property-ordering.js index 5b161aba..9b78ba8d 100644 --- a/lib/rules/test-case-property-ordering.js +++ b/lib/rules/test-case-property-ordering.js @@ -17,7 +17,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'require the properties of a test case to be placed in a consistent order', + 'Require the properties of a test case to be placed in a consistent order', category: 'Tests', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/test-case-property-ordering.md', diff --git a/lib/rules/test-case-shorthand-strings.js b/lib/rules/test-case-shorthand-strings.js index 432d4745..8aff8a2f 100644 --- a/lib/rules/test-case-shorthand-strings.js +++ b/lib/rules/test-case-shorthand-strings.js @@ -17,7 +17,7 @@ module.exports = { type: 'suggestion', docs: { description: - 'enforce consistent usage of shorthand strings for test cases with no options', + 'Enforce consistent usage of shorthand strings for test cases with no options', category: 'Tests', recommended: false, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/test-case-shorthand-strings.md', diff --git a/tests/lib/rules/require-meta-docs-description.js b/tests/lib/rules/require-meta-docs-description.js index 2b4ded37..f78faac1 100644 --- a/tests/lib/rules/require-meta-docs-description.js +++ b/tests/lib/rules/require-meta-docs-description.js @@ -20,7 +20,7 @@ ruleTester.run('require-meta-docs-description', rule, { 'module.exports = {};', // No rule. ` module.exports = { - meta: { docs: { description: 'disallow unused variables' } }, + meta: { docs: { description: 'Disallow unused variables' } }, create(context) {} }; `, @@ -28,7 +28,7 @@ ruleTester.run('require-meta-docs-description', rule, { // ESM code: ` export default { - meta: { docs: { description: 'disallow unused variables' } }, + meta: { docs: { description: 'Disallow unused variables' } }, create(context) {} }; `, @@ -36,13 +36,13 @@ ruleTester.run('require-meta-docs-description', rule, { }, ` module.exports = { - meta: { docs: { description: 'enforce a maximum line length' } }, + meta: { docs: { description: 'Enforce a maximum line length' } }, create(context) {} }; `, ` module.exports = { - meta: { docs: { description: 'require or disallow newline at the end of files' } }, + meta: { docs: { description: 'Require or disallow newline at the end of files' } }, create(context) {} }; `, @@ -54,24 +54,24 @@ ruleTester.run('require-meta-docs-description', rule, { `, ` module.exports = { - meta: { docs: { description: \`enforce with template literal\` } }, + meta: { docs: { description: \`Enforce with template literal\` } }, create(context) {} }; `, ` module.exports = { - meta: { docs: { description: "enforce" + " " + "something" } }, + meta: { docs: { description: "Enforce" + " " + "something" } }, create(context) {} }; `, ` module.exports = { - meta: { docs: { description: "enforce " + generateSomething() } }, + meta: { docs: { description: "Enforce " + generateSomething() } }, create(context) {} }; `, ` - const DESCRIPTION = 'require foo'; + const DESCRIPTION = 'Require foo'; module.exports = { meta: { docs: { description: DESCRIPTION } }, create(context) {} @@ -104,7 +104,7 @@ ruleTester.run('require-meta-docs-description', rule, { }, // `meta` in variable, `description` present. ` - const meta = { docs: { description: 'enforce foo' } }; + const meta = { docs: { description: 'Enforce foo' } }; module.exports = { meta, create(context) {} @@ -112,7 +112,7 @@ ruleTester.run('require-meta-docs-description', rule, { `, // Spread. ` - const extraDocs = { description: 'enforce foo' }; + const extraDocs = { description: 'Enforce foo' }; const extraMeta = { docs: { ...extraDocs } }; module.exports = { meta: { ...extraMeta }, @@ -237,7 +237,7 @@ ruleTester.run('require-meta-docs-description', rule, { { code: ` module.exports = { - meta: { docs: { description: 'enforce something with trailing whitespace ' } }, + meta: { docs: { description: 'Enforce something with trailing whitespace ' } }, create(context) {} }; `, @@ -255,7 +255,7 @@ ruleTester.run('require-meta-docs-description', rule, { errors: [ { message: - '`meta.docs.description` must match the regexp /^(enforce|require|disallow)/.', + '`meta.docs.description` must match the regexp /^(Enforce|Require|Disallow)/.', type: 'Literal', }, ], @@ -271,7 +271,7 @@ ruleTester.run('require-meta-docs-description', rule, { errors: [ { message: - '`meta.docs.description` must match the regexp /^(enforce|require|disallow)/.', + '`meta.docs.description` must match the regexp /^(Enforce|Require|Disallow)/.', type: 'BinaryExpression', }, ], @@ -305,7 +305,7 @@ ruleTesterTypeScript.run('require-meta-docs-description (TypeScript)', rule, { valid: [ ` export default createESLintRule({ - meta: { docs: { description: 'disallow unused variables' } }, + meta: { docs: { description: 'Disallow unused variables' } }, create(context) {} }); `,