Skip to content

chore: disable eslint errors for chai assertions - #11700

Merged
alumni merged 2 commits into
typeorm:nextfrom
alumni:chore/eslint-chai-friendly
Oct 1, 2025
Merged

alumni merged 2 commits into
typeorm:nextfrom
alumni:chore/eslint-chai-friendly

Conversation

@alumni

@alumni alumni commented Oct 1, 2025 •

Copy link
Copy Markdown
Collaborator

Description of change

Currently we set @typescript-eslint/no-unused-expressions to warn, which highlights a lot of errors in our chai assertions. When using both styles of assertion ("expect" and "should"), chai has side-effects which eslint is trying to prevent with this rule.

I disabled this rule for the assertions in the tests via eslint-plugin-chai-friendly, and set it to error in the rest of the code. I also corrected the remaining errors.

Before: 10807 warnings
After: 9207 warnings

Pull-Request Checklist

  • Code is up-to-date with the next branch
  • This pull request links relevant issues as Fixes #00000
  • There are new or updated unit tests validating the change
  • Documentation has been updated to reflect this change

@coderabbitai

coderabbitai Bot commented Oct 1, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@pkg-pr-new

pkg-pr-new Bot commented Oct 1, 2025

Copy link
Copy Markdown

typeorm-sql-js-example

npm i https://pkg.pr.new/typeorm/typeorm@11700

commit: 5a35625

@gioboa gioboa left a comment

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.

Thanks @alumni 👏

@alumni

alumni commented Oct 1, 2025

Copy link
Copy Markdown
Collaborator Author

If we plan to merge more than a few PRs into master, we could also cherry pick this there, so we don't get more code like this later (although I think it's not very likely). Let me know if I should cherry pick.

@gioboa

gioboa commented Oct 1, 2025

Copy link
Copy Markdown
Collaborator

I think we can merge it straight to master 👀

@alumni

alumni commented Oct 1, 2025

Copy link
Copy Markdown
Collaborator Author

And then sync next with master? We could do that too. 🤷🏻‍♂️

I'm more tempted to only do the strictly necessary for 0.3, I'd rather not put much effort into something that will be obsolete by the end of the year :)

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 76.411% (-0.03%) from 76.442%
when pulling 5a35625 on alumni:chore/eslint-chai-friendly
into a7c387b on typeorm:next.

@alumni
alumni merged commit b1680a0 into typeorm:next Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants