Skip to content

chore(lint): migrate from tslint to eslint - #2297

Merged
mbiernacik merged 2 commits into
mainfrom
migrate-tslint-to-eslint
Sep 11, 2026
Merged

mbiernacik merged 2 commits into
mainfrom
migrate-tslint-to-eslint

Conversation

@mbiernacik

Copy link
Copy Markdown
Contributor
  • Remove TSLint: Deleted tslint.json configuration files and uninstalled TSLint dependencies.
  • Configure ESLint: Extended .eslintrc.js with project-wide quality rules and import ordering.
  • Update build and scripts: Replaced the //:tslint target in BUILD with //:eslint and updated test scripts.
  • Clean up source files: Removed obsolete // tslint:disable comments.

@mbiernacik
mbiernacik requested a review from a team as a code owner September 10, 2026 12:50
@mbiernacik
mbiernacik requested review from apilaskowski and removed request for a team September 10, 2026 12:50
Comment thread scripts/lint
# imports; see .eslintrc.js and eslint-rules/).
bazel build @npm//eslint/bin:eslint && bazel-bin/external/npm/eslint/bin/eslint.sh --rulesdir eslint-rules 'core/**/*.ts'
# Run eslint.
bazel build @npm//eslint/bin:eslint && bazel-bin/external/npm/eslint/bin/eslint.sh --rulesdir eslint-rules '**/*.ts'

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Consider adding bazel run @nodejs//:yarn before running ESLint here, matching scripts/run_tests and scripts/run_integration_tests:

bazel run @nodejs//:yarn
bazel build @npm//eslint/bin:eslint && bazel-bin/external/npm/eslint/bin/eslint.sh --rulesdir eslint-rules '**/*.ts'

On a pristine checkout where node_modules is not yet populated on the host machine, running ./scripts/lint directly fails with Cannot find module '@typescript-eslint/parser' because ESLint resolves the parser declared in .eslintrc.js from the host's node_modules.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, added.

Comment thread BUILD

nodejs_binary(
name = "tslint",
name = "eslint",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note on nodejs_binary(name = "eslint", ...):
Running bazel run //:eslint -- --rulesdir eslint-rules '**/*.ts' executes inside Bazel's sandbox runfiles directory, where repository source **/*.ts files are not present. Invoking through @npm//eslint/bin:eslint via ./scripts/lint works as expected and mirrors how TSLint was previously run.

@mbiernacik
mbiernacik merged commit 8e7faa7 into main Sep 11, 2026
11 checks passed
@mbiernacik
mbiernacik deleted the migrate-tslint-to-eslint branch September 11, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants