Socket
Socket
Sign inDemoInstall

@buames/tsconfig

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@buames/tsconfig

@buames/tsconfig


Version published
Maintainers
1
Created
Source

@buames/tsconfig

Re-usable tsconfig for TypeScript projects.

Installation

Install with yarn

yarn add --dev @buames/tsconfig

Or install with npm

npm install @buames/tsconfig

Usage

There are 4 different configurations that can be extended.

Base

Extend the base config in your root tsconfig.json.

// tsconfig.json
{
  "extends": "@buames/tsconfig",
  "compilerOptions": {
    "outDir": "dist"
    // ... your compiler options
  },
  "exclude": [],
  "include": []
}

Workspaces

Enable support for project references by extending the workspaces.json config in your root tsconfig.json and in each package's tsconfig.json. This extends the base config.

// tsconfig.json
{
  "extends": "@buames/tsconfig/workspaces.json",
  "files": [],
  "references": [
    { "path": "packages/<directory_name>" }
    // ... your references
  ]
}
// package/<directory_name>/tsconfig.json
{
  "extends": "@buames/tsconfig/workspaces.json",
  "compilerOptions": {
    "outDir": "dist"
    // ... your compiler options
  },
  "exclude": [],
  "include": [],
  "references": []
}

React

Enable support for React by extending the react.json config your root tsconfig.json. This will extends the base config, enables the DOM lib, and sets the JSX transform to react.

// tsconfig.json
{
  "extends": "@buames/tsconfig/react.json",
  "compilerOptions": {
    "outDir": "dist"
    // ... your compiler options
  },
  "exclude": [],
  "include": []
}

Next.js

Enable support for Next.js by extending the nextjs.json config your root tsconfig.json. This extends the base config and enables required Next.js TypeScript rules.

// tsconfig.json
{
  "extends": "@buames/tsconfig/nextjs.json",
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "*": ["*", "src/*"]
    }
    // ... your compiler options
  },
  "exclude": ["node_modules"],
  "include": ["**/*.ts", "**/*.tsx"]
}

FAQs

Package last updated on 20 Feb 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc