@halvaradop/tsconfig
v1.2.1
Published
Reusable TypeScript configuration presets for @halvaradop projects.
Downloads
18
Maintainers
Readme
@halvaradop/tsconfig
A shareable TypeScript configuration that supports TypeScript Default Project, React, and Next.js templates. This package ensures correct configuration based on the type of project.
This package is part of the @halvaradop/configs monorepo, providing standardized configurations for various development tools.
Installation
Install the package as a development dependency in your project:
# Using pnpm (recommended)
pnpm add -D @halvaradop/tsconfig
# Using npm
npm install -D @halvaradop/tsconfig
# Using yarn
yarn add -D @halvaradop/tsconfigNote: This package requires TypeScript ^5.0.0 as a peer dependency.
Usage
Basic Setup
Create a tsconfig.json file in your project root and import the TypeScript configuration according to your requirements:
{
"extends": "@halvaradop/tsconfig/tsconfig.base.json",
"compilerOptions": {
"outDir": "./dist"
},
"exclude": ["node_modules"]
}React Setup
Import the React configuration using your tsconfig.json file in your project root:
{
"extends": "@halvaradop/tsconfig/react.json",
"exclude": ["node_modules"]
}Next.js Setup
Import the Next.js configuration using your tsconfig.json file in your project root:
{
"extends": "@halvaradop/tsconfig/nextjs.json",
"exclude": ["node_modules"]
}Scripts
Add these scripts to your package.json for easy formatting:
{
"scripts": {
"dev": "tsc -w",
"build": "tsc",
"check-types": "tsc --noEmit",
"config": "tsc --showConfig"
}
}Related Packages
This package is part of the @halvaradop/configs ecosystem:
@halvaradop/eslint-config- ESLint configuration@halvaradop/prettier-config- Prettier configuration@halvaradop/tsup-config- Tsup configuration
License
MIT © Hernan Alvarado
Changelog
See CHANGELOG.md for details about changes in each version.
For comprehensive details on TypeScript configuration options, refer to the official TypeScript documentation.
