From f9ca4d067465d8e62798499a993de0890b08e72b Mon Sep 17 00:00:00 2001 From: Vojtech Strnad Date: Sat, 25 Apr 2020 23:54:32 +0200 Subject: [PATCH] chore(eslint-plugin): standardize sentences in rule messages --- .../src/rules/consistent-type-definitions.ts | 4 ++-- .../eslint-plugin/src/rules/naming-convention.ts | 2 +- .../eslint-plugin/src/rules/no-floating-promises.ts | 6 +++--- .../rules/no-unnecessary-boolean-literal-compare.ts | 2 +- .../src/rules/no-unnecessary-condition.ts | 12 ++++++------ .../eslint-plugin/src/rules/no-unsafe-assignment.ts | 10 +++++----- packages/eslint-plugin/src/rules/no-unsafe-call.ts | 6 +++--- .../src/rules/no-unsafe-member-access.ts | 4 ++-- packages/eslint-plugin/src/rules/no-unsafe-return.ts | 2 +- .../src/rules/no-untyped-public-signature.ts | 4 ++-- .../src/rules/no-unused-vars-experimental.ts | 2 +- packages/eslint-plugin/src/rules/prefer-as-const.ts | 4 ++-- packages/eslint-plugin/src/rules/prefer-for-of.ts | 2 +- .../src/rules/prefer-readonly-parameter-types.ts | 2 +- packages/eslint-plugin/src/rules/return-await.ts | 6 +++--- .../src/rules/switch-exhaustiveness-check.ts | 2 +- packages/eslint-plugin/src/rules/typedef.ts | 4 ++-- 17 files changed, 37 insertions(+), 37 deletions(-) diff --git a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts index d8d574d4d253..794e380e389d 100644 --- a/packages/eslint-plugin/src/rules/consistent-type-definitions.ts +++ b/packages/eslint-plugin/src/rules/consistent-type-definitions.ts @@ -17,8 +17,8 @@ export default util.createRule({ recommended: false, }, messages: { - interfaceOverType: 'Use an `interface` instead of a `type`', - typeOverInterface: 'Use a `type` instead of an `interface`', + interfaceOverType: 'Use an `interface` instead of a `type`.', + typeOverInterface: 'Use a `type` instead of an `interface`.', }, schema: [ { diff --git a/packages/eslint-plugin/src/rules/naming-convention.ts b/packages/eslint-plugin/src/rules/naming-convention.ts index f1963b17321b..69791b205c56 100644 --- a/packages/eslint-plugin/src/rules/naming-convention.ts +++ b/packages/eslint-plugin/src/rules/naming-convention.ts @@ -349,7 +349,7 @@ export default util.createRule({ unexpectedUnderscore: '{{type}} name {{name}} must not have a {{position}} underscore.', missingUnderscore: - '{{type}} name {{name}} must have a {{position}} underscore', + '{{type}} name {{name}} must have a {{position}} underscore.', missingAffix: '{{type}} name {{name}} must have one of the following {{position}}es: {{affixes}}', satisfyCustom: diff --git a/packages/eslint-plugin/src/rules/no-floating-promises.ts b/packages/eslint-plugin/src/rules/no-floating-promises.ts index 09d70bac42c0..04da1a9b8c49 100644 --- a/packages/eslint-plugin/src/rules/no-floating-promises.ts +++ b/packages/eslint-plugin/src/rules/no-floating-promises.ts @@ -27,11 +27,11 @@ export default util.createRule({ requiresTypeChecking: true, }, messages: { - floating: 'Promises must be handled appropriately', + floating: 'Promises must be handled appropriately.', floatingVoid: 'Promises must be handled appropriately' + - ' or explicitly marked as ignored with the `void` operator', - floatingFixVoid: 'Add void operator to ignore', + ' or explicitly marked as ignored with the `void` operator.', + floatingFixVoid: 'Add void operator to ignore.', }, schema: [ { diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts index f0ebc0292ce1..1cd03962ae47 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-boolean-literal-compare.ts @@ -28,7 +28,7 @@ export default util.createRule<[], MessageIds>({ fixable: 'code', messages: { direct: - 'This expression unnecessarily compares a boolean value to a boolean instead of using it directly', + 'This expression unnecessarily compares a boolean value to a boolean instead of using it directly.', negated: 'This expression unnecessarily compares a boolean value to a boolean instead of negating it.', }, diff --git a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts index 07bb3d56c5c3..a64a3ddc9c94 100644 --- a/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts +++ b/packages/eslint-plugin/src/rules/no-unnecessary-condition.ts @@ -108,17 +108,17 @@ export default createRule({ alwaysTruthy: 'Unnecessary conditional, value is always truthy.', alwaysFalsy: 'Unnecessary conditional, value is always falsy.', alwaysTruthyFunc: - 'This callback should return a conditional, but return is always truthy', + 'This callback should return a conditional, but return is always truthy.', alwaysFalsyFunc: - 'This callback should return a conditional, but return is always falsy', + 'This callback should return a conditional, but return is always falsy.', neverNullish: 'Unnecessary conditional, expected left-hand side of `??` operator to be possibly null or undefined.', alwaysNullish: - 'Unnecessary conditional, left-hand side of `??` operator is always `null` or `undefined`', + 'Unnecessary conditional, left-hand side of `??` operator is always `null` or `undefined`.', literalBooleanExpression: - 'Unnecessary conditional, both sides of the expression are literal values', - never: 'Unnecessary conditional, value is `never`', - neverOptionalChain: 'Unnecessary optional chain on a non-nullish value', + 'Unnecessary conditional, both sides of the expression are literal values.', + never: 'Unnecessary conditional, value is `never`.', + neverOptionalChain: 'Unnecessary optional chain on a non-nullish value.', }, }, defaultOptions: [ diff --git a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts index 60f7b78acc08..b7f339e19440 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-assignment.ts @@ -25,13 +25,13 @@ export default util.createRule({ requiresTypeChecking: true, }, messages: { - anyAssignment: 'Unsafe assignment of an any value', - unsafeArrayPattern: 'Unsafe array destructuring of an any array value', + anyAssignment: 'Unsafe assignment of an any value.', + unsafeArrayPattern: 'Unsafe array destructuring of an any array value.', unsafeArrayPatternFromTuple: - 'Unsafe array destructuring of a tuple element with an any value', + 'Unsafe array destructuring of a tuple element with an any value.', unsafeAssignment: - 'Unsafe asignment of type {{sender}} to a variable of type {{receiver}}', - unsafeArraySpread: 'Unsafe spread of an any value in an array', + 'Unsafe asignment of type {{sender}} to a variable of type {{receiver}}.', + unsafeArraySpread: 'Unsafe spread of an any value in an array.', }, schema: [], }, diff --git a/packages/eslint-plugin/src/rules/no-unsafe-call.ts b/packages/eslint-plugin/src/rules/no-unsafe-call.ts index 3661bd44f16d..4cd123708229 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-call.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-call.ts @@ -14,9 +14,9 @@ export default util.createRule<[], MessageIds>({ requiresTypeChecking: true, }, messages: { - unsafeCall: 'Unsafe call of an any typed value', - unsafeNew: 'Unsafe construction of an any type value', - unsafeTemplateTag: 'Unsafe any typed template tag', + unsafeCall: 'Unsafe call of an any typed value.', + unsafeNew: 'Unsafe construction of an any type value.', + unsafeTemplateTag: 'Unsafe any typed template tag.', }, schema: [], }, diff --git a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts index 3d3b0c7e7231..a17818efb414 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-member-access.ts @@ -21,9 +21,9 @@ export default util.createRule({ }, messages: { unsafeMemberExpression: - 'Unsafe member access {{property}} on an any value', + 'Unsafe member access {{property}} on an any value.', unsafeComputedMemberAccess: - 'Computed name {{property}} resolves to an any value', + 'Computed name {{property}} resolves to an any value.', }, schema: [], }, diff --git a/packages/eslint-plugin/src/rules/no-unsafe-return.ts b/packages/eslint-plugin/src/rules/no-unsafe-return.ts index 5fbbfac9b908..53429898da4e 100644 --- a/packages/eslint-plugin/src/rules/no-unsafe-return.ts +++ b/packages/eslint-plugin/src/rules/no-unsafe-return.ts @@ -18,7 +18,7 @@ export default util.createRule({ messages: { unsafeReturn: 'Unsafe return of an {{type}} typed value', unsafeReturnAssignment: - 'Unsafe return of type {{sender}} from function with return type {{receiver}}', + 'Unsafe return of type {{sender}} from function with return type {{receiver}}.', }, schema: [], }, diff --git a/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts b/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts index 303c1336b637..cff725facc9c 100644 --- a/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts +++ b/packages/eslint-plugin/src/rules/no-untyped-public-signature.ts @@ -19,8 +19,8 @@ export default util.createRule({ recommended: false, }, messages: { - noReturnType: 'Public method has no return type', - untypedParameter: 'Public method parameters should be typed', + noReturnType: 'Public method has no return type.', + untypedParameter: 'Public method parameters should be typed.', }, schema: [ { diff --git a/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts b/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts index 920a23199251..ca46ef0527c3 100644 --- a/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts +++ b/packages/eslint-plugin/src/rules/no-unused-vars-experimental.ts @@ -56,7 +56,7 @@ export default util.createRule({ messages: { unused: "{{type}} '{{name}}' is declared but its value is never read.", unusedWithIgnorePattern: - "{{type}} '{{name}}' is declared but its value is never read. Allowed unused names must match {{pattern}}", + "{{type}} '{{name}}' is declared but its value is never read. Allowed unused names must match {{pattern}}.", unusedImport: 'All imports in import declaration are unused.', unusedTypeParameters: 'All type parameters are unused.', }, diff --git a/packages/eslint-plugin/src/rules/prefer-as-const.ts b/packages/eslint-plugin/src/rules/prefer-as-const.ts index 1cf21af7580c..cbce99462d19 100644 --- a/packages/eslint-plugin/src/rules/prefer-as-const.ts +++ b/packages/eslint-plugin/src/rules/prefer-as-const.ts @@ -17,9 +17,9 @@ export default util.createRule({ fixable: 'code', messages: { preferConstAssertion: - 'Expected a `const` instead of a literal type assertion', + 'Expected a `const` instead of a literal type assertion.', variableConstAssertion: - 'Expected a `const` assertion instead of a literal type annotation', + 'Expected a `const` assertion instead of a literal type annotation.', variableSuggest: 'You should use `as const` instead of type annotation.', }, schema: [], diff --git a/packages/eslint-plugin/src/rules/prefer-for-of.ts b/packages/eslint-plugin/src/rules/prefer-for-of.ts index 40fac431664d..49fbc236f5d4 100644 --- a/packages/eslint-plugin/src/rules/prefer-for-of.ts +++ b/packages/eslint-plugin/src/rules/prefer-for-of.ts @@ -17,7 +17,7 @@ export default util.createRule({ }, messages: { preferForOf: - 'Expected a `for-of` loop instead of a `for` loop with this simple iteration', + 'Expected a `for-of` loop instead of a `for` loop with this simple iteration.', }, schema: [], }, diff --git a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts index 07e8e69940cc..fdad0220c39b 100644 --- a/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts +++ b/packages/eslint-plugin/src/rules/prefer-readonly-parameter-types.ts @@ -34,7 +34,7 @@ export default util.createRule({ }, ], messages: { - shouldBeReadonly: 'Parameter should be a read only type', + shouldBeReadonly: 'Parameter should be a read only type.', }, }, defaultOptions: [ diff --git a/packages/eslint-plugin/src/rules/return-await.ts b/packages/eslint-plugin/src/rules/return-await.ts index d18e41ef00e0..173596e451fe 100644 --- a/packages/eslint-plugin/src/rules/return-await.ts +++ b/packages/eslint-plugin/src/rules/return-await.ts @@ -21,11 +21,11 @@ export default util.createRule({ type: 'problem', messages: { nonPromiseAwait: - 'returning an awaited value that is not a promise is not allowed', + 'Returning an awaited value that is not a promise is not allowed.', disallowedPromiseAwait: - 'returning an awaited promise is not allowed in this context', + 'Returning an awaited promise is not allowed in this context.', requiredPromiseAwait: - 'returning an awaited promise is required in this context', + 'Returning an awaited promise is required in this context.', }, schema: [ { diff --git a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts index 414dbbcdd03d..febfaf23a79b 100644 --- a/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts +++ b/packages/eslint-plugin/src/rules/switch-exhaustiveness-check.ts @@ -23,7 +23,7 @@ export default createRule({ messages: { switchIsNotExhaustive: 'Switch is not exhaustive. Cases not matched: {{missingBranches}}', - addMissingCases: 'Add branches for missing cases', + addMissingCases: 'Add branches for missing cases.', }, }, defaultOptions: [], diff --git a/packages/eslint-plugin/src/rules/typedef.ts b/packages/eslint-plugin/src/rules/typedef.ts index 7e6f4f14965c..9545364c839c 100644 --- a/packages/eslint-plugin/src/rules/typedef.ts +++ b/packages/eslint-plugin/src/rules/typedef.ts @@ -28,8 +28,8 @@ export default util.createRule<[Options], MessageIds>({ recommended: false, }, messages: { - expectedTypedef: 'expected a type annotation', - expectedTypedefNamed: 'expected {{name}} to have a type annotation', + expectedTypedef: 'Expected a type annotation.', + expectedTypedefNamed: 'Expected {{name}} to have a type annotation.', }, schema: [ {