-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 73625b9
Showing
11 changed files
with
220 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.idea | ||
.vscode | ||
.env | ||
.DS_Store | ||
|
||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
engine-strict=true | ||
public-hoist-pattern[]=!* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# MIT License | ||
|
||
Copyright © 2023-PRESENT [m1rn](https://github.com/m1rn) | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# @m1rn/tsconfig | ||
|
||
<img src="https://github-production-user-asset-6210df.s3.amazonaws.com/137921275/258572450-d0a2270e-45ad-4ed4-aed0-b5c0a2eea988.svg" width="100" height="100" align="right" alt="TypeScript" /> | ||
|
||
[![Version](https://img.shields.io/npm/v/@m1rn/tsconfig?color=1976d2&label=)](https://www.npmjs.com/package/@m1rn/tsconfig) | ||
[![License](https://img.shields.io/npm/l/@m1rn/tsconfig?color=1976d2&label=)](LICENSE.md) | ||
|
||
A collection of TypeScript preset configurations that follow best practices, designed to help you quickly set up your TypeScript projects. | ||
|
||
## Features | ||
|
||
- **Best Practices**: Ensures accurate and reliable type checking. | ||
- **Strict Configurations**: Keeps your code quality at a high standard. | ||
- **Flexible Setup**: Adapts to various project needs. | ||
- **Regular Updates**: Stays up-to-date with the latest features and versions. | ||
|
||
## Prerequisites | ||
|
||
### TypeScript | ||
|
||
- Version >= 5.0.0 | ||
|
||
## Installation | ||
|
||
```bash | ||
npm install @m1rn/tsconfig --save-dev | ||
``` | ||
|
||
## Presets | ||
|
||
- [`@m1rn/tsconfig/base`](./base/tsconfig.json) | ||
|
||
Suitable for all TypeScript projects; serves as foundation for other presets | ||
|
||
- [`@m1rn/tsconfig/strict`](./strict/tsconfig.json) | ||
|
||
Suitable for projects that require strict type checking. | ||
|
||
- [`@m1rn/tsconfig/browser`](./browser/tsconfig.json) | ||
|
||
Suitable for browser environment projects. | ||
|
||
- [`@m1rn/tsconfig/node`](./node/tsconfig.json) | ||
|
||
Suitable for Node.js projects. | ||
|
||
- [`@m1rn/tsconfig/react`](./react/tsconfig.json) | ||
|
||
Suitable for React projects. | ||
|
||
- [`@m1rn/tsconfig/vue`](./vue/tsconfig.json) | ||
|
||
Suitable for Vue projects. | ||
|
||
## Usage | ||
|
||
Just `extend` the preset configurations you need in your `tsconfig.json` file: | ||
|
||
### Single Configuration | ||
|
||
```json | ||
{ | ||
"extends": "@m1rn/tsconfig/base" | ||
} | ||
``` | ||
|
||
### Combined Configuration | ||
|
||
```json | ||
{ | ||
"extends": ["@m1rn/tsconfig/node", "@m1rn/tsconfig/strict"] | ||
} | ||
``` | ||
|
||
## See Also | ||
|
||
- [@m1rn/eslint-config](https://github.com/m1rn/eslint-config) | ||
|
||
## License | ||
|
||
[MIT](LICENSE.md) License © 2024-PRESENT [m1rn](https://github.com/m1rn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"compilerOptions": { | ||
"strict": true, | ||
"allowJs": true, | ||
"skipLibCheck": true, | ||
"noImplicitThis": true, | ||
"isolatedModules": true, | ||
"esModuleInterop": true, | ||
"strictNullChecks": true, | ||
"verbatimModuleSyntax": true, | ||
"useDefineForClassFields": true, | ||
"noUncheckedIndexedAccess": true, | ||
"noFallthroughCasesInSwitch": true, | ||
"allowSyntheticDefaultImports": true, | ||
"forceConsistentCasingInFileNames": true, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "../base/tsconfig", | ||
"compilerOptions": { | ||
"lib": ["dom", "dom.iterable", "esnext"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": "../base/tsconfig", | ||
"compilerOptions": { | ||
"lib": ["esnext"], | ||
"target": "esnext", | ||
"module": "esnext", | ||
"moduleResolution": "bundler", | ||
"moduleDetection": "force", | ||
"resolveJsonModule": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
{ | ||
"name": "@m1rn/tsconfig", | ||
"description": "Typescript shareable configurations", | ||
"version": "1.0.0", | ||
"license": "MIT", | ||
"author": "m1rn", | ||
"homepage": "https://github.com/m1rn/tsconfig", | ||
"bugs": "https://github.com/m1rn/tsconfig/issues", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/m1rn/tsconfig" | ||
}, | ||
"keywords": [ | ||
"typescript", | ||
"tsconfig", | ||
"base", | ||
"strict", | ||
"browser", | ||
"node", | ||
"react", | ||
"vue" | ||
], | ||
"exports": { | ||
"./base": "./base/tsconfig.json", | ||
"./strict": "./strict/tsconfig.json", | ||
"./browser": "./browser/tsconfig.json", | ||
"./node": "./node/tsconfig.json", | ||
"./react": "./react/tsconfig.json", | ||
"./vue": "./vue/tsconfig.json", | ||
"./package.json": "./package.json" | ||
}, | ||
"peerDependencies": { | ||
"typescript": ">=5.0.0" | ||
}, | ||
"peerDependenciesMeta": { | ||
"typescript": { | ||
"optional": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"extends": [ | ||
"../node/tsconfig", | ||
"../browser/tsconfig" | ||
], | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"jsx": "react-jsx" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
{ | ||
"extends": "../base/tsconfig", | ||
"compilerOptions": { | ||
"checkJs": true, | ||
"allowUnusedLabels": false, | ||
"allowUnreachableCode": false, | ||
"exactOptionalPropertyTypes": true, | ||
"noUnusedLocals": true, | ||
"noImplicitReturns": true, | ||
"noImplicitOverride": true, | ||
"noUnusedParameters": true, | ||
"noPropertyAccessFromIndexSignature": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"extends": [ | ||
"../node/tsconfig", | ||
"../browser/tsconfig" | ||
], | ||
"compilerOptions": { | ||
"noEmit": true, | ||
"jsx": "preserve", | ||
"jsxImportSource": "vue" | ||
} | ||
} |