Skip to content

Bump ESLint and update linting rules #2878

@gerteck

Description

@gerteck

Please confirm that you have searched existing issues in the repo

Yes, I have searched the existing issues

Any related issues?

#2836, #2876, #2863

What is the area that this feature belongs to?

Code Quality, Syntax

Is your feature request related to a problem? Please describe.

Our current ESLint configuration and ruleset are outdated and are starting to hold back our development, particularly when using modern ECMAScript features. As noted in recent PRs, it's time to bump our ESLint dependency and modernize our .eslintrc.js file.

Some noted issues:

  1. Outdated Lodash Rules: We currently rely on plugin:lodash/recommended (added a few years ago). Modern JS/Node has native equivalents for many Lodash methods, so we shouldn't enforce Lodash usage by default or depend on it unnecessarily.
  2. for...of Loop Restrictions: We need to use // eslint-disable-next-line no-restricted-syntax to use for...of loops (e.g., for (const ext of possibleExts)). But is really applicable pre-2016 , as highlighted by @Harjun751 in Add support for both CJS/ESM plugins #2876
  1. ESLint v9 Flat Config Migration:: If bump ESLint to version 9.x, .eslintrc.js format used is deprecated. Migrate to new "Flat Config" format (eslint.config.js). Changes how plugins, ignores, and overrides are declared, considerable massive rewrite, else just bump to ESLint v8.x, not v9.
  2. Airbnb Config is Stagnant: we extend airbnb-base and airbnb-typescript/base, but it is overly strict and may not have adapted to modern JS/TS paradigms. Consider switching to standard @eslint/js recommended configs and @typescript-eslint/recommended, which are much easier to maintain.
  3. Environment Flags: We have "env": { "node": true, "es6": true, "jest": true }. If we are moving to ESM (import/export and import.meta), we will also want to ensure our TS parser or ESLint environment is recognizing ES2022+ so modern globals are properly linted without errors.

Some (Non-exhaustive) Tasks to consider:

  • Bump ESLint to the latest version to support modern ECMAScript features natively.
  • Update @typescript-eslint packages to their latest compatible versions.
  • Fix no-restricted-syntax: Remove the restriction on ForOfStatement.
  • Re-evaluate Lodash Plugin: Remove or downgrade plugin:lodash/recommended to allow native JS methods, or use a more modern alternative.
  • Fix ESM Parsing: Update parser options so ESLint’s type-aware setup correctly recognizes NodeNext/ESM. (e.g., wiring the CLI tsconfig into the root ESLint config or adding parserOptions.project: ['./tsconfig.lint.json'] to the TS override in packages/cli/.eslintrc.cjs).

Describe the solution you'd like

Updated dev tooling for our linter

Describe alternatives you've considered

No response

Additional context

Thanks @Harjun751 for suggesting this, feel free to add on to this laundry list as we continue development, created the issue for tracking

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