Typescript target warnings after Angular 15 update

Discussão em 'Angular' iniciado por Konrad, Outubro 2, 2024.

  1. Konrad

    Konrad Guest

    I updated my angular app to Angular 15. It builds ok - unless some warnings like:


    TypeScript compiler options "target" and "useDefineForClassFields" are set to "ES2022" and "false" respectively by the Angular CLI.
    ​

    My tsconfig.json sets the target to ES6:

    {
    ...
    "compilerOptions": {
    "target": "ES6",
    ...
    }
    }


    The documentation says:


    Internally the Angular CLI now always set the TypeScript target to ES2022 and useDefineForClassFields to false unless the target is set to ES2022 or later in the TypeScript configuration.

    https://github.com/angular/angular-cli/blob/main/CHANGELOG.md
    ​

    And my .browserslistrc looks the same for month with no changes since the beginning:

    last 1 Chrome version
    last 1 Firefox version
    last 2 Edge major versions
    last 2 Safari major versions
    last 2 iOS major versions
    Firefox ESR


    Thus, how can I get rid of this warning?

    Continue reading...

Compartilhe esta Página