You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+25-3
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,12 @@ Typescript plugin that allows turning on strict mode in specific files or direct
4
4
5
5
## Do i need this plugin?
6
6
This plugin was created for bigger repositories that want to incorporate typescript strict mode, but project is so big that refactoring everything would take ages. This plugin allows user to simply put `//@ts-strict` comment to a top of a file and turn a strict mode to that file. If needed, strict mode can be turned on to directories too.
7
-
NOTE: this plugin doesn't work in compile time. It will show errors in your IDE but they won't appear during compilation.
7
+
Plugins in general doesn't work in compile time. They will show errors in your IDE but they won't appear during compilation.
8
+
To check strict errors in marked files you can use our script `tsc-strict`.
9
+
This command line tool is created to check for files that should be checked with strict rules in compilation time.
10
+
It finds all files with `//@ts-strict` comment and files specified in `paths` parameter and checks for strict typescript errors only for that files.
11
+
Therefore, we have strict errors inside our files and during build time.
12
+
8
13
9
14
## How to install
10
15
@@ -33,7 +38,7 @@ and add plugin to your `tsconfig.json`:
33
38
That's it! You should be able to use `@ts-strict` comment to strictly check your files.
34
39
35
40
## Configuration
36
-
Plugin takes one extra nonmandatory argument `paths` that is an array of relative or absolute paths of directories that should be included.
41
+
Plugin takes one extra non-mandatory argument `paths` that is an array of relative or absolute paths of directories that should be included.
37
42
```json
38
43
{
39
44
"compilerOptions": {
@@ -51,7 +56,24 @@ Plugin takes one extra non mandatory argument `paths` that is an array of relati
51
56
}
52
57
}
53
58
```
54
-
All files contained in those paths will be be strictly checked. Yay!
59
+
All files contained in those paths will be strictly checked. Yay!
60
+
61
+
To add cli tool to your build time you can add a script to scripts list in package.json
62
+
```json
63
+
{
64
+
"scripts": {
65
+
...,
66
+
"typecheck": "tsc && tsc-strict",
67
+
},
68
+
}
69
+
```
70
+
71
+
Then you can simply run
72
+
```shell
73
+
yarn tsc-strict
74
+
```
75
+
76
+
All your strict files should be checked from command line.
0 commit comments