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

Commit

Permalink
Add more documentation and tests
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-hanson committed Jan 22, 2017
1 parent 5b31066 commit c384109
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/rules/noLetUndefinedRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ export class Rule extends Lint.Rules.AbstractRule {
public static metadata: Lint.IRuleMetadata = {
ruleName: "no-let-undefined",
description: "Forbids a 'let' statement to be initialized to 'undefined'.",
hasFix: true,
optionsDescription: "Not configurable.",
options: null,
optionExamples: ["true"],
Expand Down
4 changes: 4 additions & 0 deletions test/rules/no-let-undefined/test.ts.fix
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,7 @@ for (let y: number | undefined; y < 2; y++) {}

let z;

const x = undefined;

function f(x: string | undefined = undefined) {}

4 changes: 4 additions & 0 deletions test/rules/no-let-undefined/test.ts.lint
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ for (let y: number | undefined = undefined; y < 2; y++) {}

let z;

const x = undefined;

function f(x: string | undefined = undefined) {}

[0]: Unnecessary initialization to 'undefined'.

0 comments on commit c384109

Please sign in to comment.