Skip to content

Clean up deprecated ESLint rules - #288198

Open
TamerlanG wants to merge 4 commits into
elastic:mainfrom
TamerlanG:cleanup-deprecated-eslint-rules
Open

Clean up deprecated ESLint rules#288198
TamerlanG wants to merge 4 commits into
elastic:mainfrom
TamerlanG:cleanup-deprecated-eslint-rules

Conversation

@TamerlanG

@TamerlanG TamerlanG commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

Summary

Why

These rules are deprecated, obsolete, invalid, or ineffective. Cleaning them up now avoids carrying known ESLint policy debt into the ongoing Oxlint migration. The successor rules preserve the intended constraints while tracking maintained implementations.

Deprecation and removal evidence

  • ESLint marks no-new-symbol deprecated since v9 and directs users to no-new-native-nonconstructor.
  • typescript-eslint marks prefer-ts-expect-error deprecated and directs users to ban-ts-comment.
  • ESLint deprecated no-return-await because modern ECMAScript no longer adds an extra microtask and returning an awaited promise improves stack traces.
  • jsx-a11y documents no-onchange as deprecated because the browser behavior it targeted was corrected.
  • typescript-eslint does not export a no-undef extension rule and recommends disabling core no-undef for TypeScript.
  • ESLint marks one-var-declaration-per-line, padded-blocks, and quotes deprecated formatting rules; Kibana already disables them through its final eslint-config-prettier override.

This PR deliberately leaves @typescript-eslint/no-empty-interface and @typescript-eslint/no-var-requires unchanged. Their successors broaden enforcement: no-empty-object-type affects existing empty contracts and suppressions, while no-require-imports also rejects standalone side-effect require() calls. Those require dedicated migrations rather than a configuration-only cleanup.

Verification

  • verified no-new-native-nonconstructor directly with Kibana's pinned ESLint 8.57.0: it reports both new Symbol() and new BigInt() and ignores shadowed constructors
  • verified the repository config activates no-new-native-nonconstructor in the intended scopes
  • verified the replacement ban-ts-comment policy rejects @ts-ignore while allowing @ts-expect-error
  • yarn kbn bootstrap
  • node scripts/eslint_all_files --no-cache (102,948 files)

@TamerlanG TamerlanG added backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team labels Aug 31, 2026
@TamerlanG
TamerlanG marked this pull request as ready for review August 31, 2026 20:35
@TamerlanG
TamerlanG requested review from a team as code owners August 31, 2026 20:35
@TamerlanG
TamerlanG requested a review from yansavitski August 31, 2026 20:35
@infra-vault-gh-plugin-prod

Copy link
Copy Markdown

Pinging @elastic/kibana-operations (Team:Operations)

@kibanamachine

Copy link
Copy Markdown
Contributor

💛 Build succeeded, but was flaky

Failed CI Steps

Metrics [docs]

Unknown metric groups

ESLint disabled line counts

id before after diff
@kbn/alerting-v2-rule-form 2 1 -1
@kbn/file-upload 9 8 -1
total -2

Total ESLint disabled count

id before after diff
@kbn/alerting-v2-rule-form 2 1 -1
@kbn/file-upload 9 8 -1
total -2

Test Failures

  • [job] [logs] Jest Tests #7 / Bulk actions menu omits bulk delete when delete is not granted
  • [job] [logs] Jest Tests #7 / DiscoverDocumentFlyout keeps the instance from the results when the direct fetch finishes after them
  • [job] [logs] Scout Lane #3 - stateful-classic / default / local-stateful-classic - Discover tabs - opening a new tab - should be able to complete all quickly opened tabs
  • [job] [logs] Scout Lane #3 - stateful-classic / default / local-stateful-classic - Discover tabs - tab preview - should preserve content after saving and loading
  • [job] [logs] Scout Lane #3 - stateful-classic / default / local-stateful-classic - Discover tabs - time range - should save different time ranges when the switch is on
  • [job] [logs] Scout Lane #5 - stateful-classic / default / local-stateful-classic - Lens ESQL dashboard inline editing - should add a limit without changing the chart type or the color

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip This PR does not require backporting release_note:skip Skip the PR/issue when compiling release notes Team:Operations Kibana-Operations Team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants