This is potentially a non-issue so I will leave it up to you guys to decide, it’s more of an observation with a suggestion.
The rule roblox-ts/lua-truthiness can cause some awkward auto-fixing in the linter which produces logical errors that, if not caught when the linter runs, could create annoying to debug problems.
which obviously has a different output than what the programmer is most likely expecting when they wrote the line.
I don’t know if it’s possible to fix this case within the rule itself?
But if not, I think it would be preferable for roblox-ts/lua-truthiness to not auto-fix by default, if that is a thing that can be configured?
Obviously, the fix for this on a case by case basis is to add eslint-disable-next-line roblox-ts/lua-truthiness to lines where this happens.
Again, feel free to close this as it’s not really a big deal, it really only applies if people write code and the linter changes it without them noticing / realising.
Version
1.0.0-beta.14
Hey
This is potentially a non-issue so I will leave it up to you guys to decide, it’s more of an observation with a suggestion.
The rule roblox-ts/lua-truthiness can cause some awkward auto-fixing in the linter which produces logical errors that, if not caught when the linter runs, could create annoying to debug problems.
Consider this code:
If you put this into your editor:
And the linter runs as it is setup by default - it will auto-fix to this:
which obviously has a different output than what the programmer is most likely expecting when they wrote the line.
I don’t know if it’s possible to fix this case within the rule itself?
But if not, I think it would be preferable for roblox-ts/lua-truthiness to not auto-fix by default, if that is a thing that can be configured?
Obviously, the fix for this on a case by case basis is to add
eslint-disable-next-line roblox-ts/lua-truthiness
to lines where this happens.Again, feel free to close this as it’s not really a big deal, it really only applies if people write code and the linter changes it without them noticing / realising.
Thanks, and roblox-ts is truly awesome :)