Skip to content

Commit

Permalink
refactor: Simplify (and avoid lgtm linting warning re: always true `w…
Browse files Browse the repository at this point in the history
…hile` condition)
  • Loading branch information
brettz9 committed Jun 3, 2020
1 parent cf6290f commit eb2c2b7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/eslint/getJSDocComment.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,7 @@ const getDecorator = (token, sourceCode) => {
do {
tokenBefore = sourceCode.getTokenBefore(tokenBefore, {includeComments: true});
// istanbul ignore if
if (!tokenBefore) {
break;
}
if (tokenBefore.type === 'Punctuator') {
if (tokenBefore && tokenBefore.type === 'Punctuator') {
if (tokenBefore.value === ')') {
nested++;
}
Expand Down

0 comments on commit eb2c2b7

Please sign in to comment.