diff --git a/src/rules/noStringLiteralRule.ts b/src/rules/noStringLiteralRule.ts index 2c6b20bdd0a..f4e0a459a14 100644 --- a/src/rules/noStringLiteralRule.ts +++ b/src/rules/noStringLiteralRule.ts @@ -24,8 +24,13 @@ export class Rule extends Lint.Rules.AbstractRule { /* tslint:disable:object-literal-sort-keys */ public static metadata: Lint.IRuleMetadata = { ruleName: "no-string-literal", - description: "Disallows object access via string literals.", - rationale: "Encourages using strongly-typed property access.", + description: Lint.Utils.dedent` + Forbids unnecessary string literal property access. + Allows \`obj["prop-erty"]\` (can't be a regular property access). + Disallows \`obj["property"]\` (should be \`obj.property\`).`, + rationale: Lint.Utils.dedent` + If \`--noImplicitAny\` is turned off, + property access via a string literal will be 'any' if the property does not exist.`, optionsDescription: "Not configurable.", options: null, optionExamples: [true],