From b71a20e0b49e1c76e55b5287af7ac9fbd8d8cfc0 Mon Sep 17 00:00:00 2001 From: Jonas Geiler Date: Tue, 28 May 2024 06:51:18 +0200 Subject: [PATCH] docs: restructuring, formatting and improvements --- README.md | 29 +++++++++++++++++++---------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 09e8998..e00aef3 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,24 @@ > [!NOTE] -> This is a fork of [`tsc-files`](https://www.npmjs.com/package/tsc-files) which modernizes the whole codebase a bit and implements some unmerged pull requests of the [original repository](https://github.com/gustavopch/tsc-files). +> This is a fork of [`tsc-files`](https://www.npmjs.com/package/tsc-files) which +> modernizes the whole codebase a bit and implements some unmerged pull requests +> of the [original repository](https://github.com/gustavopch/tsc-files). # tsc-files A tiny tool to run `tsc` on specific files without ignoring `tsconfig.json`. +## Why + +I wanted to type-check **only the staged files** +with [lint-staged](https://github.com/okonet/lint-staged). + +Unfortunately passing specific files like `tsc --noEmit file1.ts file2.ts` will +cause TypeScript to simply ignore your `tsconfig.json`. + +There's already an open issue in the TypeScript repo to support this use case — +you may want to give a 👍 +there: https://github.com/microsoft/TypeScript/issues/27379 + ## Installation ```sh @@ -19,14 +33,6 @@ yarn add --dev @jonasgeiler/tsc-files pnpm add --save-dev @jonasgeiler/tsc-files ``` -## Why - -I wanted to type-check **only the staged files** with [lint-staged](https://github.com/okonet/lint-staged). - -Unfortunately passing specific files like `tsc --noEmit file1.ts file2.ts` will cause TypeScript to simply ignore your `tsconfig.json`. - -There's already an open issue in the TypeScript repo to support this use case — you may want to give a 👍 there: https://github.com/microsoft/TypeScript/issues/27379 - ## Usage With lint-staged: @@ -41,4 +47,7 @@ With lint-staged: ## How it works -For the most part, it just forwards all arguments to `tsc` with one exception: the specified files will not be forwarded — instead, they will be put at the `files` property of a temporary config that will be generated next to your original `tsconfig.json`. Other than that, just read `tsc --help`. +For the most part, it just forwards all arguments to `tsc` with one exception: +the specified files will not be forwarded — instead, they will be put at +the `files` property of a temporary config that will be generated next to your +original `tsconfig.json`. Other than that, just read `tsc --help`.