knip 2.0.0-alpha.0 → 2.0.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -21,27 +21,29 @@ The dots don't connect themselves. This is where Knip comes in:
21
21
  - [x] Finds unused members of classes and enums
22
22
  - [x] Built-in support for [monorepos/workspaces][1]
23
23
  - [x] Growing list of [built-in plugins][2]
24
+ - [x] Use [compilers][3] to include other file types (e.g. MDX, Svelte, Astro)
24
25
  - [x] Checks npm scripts for used and unlisted dependencies
25
26
  - [x] Supports JavaScript (without `tsconfig.json`, or TypeScript `allowJs: true`)
26
- - [x] Features multiple [reporters][3] and supports [custom reporters][4]
27
+ - [x] Features multiple [reporters][4] and supports [custom reporters][5]
27
28
  - [x] Run Knip as part of your CI environment to detect issues and prevent regressions
28
29
 
29
30
  Knip shines in both small and large projects. It's a fresh take on keeping your projects clean & tidy!
30
31
 
31
- [![An orange cow with scissors, Van Gogh style][6]][5] <sup>_“An orange cow with scissors, Van Gogh style” - generated
32
+ [![An orange cow with scissors, Van Gogh style][7]][6] <sup>_“An orange cow with scissors, Van Gogh style” - generated
32
33
  with OpenAI_</sup>
33
34
 
34
- ## Migrating to v1.0.0
35
+ ## Migrating to v2.0.0
35
36
 
36
- When coming from version v0.13.3 or before, please see [migration to v1][7].
37
+ Migrating from v1 to v2 requires no changes in configuration. Please see [https://github.com/webpro/knip/issues/73][8]
38
+ for the full story.
37
39
 
38
40
  ## Issues
39
41
 
40
- Are you seeing false positives? Please report them by [opening an issue in this repo][8]. Bonus points for linking to a
42
+ Are you seeing false positives? Please report them by [opening an issue in this repo][9]. Bonus points for linking to a
41
43
  public repository using Knip, or even opening a pull request with a directory and example files in `test/fixtures`.
42
44
  Correctness and bug fixes have priority over performance and new features.
43
45
 
44
- Also see the [FAQ][9].
46
+ Also see the [FAQ][10].
45
47
 
46
48
  ## Installation
47
49
 
@@ -52,14 +54,24 @@ Knip supports LTS versions of Node.js, and currently requires at least Node.js v
52
54
  ## Usage
53
55
 
54
56
  Knip has good defaults and you can run it without any configuration, but especially larger projects get more out of Knip
55
- with a configuration file (or a `knip` property in `package.json`). Let's name this file `knip.json` with these contents
56
- (you might want to adjust right away for your project):
57
+ with a configuration file (or a `knip` property in `package.json`). Here's a `knip.json` with the default values:
57
58
 
58
59
  ```json
59
60
  {
60
- "$schema": "https://unpkg.com/knip@1/schema.json",
61
- "entry": ["src/index.ts"],
62
- "project": ["src/**/*.ts"]
61
+ "$schema": "https://unpkg.com/knip@next/schema.json",
62
+ "entry": ["index.{js,mjs,cjs,jsx,ts,tsx}", "src/index.{js,mjs,cjs,jsx,ts,tsx}"],
63
+ "project": ["**/*.{js,mjs,cjs,jsx,ts,tsx}"]
64
+ }
65
+ ```
66
+
67
+ If this matches your project, you don't need any configuration. But let's say you are using `.ts` files excusively and
68
+ have all source files in the `lib` directory:
69
+
70
+ ```json
71
+ {
72
+ "$schema": "https://unpkg.com/knip@next/schema.json",
73
+ "entry": ["lib/index.ts"],
74
+ "project": ["lib/**/*.ts"]
63
75
  }
64
76
  ```
65
77
 
@@ -79,7 +91,7 @@ const config: KnipConfig = {
79
91
  export default config;
80
92
  ```
81
93
 
82
- If you have, please see [workspaces & monorepos][1].
94
+ Please see [workspaces & monorepos][1] for more details about configuring them.
83
95
 
84
96
  Then run the checks with `npx knip`. Or first add this script to `package.json`:
85
97
 
@@ -124,7 +136,7 @@ Use `npm run knip` to analyze the project and output unused files, dependencies
124
136
  --h, --help Print this help text
125
137
  --V, version Print version
126
138
 
127
- (1) Issue types: files, dependencies, unlisted, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates
139
+ (1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates
128
140
 
129
141
  Examples:
130
142
 
@@ -153,20 +165,19 @@ The report contains the following types of issues:
153
165
 
154
166
  - **Unused files**: did not find references to this file
155
167
  - **Unused dependencies**: did not find references to this dependency
156
- - **Unlisted or unresolved dependencies**: used dependencies, but not listed in package.json _(1)_
168
+ - **Unlisted dependencies**: used dependencies, but not listed in package.json
169
+ - **Unresolved imports**: import specifiers that could not be resolved
157
170
  - **Unused exports**: did not find references to this exported variable
158
- - **Unused exports in namespaces**: did not find direct references to this exported variable _(2)_
171
+ - **Unused exports in namespaces**: did not find direct references to this exported variable _(1)_
159
172
  - **Unused exported types**: did not find references to this exported type
160
- - **Unused exported types in namespaces**: did not find direct references to this exported variable _(2)_
173
+ - **Unused exported types in namespaces**: did not find direct references to this exported variable _(1)_
161
174
  - **Unused exported enum members**: did not find references to this member of the exported enum
162
175
  - **Unused exported class members**: did not find references to this member of the exported class
163
176
  - **Duplicate exports**: the same thing is exported more than once
164
177
 
165
178
  When an issue type has zero issues, it is not shown.
166
179
 
167
- _(1)_ This includes imports that could not be resolved.
168
-
169
- _(2)_ The variable or type is not referenced directly, and has become a member of a namespace. Knip can't find a
180
+ _(1)_ The variable or type is not referenced directly, and has become a member of a namespace. Knip can't find a
170
181
  reference to it, so you can _probably_ remove it.
171
182
 
172
183
  ### Output filters
@@ -174,9 +185,6 @@ reference to it, so you can _probably_ remove it.
174
185
  You can `--include` or `--exclude` any of the types to slice & dice the report to your needs. Alternatively, they can be
175
186
  added to the configuration (e.g. `"exclude": ["dependencies"]`).
176
187
 
177
- Knip finds issues of type `files`, `dependencies`, `unlisted` and `duplicates` very fast. Finding unused exports
178
- requires deeper analysis (`exports`, `nsExports`, `classMembers`, `types`, `nsTypes`, `enumMembers`).
179
-
180
188
  Use `--include` to report only specific issue types (the following example commands do the same):
181
189
 
182
190
  knip --include files --include dependencies
@@ -189,7 +197,7 @@ Use `--exclude` to ignore reports you're not interested in:
189
197
  Use `--dependencies` or `--exports` as shortcuts to combine groups of related types.
190
198
 
191
199
  Still not happy with the results? Getting too much output/false positives? The [FAQ][9] may be useful. Feel free to open
192
- an issue and I'm happy to look into it. Also see the next section on how to [ignore][10] certain false positives:
200
+ an issue and I'm happy to look into it. Also see the next section on how to [ignore][11] certain false positives:
193
201
 
194
202
  ## Ignore
195
203
 
@@ -204,6 +212,8 @@ There are a few ways to tell Knip to ignore certain packages, binaries, dependen
204
212
  }
205
213
  ```
206
214
 
215
+ They can also be configured per workspace (except for `ignoreWorkspaces`).
216
+
207
217
  ## Now what?
208
218
 
209
219
  This is the fun part! Knip, knip, knip ✂️
@@ -213,6 +223,7 @@ As always, make sure to backup files or use Git before deleting files or making
213
223
  - Unused files can be removed.
214
224
  - Unused dependencies can be removed from `package.json`.
215
225
  - Unlisted dependencies should be added to `package.json`.
226
+ - Unresolved imports should be reviewed.
216
227
  - Unused exports and types: remove the `export` keyword in front of unused exports. Then you can see whether the
217
228
  variable or type is used within the same file. If this is not the case, it can be removed.
218
229
  - Duplicate exports can be removed so they're exported only once.
@@ -243,7 +254,13 @@ be part of the analysis. Here's an example:
243
254
  }
244
255
  ```
245
256
 
246
- Note that if you have a root workspace, it must be under `workspaces` and have the `"."` key like in the example.
257
+ It might be useful to run Knip first with no or little configuration to see where it needs different entry and/or
258
+ project files. The default configuration of each workspace is the same as in the introduction of this documentation.
259
+
260
+ Workspaces are sometimes also referred to as packages in a monorepo. Knip uses the term workspaces exclusively to
261
+ indicate the directories that have a `package.json`.
262
+
263
+ Root workspaces must be under `workspaces` and have the `"."` key like in the example.
247
264
 
248
265
  Knip supports workspaces as defined in three possible locations:
249
266
 
@@ -251,8 +268,6 @@ Knip supports workspaces as defined in three possible locations:
251
268
  - In the `workspaces.packages` array in `package.json`.
252
269
  - In the `packages` array in `pnpm-workspace.yaml`.
253
270
 
254
- Every directory with a match in `workspaces` of `knip.json` is part of the analysis.
255
-
256
271
  Extra "workspaces" not configured as a workspace in the root `package.json` can be configured as well, Knip is happy to
257
272
  analyze unused dependencies and exports from any directory with a `package.json`.
258
273
 
@@ -260,42 +275,44 @@ Here's some example output when running Knip in a workspace:
260
275
 
261
276
  <img src="./assets/screenshot-workspaces.png" alt="example output in workspaces" width="578">
262
277
 
278
+ Use `--debug` to get more verbose output.
279
+
263
280
  ## Plugins
264
281
 
265
282
  Knip contains a growing list of plugins:
266
283
 
267
- - [Babel][11]
268
- - [Capacitor][12]
269
- - [Changesets][13]
270
- - [commitlint][14]
271
- - [Cypress][15]
272
- - [ESLint][16]
273
- - [Gatsby][17]
274
- - [GitHub Actions][18]
275
- - [husky][19]
276
- - [Jest][20]
277
- - [Lefthook][21]
278
- - [lint-staged][22]
279
- - [markdownlint][23]
280
- - [Mocha][24]
281
- - [Next.js][25]
282
- - [npm-package-json-lint][26]
283
- - [Nx][27]
284
- - [nyc][28]
285
- - [Playwright][29]
286
- - [PostCSS][30]
287
- - [Prettier][31]
288
- - [Release It][32]
289
- - [Remark][33]
290
- - [Remix][34]
291
- - [Rollup][35]
292
- - [Sentry][36]
293
- - [Storybook][37]
294
- - [Stryker][38]
295
- - [TypeDoc][39]
296
- - [TypeScript][40]
297
- - [Vitest][41]
298
- - [Webpack][42]
284
+ - [Babel][12]
285
+ - [Capacitor][13]
286
+ - [Changesets][14]
287
+ - [commitlint][15]
288
+ - [Cypress][16]
289
+ - [ESLint][17]
290
+ - [Gatsby][18]
291
+ - [GitHub Actions][19]
292
+ - [husky][20]
293
+ - [Jest][21]
294
+ - [Lefthook][22]
295
+ - [lint-staged][23]
296
+ - [markdownlint][24]
297
+ - [Mocha][25]
298
+ - [Next.js][26]
299
+ - [npm-package-json-lint][27]
300
+ - [Nx][28]
301
+ - [nyc][29]
302
+ - [Playwright][30]
303
+ - [PostCSS][31]
304
+ - [Prettier][32]
305
+ - [Release It][33]
306
+ - [Remark][34]
307
+ - [Remix][35]
308
+ - [Rollup][36]
309
+ - [Sentry][37]
310
+ - [Storybook][38]
311
+ - [Stryker][39]
312
+ - [TypeDoc][40]
313
+ - [TypeScript][41]
314
+ - [Vitest][42]
315
+ - [Webpack][43]
299
316
 
300
317
  Plugins are automatically activated. Each plugin is automatically enabled based on simple heuristics. Most of them check
301
318
  whether one or one of a few (dev) dependencies are listed in `package.json`. Once enabled, they add a set of
@@ -303,7 +320,7 @@ configuration and/or entry files for Knip to analyze. These defaults can be over
303
320
 
304
321
  Most plugins use one or both of the following file types:
305
322
 
306
- - `config` - custom dependency resolvers are applied to the [config files][43]
323
+ - `config` - custom dependency resolvers are applied to the [config files][44]
307
324
  - `entry` - files to include with the analysis of the rest of the source code
308
325
 
309
326
  See each plugin's documentation for its default values.
@@ -339,6 +356,25 @@ get started:
339
356
 
340
357
  npm run create-plugin -- --name [myplugin]
341
358
 
359
+ ## Compilers
360
+
361
+ Knip v2 introduces compilers which allows to include files that are not JavaScript or TypeScript in the process of
362
+ finding unused or missing dependencies.
363
+
364
+ Currently this is only supported by using `knip.js` or `knip.ts`. Provide a `compilers` object in the configuration
365
+ where each key represents the extension and the value is a function that takes the contents of these files as input and
366
+ returns JavaScript or TypeScript as output. For example:
367
+
368
+ ```js
369
+ import { compileSync } from 'mdx-js/mdx';
370
+
371
+ export default {
372
+ compilers: {
373
+ mdx: compileSync,
374
+ },
375
+ };
376
+ ```
377
+
342
378
  ## Production Mode
343
379
 
344
380
  The default mode for Knip is holistic and targets all project code, including configuration files and tests. Test files
@@ -387,7 +423,7 @@ aliases. They can be configured manually:
387
423
 
388
424
  ```json
389
425
  {
390
- "$schema": "https://unpkg.com/knip@1/schema.json",
426
+ "$schema": "https://unpkg.com/knip@next/schema.json",
391
427
  "paths": {
392
428
  "@lib": ["./lib/index.ts"],
393
429
  "@lib/*": ["./lib/*"]
@@ -404,10 +440,10 @@ Each workspace can also have its own `paths` configured. Note that Knip `paths`
404
440
 
405
441
  Knip provides the following built-in reporters:
406
442
 
407
- - [`codeowners`][44]
408
- - [`compact`][45]
409
- - [`json`][46]
410
- - [`symbol`][47] (default)
443
+ - [`codeowners`][45]
444
+ - [`compact`][46]
445
+ - [`json`][47]
446
+ - [`symbol`][48] (default)
411
447
 
412
448
  The `compact` reporter shows the sorted files first, and then a list of symbols:
413
449
 
@@ -434,7 +470,7 @@ type ReporterOptions = {
434
470
 
435
471
  The data can then be used to write issues to `stdout`, a JSON or CSV file, or sent to a service.
436
472
 
437
- Find more details and ideas in [custom reporters][48].
473
+ Find more details and ideas in [custom reporters][49].
438
474
 
439
475
  ## Libraries and "unused" exports
440
476
 
@@ -481,7 +517,7 @@ an issue.
481
517
 
482
518
  When the list of unused files is too long, this means the gap between the set of `entry` and the set of `project` files
483
519
  needs tweaking. The gap can be narrowed down by increasing the `entry` files or reducing the `project` files, for
484
- instance by ignoring specific folders that are not related to the source code imported by the `entry` files.
520
+ instance by ignoring specific directories that are not related to the source code imported by the `entry` files.
485
521
 
486
522
  #### Too many unused dependencies
487
523
 
@@ -492,7 +528,7 @@ When unused dependencies are related to dependencies having a Knip [plugin][1],
492
528
  for that dependency are at custom locations. The default values are at the plugin's documentation, and can be overridden
493
529
  to match the custom location(s).
494
530
 
495
- When the dependencies don't have a Knip plugin yet, please file an issue or [create a new plugin][49].
531
+ When the dependencies don't have a Knip plugin yet, please file an issue or [create a new plugin][50].
496
532
 
497
533
  #### Too many unused exports
498
534
 
@@ -500,7 +536,7 @@ When the project is a library and the exports are meant to be used by consumers
500
536
 
501
537
  1. By default, unused exports of `entry` files are not reported. You could re-export from an existing entry file, or
502
538
  add the containing file to the `entry` array in the configuration.
503
- 2. The exported values or types can be marked [using the JSDoc `@public` tag][50].
539
+ 2. The exported values or types can be marked [using the JSDoc `@public` tag][51].
504
540
 
505
541
  ### How to start using Knip in CI while having too many issues to sort out?
506
542
 
@@ -520,7 +556,7 @@ All of this is hiding problems, so please make sure to plan for fixing them and/
520
556
 
521
557
  This table is an ongoing comparison. Based on their docs (please report any mistakes):
522
558
 
523
- | Feature | **knip** | [depcheck][51] | [unimported][52] | [ts-unused-exports][53] | [ts-prune][54] |
559
+ | Feature | **knip** | [depcheck][52] | [unimported][53] | [ts-unused-exports][54] | [ts-prune][55] |
524
560
  | :--------------------------------- | :------: | :------------: | :--------------: | :---------------------: | :------------: |
525
561
  | Unused files | ✅ | - | ✅ | - | - |
526
562
  | Unused dependencies | ✅ | ✅ | ✅ | - | - |
@@ -555,7 +591,7 @@ The following commands are similar:
555
591
  unimported
556
592
  knip --production --dependencies --include files
557
593
 
558
- Also see [production mode][55].
594
+ Also see [production mode][56].
559
595
 
560
596
  ### ts-unused-exports
561
597
 
@@ -587,56 +623,57 @@ for the job. I'm motivated to make knip perfectly suited for the job of cutting
587
623
 
588
624
  [1]: #workspaces--monorepos
589
625
  [2]: #plugins
590
- [3]: #reporters
591
- [4]: #custom-reporters
592
- [5]: https://labs.openai.com/s/xZQACaLepaKya0PRUPtIN5dC
593
- [6]: ./assets/cow-with-orange-scissors-van-gogh-style.webp
594
- [7]: ./docs/migration-to-v1.md
595
- [8]: https://github.com/webpro/knip/issues
596
- [9]: #faq
597
- [10]: #ignore
598
- [11]: ./src/plugins/babel
599
- [12]: ./src/plugins/capacitor
600
- [13]: ./src/plugins/changesets
601
- [14]: ./src/plugins/commitlint
602
- [15]: ./src/plugins/cypress
603
- [16]: ./src/plugins/eslint
604
- [17]: ./src/plugins/gatsby
605
- [18]: ./src/plugins/github-actions
606
- [19]: ./src/plugins/husky
607
- [20]: ./src/plugins/jest
608
- [21]: ./src/plugins/lefthook
609
- [22]: ./src/plugins/lint-staged
610
- [23]: ./src/plugins/markdownlint
611
- [24]: ./src/plugins/mocha
612
- [25]: ./src/plugins/next
613
- [26]: ./src/plugins/npm-package-json-lint
614
- [27]: ./src/plugins/nx
615
- [28]: ./src/plugins/nyc
616
- [29]: ./src/plugins/playwright
617
- [30]: ./src/plugins/postcss
618
- [31]: ./src/plugins/prettier
619
- [32]: ./src/plugins/release-it
620
- [33]: ./src/plugins/remark
621
- [34]: ./src/plugins/remix
622
- [35]: ./src/plugins/rollup
623
- [36]: ./src/plugins/sentry
624
- [37]: ./src/plugins/storybook
625
- [38]: ./src/plugins/stryker
626
- [39]: ./src/plugins/typedoc
627
- [40]: ./src/plugins/typescript
628
- [41]: ./src/plugins/vitest
629
- [42]: ./src/plugins/webpack
630
- [43]: #config
631
- [44]: #code-owners
632
- [45]: #compact
633
- [46]: #json
634
- [47]: #symbol-default
635
- [48]: ./docs/custom-reporters.md
636
- [49]: #create-a-new-plugin
637
- [50]: #libraries-and-unused-exports
638
- [51]: https://github.com/depcheck/depcheck
639
- [52]: https://github.com/smeijer/unimported
640
- [53]: https://github.com/pzavolinsky/ts-unused-exports
641
- [54]: https://github.com/nadeesha/ts-prune
642
- [55]: #production-mode
626
+ [3]: #compilers
627
+ [4]: #reporters
628
+ [5]: #custom-reporters
629
+ [6]: https://labs.openai.com/s/xZQACaLepaKya0PRUPtIN5dC
630
+ [7]: ./assets/cow-with-orange-scissors-van-gogh-style.webp
631
+ [8]: https://github.com/webpro/knip/issues/73
632
+ [9]: https://github.com/webpro/knip/issues
633
+ [10]: #faq
634
+ [11]: #ignore
635
+ [12]: ./src/plugins/babel
636
+ [13]: ./src/plugins/capacitor
637
+ [14]: ./src/plugins/changesets
638
+ [15]: ./src/plugins/commitlint
639
+ [16]: ./src/plugins/cypress
640
+ [17]: ./src/plugins/eslint
641
+ [18]: ./src/plugins/gatsby
642
+ [19]: ./src/plugins/github-actions
643
+ [20]: ./src/plugins/husky
644
+ [21]: ./src/plugins/jest
645
+ [22]: ./src/plugins/lefthook
646
+ [23]: ./src/plugins/lint-staged
647
+ [24]: ./src/plugins/markdownlint
648
+ [25]: ./src/plugins/mocha
649
+ [26]: ./src/plugins/next
650
+ [27]: ./src/plugins/npm-package-json-lint
651
+ [28]: ./src/plugins/nx
652
+ [29]: ./src/plugins/nyc
653
+ [30]: ./src/plugins/playwright
654
+ [31]: ./src/plugins/postcss
655
+ [32]: ./src/plugins/prettier
656
+ [33]: ./src/plugins/release-it
657
+ [34]: ./src/plugins/remark
658
+ [35]: ./src/plugins/remix
659
+ [36]: ./src/plugins/rollup
660
+ [37]: ./src/plugins/sentry
661
+ [38]: ./src/plugins/storybook
662
+ [39]: ./src/plugins/stryker
663
+ [40]: ./src/plugins/typedoc
664
+ [41]: ./src/plugins/typescript
665
+ [42]: ./src/plugins/vitest
666
+ [43]: ./src/plugins/webpack
667
+ [44]: #config
668
+ [45]: #code-owners
669
+ [46]: #compact
670
+ [47]: #json
671
+ [48]: #symbol-default
672
+ [49]: ./docs/custom-reporters.md
673
+ [50]: #create-a-new-plugin
674
+ [51]: #libraries-and-unused-exports
675
+ [52]: https://github.com/depcheck/depcheck
676
+ [53]: https://github.com/smeijer/unimported
677
+ [54]: https://github.com/pzavolinsky/ts-unused-exports
678
+ [55]: https://github.com/nadeesha/ts-prune
679
+ [56]: #production-mode
@@ -1,4 +1,4 @@
1
- export declare const helpText = "\u2702\uFE0F Find unused files, dependencies and exports in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.js, knip.ts or package.json#knip)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n --production Analyze only production source files (e.g. no tests, devDependencies, exported types)\n --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n --workspace Analyze a single workspace (default: analyze all configured workspaces)\n --ignore Ignore files matching this glob pattern, can be repeated\n --no-gitignore Don't use .gitignore\n --include Report only provided issue type(s), can be comma-separated or repeated (1)\n --exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)\n --dependencies Shortcut for --include dependencies,unlisted\n --exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\n --no-progress Don't show dynamic progress updates\n --reporter Select reporter: symbols, compact, codeowners, json (default: symbols)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --no-exit-code Always exit with code zero (0)\n --max-issues Maximum number of issues before non-zero exit code (default: 0)\n --debug Show debug output\n --debug-file-filter Filter for files in debug output (regex as string)\n --performance Measure count and running time of expensive functions and display stats table\n --h, --help Print this help text\n --V, version Print version\n\n(1) Issue types: files, dependencies, unlisted, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --debug --debug-file-filter '(specific|particular)-module'\n\nMore documentation and bug reports: https://github.com/webpro/knip";
1
+ export declare const helpText = "\u2702\uFE0F Find unused files, dependencies and exports in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.js, knip.ts or package.json#knip)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n --production Analyze only production source files (e.g. no tests, devDependencies, exported types)\n --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n --workspace Analyze a single workspace (default: analyze all configured workspaces)\n --ignore Ignore files matching this glob pattern, can be repeated\n --no-gitignore Don't use .gitignore\n --include Report only provided issue type(s), can be comma-separated or repeated (1)\n --exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)\n --dependencies Shortcut for --include dependencies,unlisted\n --exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\n --no-progress Don't show dynamic progress updates\n --reporter Select reporter: symbols, compact, codeowners, json (default: symbols)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --no-exit-code Always exit with code zero (0)\n --max-issues Maximum number of issues before non-zero exit code (default: 0)\n --debug Show debug output\n --debug-file-filter Filter for files in debug output (regex as string)\n --performance Measure count and running time of expensive functions and display stats table\n --h, --help Print this help text\n --V, version Print version\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --debug --debug-file-filter '(specific|particular)-module'\n\nMore documentation and bug reports: https://github.com/webpro/knip";
2
2
  declare const _default: {
3
3
  values: {
4
4
  config: string | undefined;
@@ -26,7 +26,7 @@ Options:
26
26
  --h, --help Print this help text
27
27
  --V, version Print version
28
28
 
29
- (1) Issue types: files, dependencies, unlisted, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates
29
+ (1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates
30
30
 
31
31
  Examples:
32
32
 
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.0.0-alpha.0";
1
+ export declare const version = "2.0.0-alpha.1";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.0.0-alpha.0';
1
+ export const version = '2.0.0-alpha.1';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "2.0.0-alpha.0",
3
+ "version": "2.0.0-alpha.1",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://github.com/webpro/knip",
6
6
  "repository": "github:webpro/knip",
package/schema.json CHANGED
@@ -129,17 +129,17 @@
129
129
  "title": "Files to ignore in the analysis.",
130
130
  "example": ["**/fixtures", "mocks"],
131
131
  "default": [],
132
- "$ref": "#/definitions/globPatterns",
133
- "ignoreBinaries": {
134
- "title": "Binaries to ignore",
135
- "examples": ["rm", "docker-compose", "curl"],
136
- "$ref": "#/definitions/list"
137
- },
138
- "ignoreDependencies": {
139
- "title": "Dependencies from package.json to ignore",
140
- "examples": ["husky", "lint-staged"],
141
- "$ref": "#/definitions/list"
142
- }
132
+ "$ref": "#/definitions/globPatterns"
133
+ },
134
+ "ignoreBinaries": {
135
+ "title": "Binaries to ignore",
136
+ "examples": ["rm", "docker-compose", "curl"],
137
+ "$ref": "#/definitions/list"
138
+ },
139
+ "ignoreDependencies": {
140
+ "title": "Dependencies from package.json to ignore",
141
+ "examples": ["husky", "lint-staged"],
142
+ "$ref": "#/definitions/list"
143
143
  }
144
144
  }
145
145
  },