@buames/tsconfig v0.0.3
@buames/tsconfig
Re-usable tsconfig for TypeScript projects.
Installation
Install with yarn
yarn add --dev @buames/tsconfigOr install with npm
npm install @buames/tsconfigUsage
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"]
}4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago