Skip to content

chore(eslint): remove unused eslint-plugin-chai-friendly config - #27879

Merged
mroz22 merged 1 commit into
developfrom
mroz22/check-chai-friendly-config
May 25, 2026
Merged

chore(eslint): remove unused eslint-plugin-chai-friendly config#27879
mroz22 merged 1 commit into
developfrom
mroz22/check-chai-friendly-config

Conversation

@mroz22

@mroz22 mroz22 commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Stumbled upon this while browsing the repo: packages/eslint/src/chaiFriendlyConfig.mjs is dead code.

The eslint-plugin-chai-friendly plugin exists to stop no-unused-expressions from flagging chai assertions like expect(foo).to.be.true. The repo does not use chai anywhere — tests are jest/vitest with .toBe(...)/.toEqual(...). The only occurrence of chai in the tree is a transitive entry in yarn.lock.

The inline comment in the file even acknowledged the override does not cover @typescript-eslint/no-unused-expressions, so even hypothetically it would not have helped.

Changes:

  • Delete packages/eslint/src/chaiFriendlyConfig.mjs
  • Remove the import + spread in packages/eslint/src/index.mjs
  • Drop eslint-plugin-chai-friendly from packages/eslint/package.json
  • yarn dedupe — lockfile diff included (only the plugin entry is removed)

Test plan

  • CI lint passes
  • yarn workspace @trezor/eslint type-check passes

🤖 LLM Test Recommendations

Summary: The only changed file is packages/eslint/package.json, which is a development-time ESLint configuration package. This change affects linting tooling only and has no impact on runtime application behavior, UI components, or any user-facing functionality. There is no static test coverage mapping, and no E2E test — including the Connect popup webextension test — exercises or depends on ESLint configuration. No E2E tests need to be run for this change.

Changed files (1)
  • packages/eslint/package.json

No test recommendations found.

⚠️ Changes with no test coverage (1)

  • packages/eslint/package.json

Updated: 2026-05-20T09:38:15.615Z

🔍 Currents Test Results

🔍 Suite desktop test results: View in Currents

🔍 Suite web test results: View in Currents

🌐 Preview deployments

🌐 Suite Web preview: https://dev.suite.sldev.cz/suite-web/mroz22/check-chai-friendly-config/web/

🔒 Quarantined E2E Tests

Trezor Suite (web) — 4 test(s)
Test Type
Quarantine test: "Onboarding - create wallet,Success (basic)" 🙋 manual
Quarantine test: "Database migration,Db migration between: release/22.5/web => develop/web" 🙋 manual
Quarantine test: "Multiple sessions,Session overtaken by another" 🙋 manual
Quarantine test: "Recovery T2T1 - dry run,Recovery after partial recovery" 🙋 manual

Updated: 2026-05-20T09:43:34.350Z • 4 test(s) total

Trezor Suite (desktop) — 2 test(s)
Test Type
Onboarding - create wallet > Success (basic) 🤖 auto
Quarantine test: "Multiple sessions,Session overtaken by another" 🙋 manual

Updated: 2026-05-20T09:41:58.102Z • 2 test(s) total

@mroz22 mroz22 added code Code improvements no-project This label is used to specify that PR doesn't need to be added to a project labels May 20, 2026
The chai-friendly ESLint plugin tolerates chai assertion expressions
like `expect(foo).to.be.true` from being flagged by no-unused-expressions.
The repo does not use chai (only jest/vitest with `.toBe(...)`), so this
config was dead code. The plugin also did not cover
@typescript-eslint/no-unused-expressions as the inline comment noted.
@mroz22
mroz22 force-pushed the mroz22/check-chai-friendly-config branch from b2e169b to a4736d1 Compare May 20, 2026 11:28
@trezor-bot

trezor-bot Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

✅ Previously successful run of [Test] PR Suite Web e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@trezor-bot

trezor-bot Bot commented May 20, 2026

Copy link
Copy Markdown
Contributor

✅ Previously successful run of [Test] PR Suite Desktop e2e tests workflow has been found.
⏭️ Skipping tests for this run.
💡 If you are unsure about your latest changes, please rerun the workflow manually. (Use the Re-run all jobs option)

@mroz22
mroz22 marked this pull request as ready for review May 20, 2026 11:36
@mroz22
mroz22 requested a review from karliatto as a code owner May 20, 2026 11:36
@mroz22

mroz22 commented May 20, 2026

Copy link
Copy Markdown
Contributor Author

I only hope that changes to the eslint package invalidate nx cache so the entire lint:js suite runs over all packages. Is my assumption correct @copilot ?

Copilot AI commented May 20, 2026

Copy link
Copy Markdown
Contributor

I only hope that changes to the eslint package invalidate nx cache so the entire lint:js suite runs over all packages. Is my assumption correct @copilot ?

Yes — for linting, that assumption is correct. yarn lint:js runs nx affected --target=lint:js, and every lint:js target includes packages/eslint/**/* in its Nx inputs (nx.json). So any change in @trezor/eslint invalidates the Nx lint cache for all projects that have a lint:js target, which means CI will rerun those lint tasks instead of restoring them from cache.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Removes the unused Chai-specific ESLint override from the shared @trezor/eslint config package, along with its dependency and lockfile entry, since the repo does not use Chai assertions.

Changes:

  • Deleted the chaiFriendlyConfig flat-config module and stopped including it in the exported ESLint config array.
  • Removed eslint-plugin-chai-friendly from @trezor/eslint devDependencies.
  • Cleaned up related references in the dependency list script and yarn.lock.

Reviewed changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
yarn.lock Removes the eslint-plugin-chai-friendly lock entry after dedupe.
scripts/list-outdated-dependencies/foundation-dependencies.txt Drops eslint-plugin-chai-friendly from the tracked foundation deps list.
packages/eslint/src/index.mjs Removes import/spread of chaiFriendlyConfig from the exported flat config.
packages/eslint/src/chaiFriendlyConfig.mjs Deletes the unused Chai-friendly rule override module.
packages/eslint/package.json Removes eslint-plugin-chai-friendly from devDependencies.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@mroz22
mroz22 requested a review from Lemonexe May 22, 2026 06:34

@Lemonexe Lemonexe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, indeed chai seems to be unused for a long time.
And eslint is passing (in the first run it ran all workspaces)

@mroz22
mroz22 merged commit 2b9f6eb into develop May 25, 2026
34 checks passed
@mroz22
mroz22 deleted the mroz22/check-chai-friendly-config branch May 25, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code Code improvements no-project This label is used to specify that PR doesn't need to be added to a project

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants