Skip to content

TypeScript

You can use TypeScript checker for vanilla TypeScript project or React project.

Installation

  1. Make sure 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.

fieldTypeDefault valueDescription
rootstringVite config rootRoot path to find tsconfig file
tsconfigPathstring"tsconfig.json"Relative tsconfig path to root
buildModebooleanfalseAdd --build to tsc flag, note that noEmit does NOT work if buildMode is true (#36917)

Released under the MIT License.