Skip to content

Commit

Permalink
fix: check if variable close has a value (#24)
Browse files Browse the repository at this point in the history
* fix: check if variable close has a value

fixes #23

* chore: eslint
  • Loading branch information
simllll authored and ota-meshi committed Jan 27, 2020
1 parent 470ca80 commit df5dd86
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions lib/rules/require-scoped.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ module.exports = {
messageId: "add",
fix(fixer) {
const close = tokenStore.getLastToken(node.startTag)
return fixer.insertTextBefore(
// eslint-disable-next-line @mysticatea/ts/ban-ts-ignore, spaced-comment
/// @ts-ignore
close,
" scoped",
return (
close &&
fixer.insertTextBefore(
// eslint-disable-next-line @mysticatea/ts/ban-ts-ignore, spaced-comment
/// @ts-ignore
close,
" scoped",
)
)
},
},
Expand Down

0 comments on commit df5dd86

Please sign in to comment.