2.0.0 • Published 12 months ago

@procore/typescript-config v2.0.0

Weekly downloads
-
License
SEE LICENSE IN LI...
Repository
-
Last release
12 months ago

@procore/typescript-config

Procore Technologies, Inc typescript configurations

We currently have

  • app.json which is a recreation of core-scripts last typescript config
  • lib.jsonwhich is a recreation of core-scripts last typescript lib config
  • vite.lib.json a tsconfig for library / shared functions to be used with vite
  • vite.react.lib.json a tsconfig for library / shared react components to be used with vite

Installation

Yarn

yarn add -DE typescript @procore/typescript-config

Usage

Create or add to your tsconfig.json

// tsconfig.json
{
  "extends": "@procore/typescript-config/vite.lib.json",
  "compilerOptions": {
    "rootDir": ".",
    "outDir": "dist"
  }
}

Breaking changes from core-scripts

  • Please provide your own rootDir/outDir as shown above, this is a limitation of sharable typescript configs, will revisit in the future

  • If you are proxying / shortcutting your files with the @ shorthand for a specific directory, please re-add that with the following in your tsconfig.json under compiler options. Do note that this breaks some IDE's abilities to successfully detect export renames, and is thus discouraged

Full library component tsconfig recreation:

// tsconfig.json
{
  "extends": "@procore/typescript-config/lib.json",
  "compilerOptions": {
    "rootDir": ".",
    "outDir": "dist"
    "paths": {
      "@/*": ["src/*"]
    }
  }
}
2.0.0

12 months ago

1.0.0

2 years ago

11.0.0-rc.35

3 years ago