Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-string-literal: Fix documentation #2875

Merged
merged 1 commit into from
Jun 5, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/rules/noStringLiteralRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down