diff --git a/README.md b/README.md index 3359e2a..22295e5 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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" ] } ``` diff --git a/package.json b/package.json index fe7b0c1..2092454 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,8 @@ "files": [ "jest.js", "react.js", - "playwright.js" + "playwright.js", + "vitest.js" ], "peerDependencies": { "@typescript-eslint/eslint-plugin": ">= 5", @@ -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": { @@ -42,6 +44,9 @@ }, "eslint-plugin-jest": { "optional": true + }, + "eslint-plugin-vitest": { + "optional": true } }, "dependencies": { diff --git a/vitest.js b/vitest.js new file mode 100644 index 0000000..925d2b0 --- /dev/null +++ b/vitest.js @@ -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", + }, + }, + ], +}