Skip to content

Consider updating to ECMA version 2022 #12623

@javagl

Description

@javagl

(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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions