const map = new Map<string, number>();
const x = map.get("foo");
if (!x) {
throw "Couldn't find x!";
}
On line 3, ESLint reports:
0, NaN, and "" are falsy in TS. If intentional, disable this rule by placing `"roblox-ts/lua-truthiness": "off"` in your .eslintrc file in the "rules" object.eslint(roblox-ts/lua-truthiness)
Auto-fixing that line, results in:
if (!x !== undefined) {
(which is incorrect, should be if (x === undefined) {)
But that auto-fix results in the same issue and will infinitely add more !== undefined
The following code creates the bug:
On line 3, ESLint reports:
Auto-fixing that line, results in:
if (!x !== undefined) {
(which is incorrect, should beif (x === undefined) {
) But that auto-fix results in the same issue and will infinitely add more!== undefined
i.e.