Skip to content

Commit

Permalink
Format develop/custom-rules/index.md
Browse files Browse the repository at this point in the history
  • Loading branch information
nchen63 authored Nov 19, 2016
1 parent c2216ee commit 7c5f3a4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/develop/custom-rules/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,12 @@ Now that you're written a rule to detect problems, let's modify it to *fix* them
Instantiate a `Fix` object and pass it in as an argument to `addFailure`. This snippet replaces the offending import statement with an empty string:

```typescript
// create a fixer for this failure
const replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "");
const fix = new Lint.Fix("no-imports", [replacement]);
// create a fixer for this failure
const replacement = new Lint.Replacement(node.getStart(), node.getWidth(), "");
const fix = new Lint.Fix("no-imports", [replacement]);

// create a failure at the current position
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING, fix));
// create a failure at the current position
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING, fix));
```
---
Final notes:
Expand Down

0 comments on commit 7c5f3a4

Please sign in to comment.