From d802bd77e45e095c0452635819cdb7eb492b47f2 Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Mon, 5 Jun 2017 11:02:46 -0700 Subject: [PATCH] no-string-literal: Fix documentation (#2875) --- src/rules/noStringLiteralRule.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) 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],