Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ComposeBox [nfc]: Use optional chaining instead of
if
block.
Prompted by discussion on zulip#4101 [1]. Flow started supporting method calls in optional chains in v0.112.0 [2], but ESLint isn't yet on board [3]; it gives a false positive for `no-unused-expressions`. A comment on the ESLint issue [4] suggests we could be more systematic by using an ESLint plugin from Babel, instead of one-off suppressions of `no-unused-expressions` like this one. That plugin moved from (on NPM) `babel-eslint-plugin` to `@babel/eslint-plugin`. We can't use the new one until we're on ESLint 7 (see zulip#4254), but we could probably use the old one. [1] zulip#4101 (comment) [2] facebook/flow#4303 [3] eslint/eslint#11045 [4] eslint/eslint#11045 (comment)
- Loading branch information