0.1.0 • Published 2 years ago

@modern-classic/tsconfig v0.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@modern-classic/tsconfig

License: MIT

This package contains the standard tsconfig.json designed for use in compliance with the Modern Classic TypeScript Style Guide.

Installation

This package has a single peer dependency TypeScript. This is a design choice by Modern Classic, but let's be real, if you are installing a tsconfig package, you obviously have TypeScript installed.

Yarn:

yarn add -D typescript @modern-classic/tsconfig

NPM:

npm install --save-dev typescript @modern-classic/tsconfig

pnpm:

pnpm add -D typescript @modern-classic/tsconfig

Usage

To use this config, simply create a tsconfig.json file in the root of your project, and extend ours. Below are some recommended configurations.

If the project contains JavaScript files:

{
  "extends": "@modern-classic/tsconfig/tsconfig.json",
  "compilerOptions": {
    "declarationDir": "types",
    "outDir": "dist",
    "rootDir": "."
  },
  "include": ["src/**/*.{js|jsx|ts|tsx}"]
}

If the project doesn't contain JavaScript files:

{
  "extends": "@modern-classic/tsconfig/tsconfig.json",
  "compilerOptions": {
    "declarationDir": "types",
    "outDir": "dist",
    "rootDir": "."
  },
  "include": ["src/**/*.{ts|tsx}"]
}