Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@shopify/typescript-configs

Package Overview
Dependencies
Maintainers
18
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@shopify/typescript-configs

A set of typescript configuration files that can be extended.

  • 5.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
23K
decreased by-2.26%
Maintainers
18
Weekly downloads
 
Created
Source

@shopify/typescript-configs

License: MIT npm version

In TypeScript, the configuration file can extend from a base file. This package provided a few common base configuration files to simplify TypeScript project setup.

To read more about how this extensibility works. See typescript handbook.

Below are two documentation we have also found useful to have on hand while setting up a configuration file.

Installation

$ yarn add --dev @shopify/typescript-configs

Usage

React Application Project

To start, create a tsconfig.json in the root of your project.

A typical setup where the application sit in [project root]/app folder is as follow:

{
  "extends": "@shopify/typescript-configs/application.json",
  "compilerOptions": {
    "baseUrl": ".",
    "rootDir": ".",
    "paths": {"*": ["*", "app/*"]}
  },
  "include": ["./app/**/*", "./client/**/*", "./server/**/*", "./tests/**/*"]
}
React Library Project

Similarly for a react library project. Create a tsconfig.json in the root of your project with a setup below assuming the library code sit in [project root]/src folder.

{
  "extends": "@shopify/typescript-configs/library.json",
  "compilerOptions": {
    "baseUrl": "./src",
    "rootDir": "."
  },
  "include": ["./src/**/*"]
}
Project that run in the browser

A configuration file is provided that included styles setup and a more conservative build target.

{
  "extends": "@shopify/typescript-configs/dom.json",
  "compilerOptions": {
    "baseUrl": ".",
    "rootDir": "."
  }
}
All Other Project

A base configuration file is also provided if the above does not fit your need.

{
  "extends": "@shopify/typescript-configs/base.json",
  "compilerOptions": {
    "baseUrl": ".",
    "rootDir": "."
  }
}
Common Got Ya
Type Checking does not honour skipLibCheck: true setting

There are times when the type failure occur inside of a library your project is consuming, and having skipLibCheck: true does not resolved it. In this scenario, add an exclude option to your tsconfig.json.

eg.

{
  "extends": "@shopify/typescript-configs/base.json",
  "compilerOptions": {
    "baseUrl": ".",
    "rootDir": ".",
    "exclude": ["./node_modules/**/*"]
  }
}

FAQs

Package last updated on 18 Nov 2021

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