Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vitest config #53

Merged
merged 5 commits into from
Nov 8, 2024
Merged

Fix vitest config #53

merged 5 commits into from
Nov 8, 2024

Conversation

gndelia
Copy link
Contributor

@gndelia gndelia commented Nov 7, 2024

The Vitest configuration has 2 errors:

  • By using the legacy configuration of Eslint, the rules need to be prepended with @vitest/ instead of vitest. This wasn't in the docs, and if not using the appropriate prefix, it gives an error of missing definition of rule. (I created an issue in their repo to improve the docs about this [docs] Legacy rules are prepended with "@", but it is not in the docs vitest-dev/eslint-plugin-vitest#566)

  • The config was disabling some rules that did not belong to the vitest plugin, but were from bloq/node. Commonly, with mocha, we would use bloq/node before bloq/mocha, which causes those rules to be available. We tried to replicate that here, but as I am using esm, we can't use some of the rules from bloq/node. By not including it, these rules are not defined, throwing an error as well. The correct behavior should be that every package should only disable rules from the config it extends. That's why I am removing from the vitest config the following disabling of rules:

'no-unused-expressions'
'node/no-unpublished-require'
'prefer-arrow/prefer-arrow-functions'

As the vitest config did not work, I consider this a bug fix instead of a breaking change.

@gndelia gndelia self-assigned this Nov 7, 2024
@gndelia gndelia requested a review from gabmontes as a code owner November 7, 2024 13:52
vitest.js Show resolved Hide resolved
@gndelia gndelia requested a review from gabmontes November 7, 2024 16:07
@gabmontes gabmontes merged commit e53e062 into master Nov 8, 2024
4 checks passed
@gabmontes gabmontes deleted the fix-vitest-config branch November 8, 2024 13:55
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.

5 participants