Skip to content

Commit

Permalink
added notes and fixed avoid-throw fix command
Browse files Browse the repository at this point in the history
  • Loading branch information
dbale-altoros committed Jul 6, 2023
1 parent e0b4c01 commit 74f6707
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -68,6 +68,8 @@ Commands:
stdin [options] linting of source code data provided to STDIN
```
### Note
`--fix` option currently works only on "avoid-throw" and "avoid-sha3" rules

## Configuration

2 changes: 1 addition & 1 deletion lib/rules/security/avoid-throw.js
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ class AvoidThrowChecker extends BaseChecker {
// we don't use just `node.range` because ThrowStatement includes the semicolon and the spaces before it
// we know that node.range[0] is the 't' of throw
// we're also pretty sure that 'throw' has 5 letters
fixer.replaceTextRange([node.range[0], node.range[0] + 5], 'revert()')
fixer.replaceTextRange([node.range[0], node.range[0] + 5], 'revert();')
)
}
}

0 comments on commit 74f6707

Please sign in to comment.