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
{{ message }}
Repository navigation
Always-false-condition in editorServices.ts #17892
is always false as the called method closeExternalProject always returns void. That way the if-block with shouldRefreshInferredProjects = true; is never executed (for more information see the linter rule detecting this).
I had a test for always-truthy values that attempted to find bugs like if (x.f) (in lieu of if (x.f()) {) but the problem was that non-strictNullChecks .d.ts file gave tons of false positives. Checking for void values in control flow test positions should be a home run
Activity
mhegazy commentedon Aug 18, 2017
thanks for the report. a PR would be appreciated.
RyanCavanaugh commentedon Aug 19, 2017
Mohamed Hegazy (@mhegazy) seems like using a
voidvalue in a truthiness position is hyper-sketchy - thoughts on making that an error in TS?mhegazy commentedon Aug 21, 2017
i thought you had experimented with this a while back; I think it is a check worth adding, baring any breaks that we might find from RWC tests.
RyanCavanaugh commentedon Aug 22, 2017
I had a test for always-truthy values that attempted to find bugs like
if (x.f)(in lieu ofif (x.f()) {) but the problem was that non-strictNullChecks .d.ts file gave tons of false positives. Checking forvoidvalues in control flow test positions should be a home runmhegazy commentedon Aug 22, 2017
i think the
voidcheck should only flag errors. seems like a low risk-high yield change to make.ts.server.ProjectService.closeConfiguredProject returns true on success.
ts.server.ProjectService.closeConfiguredProject returns true on succe…