-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/fi3ework/vite-plugin-checker …
…into module-nodenext
- Loading branch information
Showing
29 changed files
with
1,124 additions
and
307 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import { defineConfig } from 'vitepress' | ||
|
||
export default defineConfig({ | ||
lang: 'en-US', | ||
title: 'vite-plugin-checker', | ||
description: 'Vite plugin that provide checks of TypeScript, ESLint, vue-tsc, and more.', | ||
|
||
lastUpdated: true, | ||
|
||
themeConfig: { | ||
sidebar: { | ||
'/': sidebar(), | ||
}, | ||
|
||
editLink: { | ||
pattern: 'https://github.com/fi3ework/vite-plugin-checker/edit/main/docs/:path', | ||
text: 'Edit this page on GitHub', | ||
}, | ||
|
||
socialLinks: [{ icon: 'github', link: 'https://github.com/fi3ework/vite-plugin-checker' }], | ||
|
||
footer: { | ||
message: 'Released under the MIT License.', | ||
copyright: 'Copyright fi3ework', | ||
}, | ||
}, | ||
}) | ||
|
||
function sidebar() { | ||
return [ | ||
{ | ||
text: 'Introduction', | ||
collapsible: true, | ||
items: [ | ||
{ text: 'Introduction', link: '/introduction/introduction' }, | ||
{ text: 'Getting Started', link: '/introduction/getting-started' }, | ||
], | ||
}, | ||
{ | ||
text: 'Checkers', | ||
collapsible: true, | ||
items: [ | ||
{ text: 'Overview', link: '/checkers/overview' }, | ||
{ text: 'TypeScript', link: '/checkers/typescript' }, | ||
{ text: 'vue-tsc', link: '/checkers/vue-tsc' }, | ||
{ text: 'ESLint', link: '/checkers/eslint' }, | ||
{ text: 'VLS', link: '/checkers/vls' }, | ||
], | ||
}, | ||
{ | ||
text: 'Configuration', | ||
collapsible: true, | ||
items: [{ text: 'Shared ', link: '/configuration/config' }], | ||
}, | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# ESLint | ||
|
||
## Installation | ||
|
||
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. | ||
|
||
::: | ||
|
||
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). | ||
|
||
```js | ||
// e.g. | ||
export default { | ||
plugins: [ | ||
checker({ | ||
eslint: { | ||
lintCommand: 'eslint "./src/**/*.{ts,tsx}"', // for example, lint .ts & .tsx | ||
}, | ||
}), | ||
], | ||
} | ||
``` | ||
|
||
## Configuration | ||
|
||
Advanced object configuration table of `options.eslint` | ||
|
||
| field | Type | Default value | Description | | ||
| :----------------- | ---------------------------------------------------------------------------------------------------------- | ---------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| lintCommand | `string` | This value is required | `lintCommand` will be executed at build mode, and will also be used as default config for dev mode when `eslint.dev.eslint` is nullable. | | ||
| dev.overrideConfig | [`ESLint.Options`](https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/eslint/index.d.ts) | `undefined` | **(Only in dev mode)** You can override the options of the translated from `lintCommand`. Config priority: `const eslint = new ESLint({cwd: root, ...translatedOptions, ...pluginConfig.eslint.dev?.overrideConfig, })`. | | ||
| dev.logLevel | `('error' \| 'warning')[]` | `['error', 'warning']` | **(Only in dev mode)** Which level of ESLint should be emitted to terminal and overlay in dev mode | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Checkers overview | ||
|
||
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). | ||
|
||
## How to add a checker | ||
|
||
- Set to `true` to use a checker with its default value (except ESLint). | ||
- Leave the field blank or `false` to disable the checker. | ||
- Make sure to install the peer dependencies indicated of each checker. | ||
- Checker can be enabled with an advanced object config. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# TypeScript | ||
|
||
You can use TypeScript checker for vanilla TypeScript project or React project. | ||
|
||
## Installation | ||
|
||
1. Make sure [typescript](https://www.npmjs.com/package/typescript) is installed as a peer dependency. | ||
|
||
2. Add `typescript` field to plugin config. | ||
|
||
```js | ||
export default { | ||
plugins: [checker({ typescript: true /** or an object config */ })], | ||
} | ||
``` | ||
|
||
## Configuration | ||
|
||
Advanced object configuration table of `options.typescript`. | ||
|
||
| field | Type | Default value | Description | | ||
| :----------- | --------- | ----------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | | ||
| root | `string` | [Vite config](https://vitejs.dev/config/#root) `root` | Root path to find tsconfig file | | ||
| tsconfigPath | `string` | `"tsconfig.json"` | Relative tsconfig path to `root` | | ||
| buildMode | `boolean` | `false` | Add [`--build`](https://www.typescriptlang.org/docs/handbook/project-references.html) to `tsc` flag, note that `noEmit` does NOT work if `buildMode` is `true` ([#36917](https://github.com/microsoft/TypeScript/issues/36917)) | |
Oops, something went wrong.