-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
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 |
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghas prthere is a PR raised to close thisthere is a PR raised to close thispackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin