Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

@zemd/tsconfig

zemd185MIT1.5.0

Shared default tsconfig for my projects

typescript, tsconfig, react library tsconfig, next.js tsconfig

readme

Default tsconfigs

  • React component library
  • Next.js site

Usage

Installation

npm install @zemd/tsconfig --save-dev

React component library

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "My cool react library",
  "extends": "@zemd/tsconfig/tsconfig-react.json"
}

Next.js project

{
  "$schema": "https://json.schemastore.org/tsconfig",
  "display": "My cool app configuration",
  "extends": "@zemd/tsconfig/tsconfig-next.json"
}

Warning

Also, you have to set compilerOptions.outDir, compilerOptions.rootDir, and compilerOptions.baseUrl options explicitly, so it would be clear about target destinations. And keep in mind that compilerOptions.outDir is considered a relative path in Typescript, it must be defined within your tsconfig.

Next.js and Emotion.sh integration

It is not limited by Emotion itself but showed up precisely when I was configuring it. Once you extend tsconfnig-next.json, a css attribute can't be used and the typechecker throws an error. You can fix it by adding next-env.d.ts into the include array:

"include": [
  "next-env.d.ts",
  "**/*.ts",
  "**/*.tsx"
]

That means that includes field is also considered as relative paths in typescript.

License

@zemd/tsconfig is released under the MIT license.

changelog

@zemd/tsconfig

1.5.0

Minor Changes

  • 815e99e: add erasableSyntaxOnly and libReplacement in base config

1.4.0

Minor Changes

  • 7ab6ed6: update jsx setting for next.js config

1.3.0

Minor Changes

  • 45cfeca: slight changes in base config