Skip to content

Commit

Permalink
feat: introduce @tinkoff/typescript-config package (#236)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkvak authored Apr 10, 2023
1 parent d434124 commit 3adaf95
Show file tree
Hide file tree
Showing 9 changed files with 85 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ root = true
[*]
charset = utf-8
indent_style = space
indent_size = 4
indent_size = 2
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Monorepo for all the tooling which enables ESLint, Prettier, Stylelint to suppor
| [@tinkoff/eslint-config-angular](https://npmjs.com/package/@tinkoff/eslint-config-angular) | ![](https://img.shields.io/npm/v/%40tinkoff%2Feslint-config-angular/latest.svg) | [![](https://img.shields.io/badge/README--green.svg)](packages/eslint-config-angular/README.md) | [![](https://img.shields.io/npm/dw/@tinkoff/eslint-config-angular)](https://npmjs.com/package/@tinkoff/eslint-config-angular) |
| [@tinkoff/prettier-config](https://npmjs.com/package/@tinkoff/prettier-config) | ![](https://img.shields.io/npm/v/%40tinkoff%2Fprettier-config/latest.svg) | [![](https://img.shields.io/badge/README--green.svg)](packages/prettier-config/README.md) | [![](https://img.shields.io/npm/dw/@tinkoff/prettier-config)](https://npmjs.com/package/@tinkoff/prettier-config) |
| [@tinkoff/stylelint-config](https://npmjs.com/package/@tinkoff/stylelint-config) | ![](https://img.shields.io/npm/v/%40tinkoff%2Fstylelint-config/latest.svg) | [![](https://img.shields.io/badge/README--green.svg)](packages/stylelint-config/README.md) | [![](https://img.shields.io/npm/dw/@tinkoff/stylelint-config)](https://npmjs.com/package/@tinkoff/stylelint-config) |
| [@tinkoff/typescript-config](https://npmjs.com/package/@tinkoff/typescript-config) | ![](https://img.shields.io/npm/v/%40tinkoff%2Ftypescript-config/latest.svg) | [![](https://img.shields.io/badge/README--green.svg)](packages/typescript-config/README.md) | [![](https://img.shields.io/npm/dw/@tinkoff/typescript-config)](https://npmjs.com/package/@tinkoff/typescript-config) |

### ❇️ Plugins

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
"********** Build": "",
"build:prod": "lerna run build:prod --parallel",
"********** Test": "",
"test:ci": "jest --no-colors",
"test:ci": "jest --no-colors && lerna run test",
"********** Version": "",
"preversion": "lerna run build:prod --parallel",
"version": "lerna version --no-private --conventional-commits --changelog-preset conventionalcommits --yes --ignore-changes '**/package-lock.json'",
Expand Down
1 change: 1 addition & 0 deletions packages/typescript-config/.npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
package-lock=false
35 changes: 35 additions & 0 deletions packages/typescript-config/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# @tinkoff/typescript-config

Common TypeScript configuration for Tinkoff projects

## Requirements

TypeScript >= 5 is required.

## Usage

Install from npm

```bash
npm i --save-dev @tinkoff/typescript-config
```

Install tsconfig for you application type: `@tsconfig/node18` for your Node.js v18 application or `@tsconfig/create-react-app` for CRA application.

See full lest https://github.com/tsconfig/bases.

```shell
npm i --save-dev @tsconfig/node16
# or
npm i --save-dev @tsconfig/node18
# or
npm i --save-dev @tsconfig/create-react-app
```

Create `tsconfig.json` at the project root

```json
{
"extends": ["@tinkoff/typescript-config", "@tsconfig/node18/tsconfig"]
}
```
34 changes: 34 additions & 0 deletions packages/typescript-config/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "@tinkoff/typescript-config",
"version": "1.0.0",
"description": "Tinkoff TypeScript config",
"license": "Apache-2.0",
"keywords": [
"typescript",
"tsconfig"
],
"scripts": {
"test": "tsc -p test/tsconfig.json --noEmit"
},
"main": "tsconfig.base.json",
"author": {
"name": "Tinkoff Team",
"email": "frontend@tinkoff.ru"
},
"repository": {
"type": "git",
"url": "https://github.com/Tinkoff/linters.git"
},
"publishConfig": {
"access": "public"
},
"peerDependencies": {
"typescript": ">=5.0.0"
},
"devDependencies": {
"typescript": "5.0.3"
},
"dependencies": {
"@tsconfig/strictest": "^2.0.0"
}
}
Empty file.
6 changes: 6 additions & 0 deletions packages/typescript-config/test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "../tsconfig.base.json",
"compilerOptions": {},
"include": ["./index.ts"],
"exclude": []
}
6 changes: 6 additions & 0 deletions packages/typescript-config/tsconfig.base.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"extends": "@tsconfig/strictest",
"compilerOptions": {
"verbatimModuleSyntax": false
}
}

0 comments on commit 3adaf95

Please sign in to comment.