-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
(Originally brought up in #12567 (comment) )
The eslint-config-cesium configuration for browsers currently sets ecmaVersion: 2020. I think that it could make sense to update this to ecmaVersion: 2021 or 2022.
With this version, the ESlint rule "logical-assignment-operators": ["error", "always"], could be enabled. This would complain about thousands of places where the defaultValue was recently changed, suggesting to change things like
options.contextOptions.webgl = options.contextOptions.webgl ?? {};
to
options.contextOptions.webgl ??= {};
but I think this would be nice, because it could tremendously decrease duplication.
Other places are then about the 'destroy' pattern, where
primitive = primitive && !primitive.isDestroyed() && primitive.destroy();
would become
primitive &&= !primitive.isDestroyed() && primitive.destroy();
which could also be a nice improvement.