Skip to content

Commit

Permalink
feat: Add vitest config
Browse files Browse the repository at this point in the history
  • Loading branch information
mskelton committed Aug 23, 2023
1 parent d8f90c3 commit bfda8cc
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ above.
npm install -D eslint-plugin-react eslint-plugin-react-hooks
```

### Vitest

If using Vitest, install the following peer dependencies in addition to the list
above.

```sh
npm install -D eslint-plugin-vitest
```

### Jest

If using Jest, install the following peer dependencies in addition to the list
Expand All @@ -47,7 +56,9 @@ want for your project.
"extends": [
"@mskelton",
"@mskelton/eslint-config/react",
"@mskelton/eslint-config/jest"
"@mskelton/eslint-config/vitest",
"@mskelton/eslint-config/jest",
"@mskelton/eslint-config/playwright"
]
}
```
9 changes: 7 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@
"files": [
"jest.js",
"react.js",
"playwright.js"
"playwright.js",
"vitest.js"
],
"peerDependencies": {
"@typescript-eslint/eslint-plugin": ">= 5",
Expand All @@ -31,7 +32,8 @@
"eslint-plugin-jest": ">= 25",
"eslint-plugin-react": ">= 7",
"eslint-plugin-react-hooks": ">= 4",
"eslint-plugin-sort": ">= 2.10.0"
"eslint-plugin-sort": ">= 2.10.0",
"eslint-plugin-vitest": ">= 0.2.8"
},
"peerDependenciesMeta": {
"eslint-plugin-react": {
Expand All @@ -42,6 +44,9 @@
},
"eslint-plugin-jest": {
"optional": true
},
"eslint-plugin-vitest": {
"optional": true
}
},
"dependencies": {
Expand Down
12 changes: 12 additions & 0 deletions vitest.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
module.exports = {
overrides: [
{
extends: ["plugin:vitest/all"],
plugins: ["vitest"],
files: ["*.{spec,test}.{js,jsx,cjs,mjs,ts,tsx,cts,mts}"],
rules: {
"vitest/no-hooks": "off",
},
},
],
}

0 comments on commit bfda8cc

Please sign in to comment.