Closed
Description
Thanks for #1969 :-)
Found a real bug while testing no-base-to-string :-)
Repro
{
"rules": {
"@typescript-eslint/no-base-to-string": ["error"]
}
}
((myvar1: string | number | boolean) => {
myvar1.toString();
})('');
((myvar1: string | number | boolean | null) => {
myvar1.toString();
})('');
((myvar1: number | boolean | null) => {
myvar1.toString();
})(true);
Expected Result
should lint without problems
Actual Result
warning @typescript-eslint/no-base-to-string : 'myvar1 may evaluate to '[object Object]' when stringified.
for all of them
Versions
package | version |
---|---|
@typescript-eslint/eslint-plugin |
2.31.0 |
@typescript-eslint/parser |
2.31.0 |
TypeScript |
3.8.3 |
ESLint |
6.8.0 |
node |
X.Y.Z |
npm |
X.Y.Z |