Review 12.4 Merged

85613[TASK] Upgrade eslint to v9.9

Andreas Kienast CR +2 V +2 Hard +583 −416 updated 08/13/24, 11:16

Commit message

The JavaScript linter `eslint` is upgraded from v8 to v9. This also
requires an upgrade of all `@typescript-eslint` packages.

With these, some breaking changes were introduced:

* `@typescript-eslint/indent` rule is migrated to `@stylistic`
  The formating rule `@typescript-eslint/indent` has been extracted to a
  new package, as `@typescript-eslint` does not want to provide rules
  for code asthetics anymore [1].
* `@typescript-eslint/no-unused-expressions` is enabled by default
  eslint detects and reports unused expressions, which is a great thing.
  Some of our code misused this for shortcut if/else clauses. However,
  chai.js (the deep down framework used for JavaScript tests) uses this
  syntax for assertions, therefore the lint rules have been disabled for
  test files.
* `grunt-eslint` requires the newer "flat config" for eslint. The
  existing configuration has been migrated invoking the command
  `npx @eslint/migrate-config .eslintrc.js`.

Executed commands:

    npm install --save-dev \
        @stylistic/eslint-plugin \
        @typescript-eslint/eslint-plugin@^8.0.1 \
        @typescript-eslint/parser@^8.0.1 \
        @typescript-eslint/typescript-estree@^8.0.1 \
        eslint@^9.9.0 \
        eslint-plugin-lit@^1.14.0 \
        grunt-eslint@^25.0.0
    npm run build

[1] https://eslint.style/guide/why

Review

  • Code review CR +2 Done
    • Andreas Kienast +2
  • Verified V +2 Done
    • Andreas Kienast +2
    • core-ci +1 CI

Issues 1

Files 54

Show 34 more files

Review log 34

  1. Andreas Kienast uploaded patch set 1 08/13/24, 11:10

  2. core-ci voted on patch set 1 V +1 08/13/24, 11:15 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/63302

  3. Andreas Kienast voted on patch set 1 CR +2 V +2 08/13/24, 11:16

  4. Andreas Kienast merged patch set 2 08/13/24, 11:16