typecheck

package
v0.5.0-beta.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 5, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package typecheck runs the project's TypeScript compiler for `krate typecheck`. tsc reports tier decorators (`@server function Stats() {}`) as errors, since they are valid only to Krate, so those are removed from its output. Everything else, including a misspelled decorator, is kept.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoTSC = errors.New("typescript is not installed in this project")

ErrNoTSC means the project has no TypeScript compiler installed.

Functions

func Filter

func Filter(output string, read func(path string) (string, error)) (kept string, remaining, dropped int)

Filter drops the tier decorator errors from tsc's plain output (`--pretty false`) and returns the rest, with the number of errors left and dropped. read returns a file's contents.

func FindTSC

func FindTSC(root string) string

FindTSC returns the TypeScript compiler installed for root, looking in node_modules of root and its parents.

func Run

func Run(root string) (string, bool, error)

Run type-checks the project at root. It returns tsc's filtered output and whether the project is free of errors.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL