-
Notifications
You must be signed in to change notification settings - Fork 337
chore: eslintにvitestプラグインを追加 #2628
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds the official vitest ESLint plugin to the project configuration and updates tests to comply with the new "expect-expect" rule.
- Added vitest plugin import and configuration in eslint.config.js
- Disabled the "vitest/expect-expect" rule in a couple of test files where no assertions are needed
- Renamed the engine directory check function in backend tests for consistency
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
File | Description |
---|---|
eslint.config.js | Added vitest plugin import and configuration, including the "vitest/expect-expect" rule |
tests/unit/components/help/HelpMarkdownViewSection.spec.ts | Disabled the "vitest/expect-expect" rule with an inline comment |
tests/unit/lib/hotkeyManager.spec.ts | Added an eslint inline disable for the "vitest/expect-expect" rule |
tests/unit/backend/electron/vvppFile.node.spec.ts | Renamed the engine directory check function from assertIsEngineDir to expectIsEngineDir |
Files not reviewed (2)
- package.json: Language not supported
- pnpm-lock.yaml: Language not supported
🚀 プレビュー用ページを作成しました 🚀 更新時点でのコミットハッシュ: |
Co-authored-by: Nanashi. <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
よさそう。
内容
タイトルのとおりです。公式から提供されてたので追加してみました。
今のテストだと「テストはexpectが1つ以上含まれてるべき」ルールに引っかかってるのがいくつかあったので、とりあえず対処しています。
関連 Issue
ref: #2627
その他
ぶっちゃけ恩恵はあまりない気がします。
nodeのtestをimportしてたときにエラーにするみたいなのも入ってて、初学者の助けになるかもしれない・・・?
https://github.com/vitest-dev/eslint-plugin-vitest/