Skip to content

Commit 8c0f9fd

Browse files
committed
docs: polish doc
1 parent fee7924 commit 8c0f9fd

File tree

11 files changed

+64
-54
lines changed

11 files changed

+64
-54
lines changed

docs/.vitepress/config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ function sidebar() {
4040
{ text: 'TypeScript', link: '/checkers/typescript' },
4141
{ text: 'vue-tsc', link: '/checkers/vue-tsc' },
4242
{ text: 'ESLint', link: '/checkers/eslint' },
43-
{ text: 'VLS', link: '/checkers/vls' },
4443
{ text: 'Stylelint', link: '/checkers/stylelint' },
44+
{ text: 'VLS', link: '/checkers/vls' },
4545
],
4646
},
4747
{
@@ -52,7 +52,7 @@ function sidebar() {
5252
{
5353
text: 'FAQs',
5454
collapsible: true,
55-
items: [{ text: 'Troubleshooting ', link: '/faq/troubleshooting' }],
55+
items: [{ text: 'Integration', link: '/faq/integration' }],
5656
},
5757
]
5858
}

docs/checkers/eslint.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
1. Make sure [eslint](https://www.npmjs.com/package/eslint) and related plugins for your `eslintrc` are installed as peer dependencies.
66

7-
::: warning
8-
**(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.
9-
10-
:::
7+
::: warning
8+
**(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.
9+
:::
1110

1211
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).
1312

13+
:::tip
1414
Do not add `--fix` to the lint command since the plugin is only aiming at check issues.
15+
:::
1516

1617
```js
1718
// e.g.

docs/checkers/overview.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
# Checkers overview
22

3-
vite-plugin-checkers provide built-in checkers. For now, it provides [TypeScript](/checkers/typescript), [ESLint](/checkers/eslint), [vue-tsc](/checkers/vue-tsc), [VLS](/checkers/vls), [Stylelint](/checkers/stylelint).
3+
vite-plugin-checkers provide built-in checkers. For now, it supports [TypeScript](/checkers/typescript), [ESLint](/checkers/eslint), [vue-tsc](/checkers/vue-tsc), [VLS](/checkers/vls), [Stylelint](/checkers/stylelint).
44

55
## How to add a checker
66

7-
- Set to `true` to use a checker with its default value (except ESLint and Stylelint).
8-
- Leave the field blank or `false` to disable the checker.
9-
- Make sure to install the peer dependencies indicated of each checker.
7+
- Set the checker property to `true` to use a checker with its default value (except ESLint and Stylelint).
8+
- Leave the field blank or `false` will not use the checker.
9+
- Make sure to install the peer dependencies that checker relies on (documented on each checker's page if needed).
1010
- Checker can be enabled with an advanced object config.
11+
- Use [config](/configuration/config) to control the common behaviors settings of checkers.

docs/checkers/stylelint.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,15 @@
44

55
1. Make sure [stylelint](https://www.npmjs.com/package/stylelint) and related plugins for your `stylelintrc` are installed as peer dependencies.
66

7-
::: warning
8-
**(Optional but highly recommended)** Install `meow@^9.0.0` with your package manager. It's needed because of Stylelint 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.
9-
10-
:::
7+
::: warning
8+
**(Optional but highly recommended)** Install `meow@^9.0.0` with your package manager. It's needed because of Stylelint 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.\
9+
:::
1110

1211
2. Add `stylelint` field to plugin config and `options.stylelint.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).
1312

13+
:::tip
1414
Do not add `--fix` to the lint command since the plugin is only aiming at check issues.
15+
:::
1516

1617
```js
1718
// e.g.

docs/checkers/typescript.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,11 @@ You can use TypeScript checker for vanilla TypeScript project or React project.
88

99
2. Add `typescript` field to plugin config.
1010

11-
```js
12-
export default {
13-
plugins: [checker({ typescript: true /** or an object config */ })],
14-
}
15-
```
11+
```js
12+
export default {
13+
plugins: [checker({ typescript: true /** or an object config */ })],
14+
}
15+
```
1616

1717
## Configuration
1818

docs/checkers/vls.md

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,21 @@ See [`initParams.ts`](https://github.com/fi3ework/vite-plugin-checker/blob/8fc5d
3030
For example, to performing checking only the `<script>` block:
3131

3232
```ts
33-
checker({
34-
vls: {
35-
vetur: {
36-
validation: {
37-
template: false,
38-
templateProps: false,
39-
interpolation: false,
40-
style: false,
33+
// e.g.
34+
export default {
35+
plugins: [
36+
checker({
37+
vls: {
38+
vetur: {
39+
validation: {
40+
template: false,
41+
templateProps: false,
42+
interpolation: false,
43+
style: false,
44+
},
45+
},
4146
},
42-
},
43-
},
44-
}),
47+
}),
48+
],
49+
}
4550
```

docs/checkers/vue-tsc.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ You can use vue-tsc checker for your Vue3 project. If you're still using Vue2, c
66

77
1. Make sure [vue-tsc](https://www.npmjs.com/package/vue-tsc) & [typescript](https://www.npmjs.com/package/typescript) are installed as a peer dependency of your Vite project.
88

9-
```bash
10-
pnpm add vue-tsc@latest typescript -D
11-
```
9+
```bash
10+
pnpm add vue-tsc@latest typescript -D
11+
```
1212

13-
::: warning
14-
The `vue-tsc` version **must** >= `0.33.9`.
15-
:::
13+
::: tip
14+
The `vue-tsc` version **must** >= `0.33.9`. `vue-tsc` has released `1.0.0` version, it's recommended to try it out.
15+
:::
1616

1717
2. Add `vueTsc` field to plugin config.
1818

19-
```js
20-
export default {
21-
plugins: [checker({ vueTsc: true /** or an object config */ })],
22-
}
23-
```
19+
```js
20+
export default {
21+
plugins: [checker({ vueTsc: true /** or an object config */ })],
22+
}
23+
```
2424

2525
## Configuration
2626

@@ -31,4 +31,4 @@ Advanced object configuration table of `options.vueTsc`
3131
| root | `string` | [Vite config](https://vitejs.dev/config/#root) `root` | Root path to find tsconfig file |
3232
| tsconfigPath | `string` | `"tsconfig.json"` | Relative tsconfig path to `root` |
3333

34-
3. (Optional for Vue2 user) The type check is powered by `vue-tsc` so it supports Vue2 according to the [documentation](https://github.com/johnsoncodehk/volar#using), you need to install `@vue/runtime-dom` by yourself.
34+
3. **(optional for Vue2 project only)** The type check is powered by `vue-tsc` so it supports Vue2 according to the [documentation](https://github.com/johnsoncodehk/volar#using), you need to install `@vue/runtime-dom` by yourself.

docs/configuration/config.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Configurations
22

3-
Shared configuration to control the behaviors of the plugin.
3+
Shared configuration to control the checker behaviors of the plugin.
44

55
```ts
66
{

docs/faq/troubleshooting.md renamed to docs/faq/integration.md

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
1-
# Troubleshooting
1+
# Integration
22

3-
This section lists a few common gotchas, and bugs introduced in the past.
4-
Please skim through before [opening an issue](https://github.com/fi3ework/vite-plugin-checker/issues/new/choose).
5-
6-
## HMR Issues
3+
## with traditional backend
74

85
### Hot Module Refresh does not work when integrating with backend
96

docs/introduction/getting-started.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Getting Started
22

3-
1. Install plugin (pnpm recommended).
3+
1. Install plugin (pnpm recommended 🚀).
44

55
```bash
66
pnpm add vite-plugin-checker -D
@@ -13,13 +13,18 @@
1313
npm i vite-plugin-checker -D
1414
```
1515

16-
2. Add plugin to Vite config file. Add the checker you need. We add TypeScript below as an example. See all available checkers [here](/checkers/overview).
16+
2. Add plugin to Vite config file and config the checker you need. We add TypeScript here as an example. See all available checkers [here](/checkers/overview).
1717

1818
```ts
1919
// vite.config.js
2020
import checker from 'vite-plugin-checker'
2121
export default {
22-
plugins: [checker({ typescript: true })], // e.g. use TypeScript check
22+
plugins: [
23+
checker({
24+
// e.g. use TypeScript check
25+
typescript: true,
26+
}),
27+
],
2328
}
2429
```
2530

@@ -43,5 +48,5 @@ It's recommended to open a browser for a better terminal flush, see [#27](https:
4348
:::
4449

4550
::: warning
46-
`server.ws.on` is introduced to Vite in [2.6.8](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#268-2021-10-18). vite-plugin-checker relies on `server.ws.on` to bring diagnostics back after a full reload and it' not available for older version of Vite.
51+
`server.ws.on` is introduced to Vite in [2.6.8](https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#268-2021-10-18). vite-plugin-checker relies on `server.ws.on` to make overlay visible after opening a new browser tab.
4752
:::

docs/introduction/introduction.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# About vite-plugin-checker
22

3-
A Vite plugin that can run TypeScript, VLS, vue-tsc, ESLint, Stylelint in worker thread.
3+
A Vite plugin that can run TypeScript, VLS, vue-tsc, ESLint, Stylelint in worker thread to **add type checking and linting support** for Vite.
44

55
<div :style="{ 'display': 'flex' }">
66
<a href="https://www.npmjs.com/package/vite-plugin-checker" :style="{ 'margin-right': '4px' }"><img src="https://img.shields.io/npm/v/vite-plugin-checker" /></a>
@@ -13,7 +13,7 @@ A Vite plugin that can run TypeScript, VLS, vue-tsc, ESLint, Stylelint in worker
1313
<img alt="screenshot" src="https://user-images.githubusercontent.com/12322740/152739742-7444ee62-9ca7-4379-8f02-495c612ecc5c.png">
1414
</p>
1515

16-
> History version documentations [0.1](https://github.com/fi3ework/vite-plugin-checker/tree/v0.1.x), [0.2](https://github.com/fi3ework/vite-plugin-checker/tree/v0.2), [0.3](https://github.com/fi3ework/vite-plugin-checker/tree/v0.3.x), [0.4](https://github.com/fi3ework/vite-plugin-checker/tree/v0.4.x/docs). It's highly recommended to use latest version before 1.0.0, although there's some breaking changes, the plugin configuration is quite simple.
16+
> History version documentations [0.1](https://github.com/fi3ework/vite-plugin-checker/tree/v0.1.x), [0.2](https://github.com/fi3ework/vite-plugin-checker/tree/v0.2), [0.3](https://github.com/fi3ework/vite-plugin-checker/tree/v0.3.x), [0.4](https://github.com/fi3ework/vite-plugin-checker/tree/v0.4.x/docs). It's highly recommended to use latest version before 1.0.0, although there's some breaking changes in each version bumping, the plugin configuration is quite simple.
1717
1818
## Online playground
1919

0 commit comments

Comments
 (0)