Skip to content

Commit

Permalink
fix(eslint-plugin): fix no-base-to-string for old ts verion boolean type
Browse files Browse the repository at this point in the history
  • Loading branch information
duduluu committed Apr 25, 2020
1 parent 93fb661 commit a98d6d8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions packages/eslint-plugin/src/rules/no-base-to-string.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ export default util.createRule<Options, MessageIds>({
return Usefulness.Always;
}

// Patch for old version TypeScript, the Boolean type definition missing toString()
if (type.flags & ts.TypeFlags.BooleanLiteral) {
return Usefulness.Always;
}

if (
toString.declarations.every(
({ parent }) =>
Expand Down

0 comments on commit a98d6d8

Please sign in to comment.