@@ -40,6 +40,14 @@ This is equal to `bunx --bun knip`
40
40
Requires [ Bun] [ 1 ] to be installed. Also see [ known issues] [ 2 ] for the type of
41
41
issues this might help with.
42
42
43
+ ### NO_COLOR
44
+
45
+ The default reporters use the [ NO_COLOR] [ 3 ] friendly [ picocolors] [ 4 ] :
46
+
47
+ ``` sh
48
+ NO_COLOR=1 knip
49
+ ```
50
+
43
51
## Troubleshooting
44
52
45
53
### ` --debug `
@@ -75,21 +83,21 @@ Total running time: 5s (mem: 631.27MB)
75
83
- ` sum ` the accumulated time of all invocations
76
84
77
85
This is not yet available in Bun, since it does not support
78
- ` performance.timerify ` ([ GitHub issue] [ 3 ] ).
86
+ ` performance.timerify ` ([ GitHub issue] [ 5 ] ).
79
87
80
88
### ` --trace `
81
89
82
90
Trace exports to see where they are imported.
83
91
84
- Also see [ Trace] [ 4 ] .
92
+ Also see [ Trace] [ 6 ] .
85
93
86
94
### ` --trace-export [name] `
87
95
88
- Trace export name to see where it's imported. Implies [ --trace] [ 5 ] .
96
+ Trace export name to see where it's imported. Implies [ --trace] [ 7 ] .
89
97
90
98
### ` --trace-file [path] `
91
99
92
- Trace file to see where its exports are imported. Implies [ --trace] [ 5 ] .
100
+ Trace file to see where its exports are imported. Implies [ --trace] [ 7 ] .
93
101
94
102
## Configuration
95
103
@@ -115,7 +123,7 @@ Default location: `tsconfig.json`
115
123
116
124
### ` --workspace [dir] `
117
125
118
- [ Lint a single workspace] [ 6 ] including its ancestor and dependent workspaces.
126
+ [ Lint a single workspace] [ 8 ] including its ancestor and dependent workspaces.
119
127
The default behavior is to lint all configured workspaces.
120
128
121
129
Shortcut: ` -W `
@@ -139,7 +147,7 @@ files when reporting unused exports:
139
147
knip --include-entry-exports
140
148
```
141
149
142
- Also see [ includeEntryExports] [ 7 ] .
150
+ Also see [ includeEntryExports] [ 9 ] .
143
151
144
152
### ` --include-libs `
145
153
@@ -150,11 +158,11 @@ Getting false positives for exports consumed by external libraries? Try the
150
158
knip --include-libs
151
159
```
152
160
153
- Also see [ external libs] [ 8 ] .
161
+ Also see [ external libs] [ 10 ] .
154
162
155
163
### ` --isolate-workspaces `
156
164
157
- By default, Knip optimizes performance using [ workspace sharing] [ 9 ] to existing
165
+ By default, Knip optimizes performance using [ workspace sharing] [ 11 ] to existing
158
166
TypeScript programs, based on the compatibility of their ` compilerOptions ` . This
159
167
flag disables this behavior and creates one program per workspace, which is
160
168
slower but memory is spread more evenly over time.
@@ -171,18 +179,18 @@ Lint only production source files. This excludes:
171
179
- Storybook stories
172
180
- ` devDependencies ` from ` package.json `
173
181
174
- Read more at [ Production Mode] [ 10 ] .
182
+ Read more at [ Production Mode] [ 12 ] .
175
183
176
184
### ` --strict `
177
185
178
186
Isolate workspaces and consider only direct dependencies. Implies [ production
179
- mode] [ 11 ] .
187
+ mode] [ 13 ] .
180
188
181
- Read more at [ Production Mode] [ 10 ] .
189
+ Read more at [ Production Mode] [ 12 ] .
182
190
183
191
### ` --fix `
184
192
185
- Read more at [ auto-fix] [ 12 ] .
193
+ Read more at [ auto-fix] [ 14 ] .
186
194
187
195
### ` --cache `
188
196
@@ -208,7 +216,7 @@ changes in `package.json` and/or `node_modules` are not supported.
208
216
209
217
## Filters
210
218
211
- Available [ issue types] [ 13 ] when filtering output using ` --include ` or
219
+ Available [ issue types] [ 15 ] when filtering output using ` --include ` or
212
220
` --exclude ` :
213
221
214
222
- ` files `
@@ -264,7 +272,7 @@ Shortcut to include all types of export issues:
264
272
265
273
### ` --experimental-tags `
266
274
267
- Deprecated. Use [ --tags] [ 14 ] instead.
275
+ Deprecated. Use [ --tags] [ 16 ] instead.
268
276
269
277
### ` --tags `
270
278
@@ -318,7 +326,7 @@ Can be repeated. Example:
318
326
knip --reporter compact
319
327
```
320
328
321
- Also see [ Reporters & Preprocessors] [ 15 ] .
329
+ Also see [ Reporters & Preprocessors] [ 17 ] .
322
330
323
331
### ` --reporter-options [json] `
324
332
@@ -353,7 +361,7 @@ Pass extra options to the preprocessor as JSON string.
353
361
knip --preprocessor ./preproc.ts --preprocessor-options ' {"key":"value"}'
354
362
```
355
363
356
- Also see [ Reporters & Preprocessors] [ 15 ] .
364
+ Also see [ Reporters & Preprocessors] [ 17 ] .
357
365
358
366
## Exit code
359
367
@@ -375,16 +383,18 @@ Maximum number of issues before non-zero exit code. Default: `0`
375
383
376
384
[ 1 ] : https://bun.sh
377
385
[ 2 ] : ../reference/known-issues.md
378
- [ 3 ] : https://github.com/oven-sh/bun/issues/9271
379
- [ 4 ] : ../guides/troubleshooting.md#trace
380
- [ 5 ] : #--trace
381
- [ 6 ] : ../features/monorepos-and-workspaces.md#lint-a-single-workspace
382
- [ 7 ] : ./configuration.md#includeentryexports
383
- [ 8 ] : ../guides/handling-issues.mdx#external-libraries
384
- [ 9 ] : ../guides/performance.md#workspace-sharing
385
- [ 10 ] : ../features/production-mode.md
386
- [ 11 ] : #--production
387
- [ 12 ] : ../features/auto-fix.mdx
388
- [ 13 ] : ./issue-types.md
389
- [ 14 ] : #--tags
390
- [ 15 ] : ../features/reporters.md
386
+ [ 3 ] : https://no-color.org/
387
+ [ 4 ] : https://www.npmjs.com/package/picocolors
388
+ [ 5 ] : https://github.com/oven-sh/bun/issues/9271
389
+ [ 6 ] : ../guides/troubleshooting.md#trace
390
+ [ 7 ] : #--trace
391
+ [ 8 ] : ../features/monorepos-and-workspaces.md#lint-a-single-workspace
392
+ [ 9 ] : ./configuration.md#includeentryexports
393
+ [ 10 ] : ../guides/handling-issues.mdx#external-libraries
394
+ [ 11 ] : ../guides/performance.md#workspace-sharing
395
+ [ 12 ] : ../features/production-mode.md
396
+ [ 13 ] : #--production
397
+ [ 14 ] : ../features/auto-fix.mdx
398
+ [ 15 ] : ./issue-types.md
399
+ [ 16 ] : #--tags
400
+ [ 17 ] : ../features/reporters.md
0 commit comments