From e794e424a3816debc8aad8cf51baa9c2dcf98dd5 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 --- e2e/fixtures/all-typed-config/rule.js | 2 +- e2e/fixtures/all/rule.js | 2 +- lib/rules/consistent-output.ts | 2 +- lib/rules/fixer-return.ts | 2 +- lib/rules/meta-property-ordering.ts | 2 +- lib/rules/no-deprecated-context-methods.ts | 2 +- lib/rules/no-deprecated-report-api.ts | 2 +- lib/rules/no-identical-tests.ts | 2 +- lib/rules/no-meta-replaced-by.ts | 2 +- lib/rules/no-meta-schema-default.ts | 2 +- lib/rules/no-missing-message-ids.ts | 2 +- lib/rules/no-missing-placeholders.ts | 2 +- lib/rules/no-only-tests.ts | 2 +- lib/rules/no-property-in-node.ts | 2 +- lib/rules/no-unused-message-ids.ts | 2 +- lib/rules/no-unused-placeholders.ts | 2 +- lib/rules/no-useless-token-range.ts | 2 +- lib/rules/prefer-message-ids.ts | 2 +- lib/rules/prefer-object-rule.ts | 2 +- lib/rules/prefer-output-null.ts | 2 +- lib/rules/prefer-placeholders.ts | 2 +- lib/rules/prefer-replace-text.ts | 2 +- lib/rules/report-message-format.ts | 2 +- lib/rules/require-meta-default-options.ts | 2 +- lib/rules/require-meta-docs-description.ts | 8 +++--- lib/rules/require-meta-docs-recommended.ts | 2 +- lib/rules/require-meta-docs-url.ts | 2 +- lib/rules/require-meta-fixable.ts | 2 +- lib/rules/require-meta-has-suggestions.ts | 2 +- lib/rules/require-meta-schema-description.ts | 2 +- lib/rules/require-meta-schema.ts | 2 +- lib/rules/require-meta-type.ts | 2 +- lib/rules/test-case-property-ordering.ts | 2 +- lib/rules/test-case-shorthand-strings.ts | 2 +- .../rules/require-meta-docs-description.ts | 28 +++++++++---------- tests/lib/utils.ts | 5 ---- 36 files changed, 51 insertions(+), 56 deletions(-) diff --git a/e2e/fixtures/all-typed-config/rule.js b/e2e/fixtures/all-typed-config/rule.js index 982bde18..7152522f 100644 --- a/e2e/fixtures/all-typed-config/rule.js +++ b/e2e/fixtures/all-typed-config/rule.js @@ -4,7 +4,7 @@ const rule = { meta: { type: 'suggestion', docs: { - description: 'enforce a test', + description: 'Enforce a test', recommended: false, url: 'https://test.org', }, diff --git a/e2e/fixtures/all/rule.js b/e2e/fixtures/all/rule.js index 982bde18..7152522f 100644 --- a/e2e/fixtures/all/rule.js +++ b/e2e/fixtures/all/rule.js @@ -4,7 +4,7 @@ const rule = { meta: { type: 'suggestion', docs: { - description: 'enforce a test', + description: 'Enforce a test', recommended: false, url: 'https://test.org', }, diff --git a/lib/rules/consistent-output.ts b/lib/rules/consistent-output.ts index 82e0fcf3..776892b8 100644 --- a/lib/rules/consistent-output.ts +++ b/lib/rules/consistent-output.ts @@ -17,7 +17,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/fixer-return.ts index 6b71abda..3bf596fe 100644 --- a/lib/rules/fixer-return.ts +++ b/lib/rules/fixer-return.ts @@ -36,7 +36,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/meta-property-ordering.ts index c4ad2019..ec00e45e 100644 --- a/lib/rules/meta-property-ordering.ts +++ b/lib/rules/meta-property-ordering.ts @@ -27,7 +27,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/no-deprecated-context-methods.ts index 91d82bf1..0df41855 100644 --- a/lib/rules/no-deprecated-context-methods.ts +++ b/lib/rules/no-deprecated-context-methods.ts @@ -38,7 +38,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/no-deprecated-report-api.ts index 3c4bb955..f4af699c 100644 --- a/lib/rules/no-deprecated-report-api.ts +++ b/lib/rules/no-deprecated-report-api.ts @@ -15,7 +15,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/no-identical-tests.ts index 8454877c..7333b973 100644 --- a/lib/rules/no-identical-tests.ts +++ b/lib/rules/no-identical-tests.ts @@ -14,7 +14,7 @@ const rule: Rule.RuleModule = { 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-meta-replaced-by.ts b/lib/rules/no-meta-replaced-by.ts index 8bf3000a..b6b25b68 100644 --- a/lib/rules/no-meta-replaced-by.ts +++ b/lib/rules/no-meta-replaced-by.ts @@ -12,7 +12,7 @@ const rule: Rule.RuleModule = { meta: { type: 'problem', docs: { - description: 'disallow using the `meta.replacedBy` rule property', + description: 'Disallow using the `meta.replacedBy` rule property', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-meta-replaced-by.md', diff --git a/lib/rules/no-meta-schema-default.ts b/lib/rules/no-meta-schema-default.ts index 4bd8273f..70d4acf2 100644 --- a/lib/rules/no-meta-schema-default.ts +++ b/lib/rules/no-meta-schema-default.ts @@ -16,7 +16,7 @@ const rule: Rule.RuleModule = { type: 'suggestion', docs: { description: - 'disallow rules `meta.schema` properties to include defaults', + 'Disallow rules `meta.schema` properties to include defaults', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/no-meta-schema-default.md', diff --git a/lib/rules/no-missing-message-ids.ts b/lib/rules/no-missing-message-ids.ts index 6e84808a..ba47b538 100644 --- a/lib/rules/no-missing-message-ids.ts +++ b/lib/rules/no-missing-message-ids.ts @@ -19,7 +19,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/no-missing-placeholders.ts index b0b0b872..f3bb9cb4 100644 --- a/lib/rules/no-missing-placeholders.ts +++ b/lib/rules/no-missing-placeholders.ts @@ -23,7 +23,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/no-only-tests.ts index 0ad0dbc3..102ccc2f 100644 --- a/lib/rules/no-only-tests.ts +++ b/lib/rules/no-only-tests.ts @@ -11,7 +11,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/no-property-in-node.ts index 7ef564a2..a23ccf6d 100644 --- a/lib/rules/no-property-in-node.ts +++ b/lib/rules/no-property-in-node.ts @@ -51,7 +51,7 @@ const rule: Rule.RuleModule = { 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, // @ts-expect-error -- need to augment the type of `Rule.RuleMetaData` to include `requiresTypeChecking` diff --git a/lib/rules/no-unused-message-ids.ts b/lib/rules/no-unused-message-ids.ts index 8f8b2eb0..4d89af71 100644 --- a/lib/rules/no-unused-message-ids.ts +++ b/lib/rules/no-unused-message-ids.ts @@ -20,7 +20,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/no-unused-placeholders.ts index cb12058a..e8f8fd57 100644 --- a/lib/rules/no-unused-placeholders.ts +++ b/lib/rules/no-unused-placeholders.ts @@ -23,7 +23,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/no-useless-token-range.ts index e41c6716..1bfbad7a 100644 --- a/lib/rules/no-useless-token-range.ts +++ b/lib/rules/no-useless-token-range.ts @@ -15,7 +15,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/prefer-message-ids.ts index 1ef3b88d..55d66354 100644 --- a/lib/rules/prefer-message-ids.ts +++ b/lib/rules/prefer-message-ids.ts @@ -18,7 +18,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/prefer-object-rule.ts index f904a6c6..13115f7b 100644 --- a/lib/rules/prefer-object-rule.ts +++ b/lib/rules/prefer-object-rule.ts @@ -12,7 +12,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/prefer-output-null.ts index 57e50e2f..20a31f81 100644 --- a/lib/rules/prefer-output-null.ts +++ b/lib/rules/prefer-output-null.ts @@ -16,7 +16,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/prefer-placeholders.ts index e2026787..41fc82de 100644 --- a/lib/rules/prefer-placeholders.ts +++ b/lib/rules/prefer-placeholders.ts @@ -20,7 +20,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/prefer-replace-text.ts index 1b2ac928..9b87a3e0 100644 --- a/lib/rules/prefer-replace-text.ts +++ b/lib/rules/prefer-replace-text.ts @@ -27,7 +27,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/report-message-format.ts index 9ac571b6..379a6649 100644 --- a/lib/rules/report-message-format.ts +++ b/lib/rules/report-message-format.ts @@ -20,7 +20,7 @@ const rule: Rule.RuleModule = { 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-default-options.ts b/lib/rules/require-meta-default-options.ts index 608c5742..17da8db1 100644 --- a/lib/rules/require-meta-default-options.ts +++ b/lib/rules/require-meta-default-options.ts @@ -13,7 +13,7 @@ const rule: Rule.RuleModule = { type: 'suggestion', docs: { description: - 'require only rules with options to implement a `meta.defaultOptions` property', + 'Require only rules with options to implement a `meta.defaultOptions` property', category: 'Rules', recommended: true, url: 'https://github.com/eslint-community/eslint-plugin-eslint-plugin/tree/HEAD/docs/rules/require-meta-default-options.md', diff --git a/lib/rules/require-meta-docs-description.ts b/lib/rules/require-meta-docs-description.ts index d2b9c6aa..5c75f497 100644 --- a/lib/rules/require-meta-docs-description.ts +++ b/lib/rules/require-meta-docs-description.ts @@ -3,14 +3,14 @@ import type { Rule } from 'eslint'; import { getMetaDocsProperty, getRuleInfo } from '../utils.ts'; -const DEFAULT_PATTERN = new RegExp('^(enforce|require|disallow)'); +const DEFAULT_PATTERN = new RegExp('^(Enforce|Require|Disallow)'); const rule: Rule.RuleModule = { meta: { 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', @@ -24,13 +24,13 @@ const rule: Rule.RuleModule = { 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, }, ], - defaultOptions: [{ pattern: '^(enforce|require|disallow)' }], + defaultOptions: [{ pattern: '^(Enforce|Require|Disallow)' }], messages: { extraWhitespace: '`meta.docs.description` must not have leading nor trailing whitespace.', diff --git a/lib/rules/require-meta-docs-recommended.ts b/lib/rules/require-meta-docs-recommended.ts index f37bd0e9..8f7f9a91 100644 --- a/lib/rules/require-meta-docs-recommended.ts +++ b/lib/rules/require-meta-docs-recommended.ts @@ -37,7 +37,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/require-meta-docs-url.ts index 699aca64..2b8e79fc 100644 --- a/lib/rules/require-meta-docs-url.ts +++ b/lib/rules/require-meta-docs-url.ts @@ -21,7 +21,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/require-meta-fixable.ts index 785c3694..5884c2c5 100644 --- a/lib/rules/require-meta-fixable.ts +++ b/lib/rules/require-meta-fixable.ts @@ -20,7 +20,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/require-meta-has-suggestions.ts index 610d6418..c34d4ba7 100644 --- a/lib/rules/require-meta-has-suggestions.ts +++ b/lib/rules/require-meta-has-suggestions.ts @@ -18,7 +18,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/require-meta-schema-description.ts index 80d36676..2a5621a7 100644 --- a/lib/rules/require-meta-schema-description.ts +++ b/lib/rules/require-meta-schema-description.ts @@ -16,7 +16,7 @@ const rule: Rule.RuleModule = { type: 'suggestion', docs: { description: - 'require rules `meta.schema` properties to include descriptions', + 'Require rules `meta.schema` properties to include descriptions', category: 'Rules', recommended: true, 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.ts b/lib/rules/require-meta-schema.ts index ab1a5526..92b2b816 100644 --- a/lib/rules/require-meta-schema.ts +++ b/lib/rules/require-meta-schema.ts @@ -17,7 +17,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/require-meta-type.ts index 400d0297..866f2356 100644 --- a/lib/rules/require-meta-type.ts +++ b/lib/rules/require-meta-type.ts @@ -16,7 +16,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/test-case-property-ordering.ts index 0d9be79c..e115c958 100644 --- a/lib/rules/test-case-property-ordering.ts +++ b/lib/rules/test-case-property-ordering.ts @@ -30,7 +30,7 @@ const rule: Rule.RuleModule = { 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.ts b/lib/rules/test-case-shorthand-strings.ts index e2ea0414..d73a096f 100644 --- a/lib/rules/test-case-shorthand-strings.ts +++ b/lib/rules/test-case-shorthand-strings.ts @@ -15,7 +15,7 @@ const rule: Rule.RuleModule = { 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.ts b/tests/lib/rules/require-meta-docs-description.ts index 10f37b3e..df607c21 100644 --- a/tests/lib/rules/require-meta-docs-description.ts +++ b/tests/lib/rules/require-meta-docs-description.ts @@ -19,7 +19,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) {} }; `, @@ -27,7 +27,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) {} }; `, @@ -35,13 +35,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) {} }; `, @@ -53,24 +53,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) {} @@ -103,7 +103,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) {} @@ -111,7 +111,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 }, @@ -236,7 +236,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) {} }; `, @@ -254,7 +254,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', }, ], @@ -270,7 +270,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', }, ], @@ -304,7 +304,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) {} }); `, diff --git a/tests/lib/utils.ts b/tests/lib/utils.ts index 8e180210..621711a7 100644 --- a/tests/lib/utils.ts +++ b/tests/lib/utils.ts @@ -217,11 +217,6 @@ describe('utils', () => { meta: { type: 'ObjectExpression' }, isNewStyle: true, }, - 'export default createESLintRule<>({ create() {}, meta: {} });': { - create: { type: 'FunctionExpression' }, - meta: { type: 'ObjectExpression' }, - isNewStyle: true, - }, 'export default createESLintRule({ create() {}, meta: {} });': { create: { type: 'FunctionExpression' }, meta: { type: 'ObjectExpression' },