New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

tsc-baseline

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tsc-baseline

Save a baseline of TypeScript errors and compare new errors against it. Useful for type-safe feature development in TypeScript projects that have a lot of errors. This tool will filter out errors that are already in the baseline and only show new errors.

latest
Source
npmnpm
Version
1.9.0
Version published
Weekly downloads
17K
-9.65%
Maintainers
1
Weekly downloads
 
Created
Source

🌡️ tsc-baseline

Often times when working on a large codebase or joining a new project, you'll be faced with a lot pre-existing type errors. While it's important to fix these errors, practically speaking, it's not realistic to fix them all at once and will likely be done incrementally over time.

tsc-baseline helps you reduce the noise of pre-existing type errors by allowing you to save a baseline of errors and filter them out of future type-checks.

This is especially useful when you're working on a new feature branch and want to focus on the errors introduced by your changes, rather than the errors that were already present in the codebase.

👋 Hello there! Follow me @linesofcode or visit linesofcode.dev for more cool projects like this one.

📡 Install

npm install tsc-baseline

yarn add tsc-baseline

pnpm add tsc-baseline

🚀 Getting Started

First, run a type-check in a project containing errors and save the results to a file. We refer to this file as the baseline.

yarn tsc | yarn tsc-baseline save

Next, make some changes to your codebase that introduce new errors, and run the type-check again. This time, we'll compare the results to the baseline and filter out pre-existing errors.

Running the following command will print out the new errors to the console.

yarn tsc | yarn tsc-baseline check

If you need to explicitly add an error to the baseline, you can do so by copying the error's hash from the console output and running the following command.

yarn tsc-baseline add 1234

When you're done, you can delete the baseline file.

yarn tsc-baseline clear

Error Format Options

You can specify the error format to be used when checking for new errors with the check command. This option affects the output to stderr. By default, the standard error message format is used. However, if you want the output in a GitLab-friendly format, you can use the --error-format option:

  • Default Format (human): Shows standard human-readable error messages.
  • GitLab Format (gitlab): Outputs errors in a format suitable for GitLab pipelines, making it easier to process in CI/CD workflows.

Example for GitLab format:

yarn tsc | yarn tsc-baseline check --error-format gitlab

Keywords

tsc

FAQs

Package last updated on 28 Jan 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts