Skip to content
This repository was archived by the owner on Feb 11, 2025. It is now read-only.

Commit 325b65a

Browse files
authoredMar 5, 2024··
feat(eslint): add vitest config (#96)
1 parent d39b95f commit 325b65a

File tree

5 files changed

+120
-0
lines changed

5 files changed

+120
-0
lines changed
 

‎README.md

+1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ The following additional configs are available:
8888
- `@vercel/style-guide/eslint/playwright-test`
8989
- `@vercel/style-guide/eslint/react`
9090
- `@vercel/style-guide/eslint/typescript` (requires `typescript` to be installed and [additional configuration](#configuring-eslint-for-typescript))
91+
- `@vercel/style-guide/eslint/vitest`
9192

9293
> You'll need to use `require.resolve` to provide ESLint with absolute paths,
9394
> due to an issue around ESLint config resolution (see

‎eslint/rules/vitest.js

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
module.exports = {
2+
rules: {
3+
/**
4+
* Disallow duplicate setup and teardown hooks.
5+
*
6+
* 🚫 Not fixable - https://github.com/veritem/eslint-plugin-vitest/blob/HEAD/docs/rules/no-duplicate-hooks.md
7+
*/
8+
'vitest/no-duplicate-hooks': 'error',
9+
/**
10+
* Require lowercase test names.
11+
*
12+
* 🔧 Fixable - https://github.com/veritem/eslint-plugin-vitest/blob/HEAD/docs/rules/prefer-lowercase-title.md
13+
*/
14+
'vitest/prefer-lowercase-title': 'warn',
15+
},
16+
};

‎eslint/vitest.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
extends: ['plugin:vitest/recommended', require.resolve('./rules/vitest')],
3+
};

‎package.json

+1
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
"eslint-plugin-testing-library": "^6.0.1",
5656
"eslint-plugin-tsdoc": "^0.2.17",
5757
"eslint-plugin-unicorn": "^48.0.1",
58+
"eslint-plugin-vitest": "^0.3.22",
5859
"prettier-plugin-packagejson": "^2.4.5"
5960
},
6061
"devDependencies": {

‎pnpm-lock.yaml

+99
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
This repository has been archived.