TsconfigIntroduction

Introduction

Find and parse TypeScript configuration files with extends resolution and validation

Last updated:

@visulima/tsconfig

Find, read, and parse TypeScript configuration files with full extends resolution, comment support, and validation against TypeScript's schema.

Key Features

  • Find tsconfig.json - Search from any directory
  • Parse with Comments - Supports comments and trailing commas
  • Resolve Extends - Automatically resolves extends paths
  • Validate - Validates configuration against TypeScript schema
  • Write Config - Write tsconfig.json files
  • TypeScript Compatible - Tested against TypeScript for correctness
  • Fully Typed - Complete TypeScript definitions

Quick Start

import { findTsConfig, readTsConfig } from "@visulima/tsconfig";

// Find tsconfig.json
const result = await findTsConfig();
console.log(result.config.compilerOptions);

// Read specific tsconfig
const config = await readTsConfig("/path/to/tsconfig.json");

Use Cases

// Build tools
import { findTsConfig } from "@visulima/tsconfig";

const { config } = await findTsConfig();
const outDir = config.compilerOptions?.outDir || "dist";

// Config generation
import { writeTsConfig } from "@visulima/tsconfig";

await writeTsConfig({
    compilerOptions: {
        target: "ES2020",
        module: "ESNext",
        strict: true,
    },
});

Next Steps

Support

Contribute to our work and keep us going

Community is the heart of open source. The success of our packages wouldn't be possible without the incredible contributions of users, testers, and developers who collaborate with us every day.Want to get involved? Here are some tips on how you can make a meaningful impact on our open source projects.

Ready to help us out?

Be sure to check out the package's contribution guidelines first. They'll walk you through the process on how to properly submit an issue or pull request to our repositories.

Submit a pull request

Found something to improve? Fork the repo, make your changes, and open a PR. We review every contribution and provide feedback to help you get merged.

Good first issues

Simple issues suited for people new to open source development, and often a good place to start working on a package.
View good first issues