Skip to content

Commit

Permalink
Update prefer-string-slice example (#607)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Mar 16, 2020
1 parent 2ef7a21 commit ee6a915
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions docs/rules/prefer-string-slice.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@

This rule is partly fixable.


## Fail

```js
foo.substr(1, 2);
foo.substring(1, 3);
foo.substr(start, length);
foo.substring(indexStart, indexEnd);
```


## Pass

```js
foo.slice(1, 3);
foo.slice(beginIndex, endIndex);
```

0 comments on commit ee6a915

Please sign in to comment.