diff --git a/docs/checkers/eslint.md b/docs/checkers/eslint.md index 1005fa8d..b904a577 100644 --- a/docs/checkers/eslint.md +++ b/docs/checkers/eslint.md @@ -4,29 +4,38 @@ 1. Make sure [eslint](https://www.npmjs.com/package/eslint) and related plugins for your `eslintrc` are installed as peer dependencies. - ::: warning - **(Optional but highly recommended)** Install `optionator@^0.9.1` with your package manager. It's needed because of ESLint dependents on it. It's probably working fine even it's not installed as it's accessed as a phantom dependency. But when you set `hoist=false` of pnpm. It won't be accessible anymore without explicit installation. - ::: +:::warning + +
+Check out if version less than 0.7.1. + +**(Optional but highly recommended)** Install `optionator@^0.9.1` with your package manager. It's needed because of ESLint dependents on it. It's probably working fine even it's not installed as it's accessed as a phantom dependency. But when you set `hoist=false` of pnpm. It won't be accessible anymore without explicit installation. + +From 0.7.1, the plugin will resolve optionator from eslint's path, so no more need to install it explicitly. + +
+ +::: 2. Add `eslint` field to plugin config and `options.eslint.lintCommand` is required. The `lintCommand` is the same as the lint command of your project. The default root of the command uses Vite's [root](https://vitejs.dev/config/#root). - :::tip - Do not add `--fix` to the lint command since the plugin is only aiming at checking issues. - ::: - - ```js - // e.g. - export default { - plugins: [ - checker({ - eslint: { - // for example, lint .ts and .tsx - lintCommand: 'eslint "./src/**/*.{ts,tsx}"', - }, - }), - ], - } - ``` +:::tip +Do not add `--fix` to the lint command since the plugin is only aiming at checking issues. +::: + +```js +// e.g. +export default { + plugins: [ + checker({ + eslint: { + // for example, lint .ts and .tsx + lintCommand: 'eslint "./src/**/*.{ts,tsx}"', + }, + }), + ], +} +``` ## Configuration diff --git a/docs/package.json b/docs/package.json index 802fc461..407f1c72 100644 --- a/docs/package.json +++ b/docs/package.json @@ -2,6 +2,10 @@ "private": true, "name": "docs", "type": "module", + "scripts": { + "dev": "vitepress dev", + "build": "vitepress build" + }, "dependencies": { "@vueuse/core": "^8.9.4", "body-scroll-lock": "4.0.0-beta.0", diff --git a/package.json b/package.json index 5215d24a..1a42e1be 100644 --- a/package.json +++ b/package.json @@ -43,9 +43,8 @@ "test-build-cjs": "cross-env VITEST_TEST_CJS=1 pnpm run test-build", "test-unit:watch": "vitest", "type-check": "pnpm -r --parallel --filter \"vite-plugin-checker\" exec tsc --noEmit", - "docs:dev": "pnpm --filter docs exec vitepress dev .", - "docs:build": "pnpm --filter docs exec vitepress build .", - "docs:serve": "pnpm --filter docs exec vitepress serve .", + "docs:dev": "pnpm --filter docs run dev", + "docs:build": "pnpm --filter docs run build", "release": "cp README.md packages/vite-plugin-checker/README.md && changeset publish && git push --follow-tags" }, "simple-git-hooks": {