Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zemd/tsconfig
Default tsconfig files
https://github.com/zemd/tsconfig
tsconfig typescript
Last synced: 3 days ago
JSON representation
Default tsconfig files
- Host: GitHub
- URL: https://github.com/zemd/tsconfig
- Owner: zemd
- Created: 2022-08-14T17:57:32.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-08T19:51:49.000Z (8 months ago)
- Last Synced: 2024-10-31T05:22:38.270Z (17 days ago)
- Topics: tsconfig, typescript
- Homepage:
- Size: 216 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
# Default tsconfigs
- React component library
- Next.js site## Usage
### Installation
```sh
npm install @zemd/tsconfig --save-dev
```### React component library
```json
{
"$schema": "https://json.schemastore.org/tsconfig",
"display": "My cool react library",
"extends": "@zemd/tsconfig/tsconfig-react.json"
}
```### Next.js project
```json
{
"$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.
## Donate
[![](https://img.shields.io/badge/patreon-donate-yellow.svg)](https://www.patreon.com/red_rabbit)
[![](https://img.shields.io/static/v1?label=UNITED24&message=support%20Ukraine&color=blue)](https://u24.gov.ua/)