You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary". Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary.
ImBIOS
changed the title
bug: unnecessary conditional, value is always falsy.
bug: improve unnecessary conditional, value is always falsy.
Dec 17, 2024
Provide environment information
System:
OS: Linux 6.8 Ubuntu 24.04.1 LTS 24.04.1 LTS (Noble Numbat)
CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
Memory: 3.06 GB / 15.41 GB
Container: Yes
Shell: 5.9 - /bin/zsh
Binaries:
Node: 20.18.0 - ~/.proto/shims/node
Yarn: 3.4.1 - ~/.proto/shims/yarn
npm: 10.8.1 - ~/.proto/shims/npm
bun: 1.1.38 - ~/.bun/bin/bun
Watchman: 2024.12.02.00 - /home/linuxbrew/.linuxbrew/bin/watchman
Describe the bug
Any expression being used as a condition must be able to evaluate as truthy or falsy in order to be considered "necessary". Conversely, any expression that always evaluates to truthy or always evaluates to falsy, as determined by the type of the expression, is considered unnecessary.
Reproduction repo
create-t3-app/cli/template/extras/src/server/api/trpc-app/with-auth.ts
Line 121 in d22a0bf
To reproduce
here:
create-t3-app/cli/template/extras/src/server/api/trpc-app/with-auth.ts
Line 121 in d22a0bf
Additional information
Isn't this is better:
The text was updated successfully, but these errors were encountered: