Skip to content

Commit

Permalink
chore: release v1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
m1rn committed Aug 26, 2024
0 parents commit 73625b9
Show file tree
Hide file tree
Showing 11 changed files with 220 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.idea
.vscode
.env
.DS_Store

node_modules
dist
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
engine-strict=true
public-hoist-pattern[]=!*
21 changes: 21 additions & 0 deletions LICENSE.md
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.
81 changes: 81 additions & 0 deletions README.md
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 &copy; 2024-PRESENT [m1rn](https://github.com/m1rn)
17 changes: 17 additions & 0 deletions base/tsconfig.json
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,
}
}
6 changes: 6 additions & 0 deletions browser/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../base/tsconfig",
"compilerOptions": {
"lib": ["dom", "dom.iterable", "esnext"]
}
}
11 changes: 11 additions & 0 deletions node/tsconfig.json
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
}
}
40 changes: 40 additions & 0 deletions package.json
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
}
}
}
10 changes: 10 additions & 0 deletions react/tsconfig.json
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"
}
}
14 changes: 14 additions & 0 deletions strict/tsconfig.json
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
}
}
11 changes: 11 additions & 0 deletions vue/tsconfig.json
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"
}
}

0 comments on commit 73625b9

Please sign in to comment.