Skip to content

Commit

Permalink
docs: update
Browse files Browse the repository at this point in the history
  • Loading branch information
fi3ework committed Jul 7, 2024
1 parent dbf4a56 commit 302e137
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 23 deletions.
49 changes: 29 additions & 20 deletions docs/checkers/eslint.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<details>
<summary>Check out if version less than 0.7.1.</summary>

**(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.

</details>

:::

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

Expand Down
4 changes: 4 additions & 0 deletions docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 302e137

Please sign in to comment.