knip 2.20.0 → 2.20.2
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 +94 -92
- package/dist/WorkspaceWorker.js +2 -1
- package/dist/plugins/eslint/index.js +2 -1
- package/dist/plugins/prettier/index.js +1 -1
- package/dist/plugins/vitest/index.js +3 -4
- package/dist/types/plugins.d.ts +2 -1
- package/dist/typescript/getImportsAndExports.js +2 -6
- package/dist/typescript/visitors/exports/index.js +1 -1
- package/dist/typescript/visitors/imports/index.js +1 -1
- package/dist/typescript/visitors/scripts/index.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -53,25 +53,26 @@ For updates or questions, come hang out in [The Knip Barn (Discord)][8], or foll
|
|
|
53
53
|
- [Paths][22]
|
|
54
54
|
- [Production Mode][23]
|
|
55
55
|
- [Strict][24]
|
|
56
|
-
- [
|
|
57
|
-
- [
|
|
58
|
-
|
|
59
|
-
- [
|
|
60
|
-
- [
|
|
56
|
+
- [Ignore `@internal` exports][25]
|
|
57
|
+
- [Plugins][26]
|
|
58
|
+
- [Output][27]
|
|
59
|
+
- [Screenshots][28]
|
|
60
|
+
- [Reading the report][29]
|
|
61
|
+
- [Rules & Filters][30]
|
|
61
62
|
- [Reporters][4]
|
|
62
|
-
- [Fixing Issues][
|
|
63
|
-
- [Command Line Options][
|
|
64
|
-
- [Potential boost with `--no-gitignore`][
|
|
65
|
-
- [Comparison & Migration][
|
|
66
|
-
- [depcheck][
|
|
67
|
-
- [unimported][
|
|
68
|
-
- [ts-unused-exports][
|
|
69
|
-
- [ts-prune][
|
|
70
|
-
- [Projects using Knip][
|
|
71
|
-
- [Articles, etc.][
|
|
72
|
-
- [Why "Knip"?][
|
|
73
|
-
- [Really, another unused file/dependency/export finder?][
|
|
74
|
-
- [Contributors][
|
|
63
|
+
- [Fixing Issues][31]
|
|
64
|
+
- [Command Line Options][32]
|
|
65
|
+
- [Potential boost with `--no-gitignore`][33]
|
|
66
|
+
- [Comparison & Migration][34]
|
|
67
|
+
- [depcheck][35]
|
|
68
|
+
- [unimported][36]
|
|
69
|
+
- [ts-unused-exports][37]
|
|
70
|
+
- [ts-prune][38]
|
|
71
|
+
- [Projects using Knip][39]
|
|
72
|
+
- [Articles, etc.][40]
|
|
73
|
+
- [Why "Knip"?][41]
|
|
74
|
+
- [Really, another unused file/dependency/export finder?][42]
|
|
75
|
+
- [Contributors][43]
|
|
75
76
|
|
|
76
77
|
## Getting Started
|
|
77
78
|
|
|
@@ -134,7 +135,7 @@ Run the checks with `npx knip`. Or first add this script to `package.json`:
|
|
|
134
135
|
Then use `npm run knip` to analyze the project and output unused files, dependencies and exports. Knip works just fine
|
|
135
136
|
with `yarn` or `pnpm` as well.
|
|
136
137
|
|
|
137
|
-
See [Command Line Options][
|
|
138
|
+
See [Command Line Options][32] for an overview of available CLI options.
|
|
138
139
|
|
|
139
140
|
## Configuration
|
|
140
141
|
|
|
@@ -320,7 +321,7 @@ has them at `e2e-tests/*.spec.ts`. Here's how to configure this:
|
|
|
320
321
|
#### Multi-project repositories
|
|
321
322
|
|
|
322
323
|
Some repositories have a single `package.json`, but consist of multiple projects with configuration files across the
|
|
323
|
-
repository (such as the [Nx "intregrated repo" style][
|
|
324
|
+
repository (such as the [Nx "intregrated repo" style][44]). Let's assume some of these projects are apps and have their
|
|
324
325
|
own Cypress configuration and test files. In that case, we could configure the Cypress plugin like this:
|
|
325
326
|
|
|
326
327
|
```json
|
|
@@ -337,7 +338,7 @@ In case a plugin causes issues, it can be disabled by using `false` as its value
|
|
|
337
338
|
|
|
338
339
|
#### Create a new plugin
|
|
339
340
|
|
|
340
|
-
Getting false positives because a plugin is missing? Want to help out? Please read more at [writing a plugin][
|
|
341
|
+
Getting false positives because a plugin is missing? Want to help out? Please read more at [writing a plugin][45]. This
|
|
341
342
|
guide also contains more details if you want to learn more about plugins and why they are useful.
|
|
342
343
|
|
|
343
344
|
### Compilers
|
|
@@ -360,7 +361,7 @@ export default {
|
|
|
360
361
|
};
|
|
361
362
|
```
|
|
362
363
|
|
|
363
|
-
Read [Compilers][
|
|
364
|
+
Read [Compilers][46] for more details and examples.
|
|
364
365
|
|
|
365
366
|
### Ignore files, binaries, dependencies and workspaces
|
|
366
367
|
|
|
@@ -527,7 +528,7 @@ The report contains the following types of issues:
|
|
|
527
528
|
|
|
528
529
|
When an issue type has zero issues, it is not shown.
|
|
529
530
|
|
|
530
|
-
Getting too many reported issues and false positives? Read more about [handling issues][
|
|
531
|
+
Getting too many reported issues and false positives? Read more about [handling issues][47].
|
|
531
532
|
|
|
532
533
|
### Rules & Filters
|
|
533
534
|
|
|
@@ -554,7 +555,7 @@ Example:
|
|
|
554
555
|
}
|
|
555
556
|
```
|
|
556
557
|
|
|
557
|
-
See [reading the report][
|
|
558
|
+
See [reading the report][29] for the list of issue types.
|
|
558
559
|
|
|
559
560
|
The rules are modeled after the ESLint `rules` configuration, and could be extended in the future. For instance, to
|
|
560
561
|
apply filters or configurations only to a specific issue type.
|
|
@@ -575,7 +576,7 @@ Use `--exclude` to ignore reports you're not interested in:
|
|
|
575
576
|
|
|
576
577
|
Use `--dependencies` or `--exports` as shortcuts to combine groups of related types.
|
|
577
578
|
|
|
578
|
-
See [reading the report][
|
|
579
|
+
See [reading the report][29] for the list of issue types.
|
|
579
580
|
|
|
580
581
|
#### When to use rules or filters
|
|
581
582
|
|
|
@@ -602,7 +603,7 @@ When the provided built-in reporters are not sufficient, a custom reporter can b
|
|
|
602
603
|
Pass something like `--reporter ./my-reporter` from the command line. The results are passed to the function from its
|
|
603
604
|
default export and can be used to write issues to `stdout`, a JSON or CSV file, or sent to a service.
|
|
604
605
|
|
|
605
|
-
Find more details and ideas in [custom reporters][
|
|
606
|
+
Find more details and ideas in [custom reporters][48].
|
|
606
607
|
|
|
607
608
|
## Fixing Issues
|
|
608
609
|
|
|
@@ -620,7 +621,7 @@ Tip: back up files or use an VCS like Git before deleting files or making change
|
|
|
620
621
|
|
|
621
622
|
Repeat the process to reveal new unused files and exports. It's so liberating to remove unused things!
|
|
622
623
|
|
|
623
|
-
Getting too many reported issues and false positives? Read more about [handling issues][
|
|
624
|
+
Getting too many reported issues and false positives? Read more about [handling issues][49] describing potential causes
|
|
624
625
|
for false positives, and how to handle them.
|
|
625
626
|
|
|
626
627
|
## Command Line Options
|
|
@@ -670,13 +671,13 @@ for false positives, and how to handle them.
|
|
|
670
671
|
|
|
671
672
|
## Potential boost with `--no-gitignore`
|
|
672
673
|
|
|
673
|
-
To increase performance in a large monorepo, check out [Potential boost with `--no-gitignore`][
|
|
674
|
+
To increase performance in a large monorepo, check out [Potential boost with `--no-gitignore`][50].
|
|
674
675
|
|
|
675
676
|
## Comparison & Migration
|
|
676
677
|
|
|
677
678
|
This table is an ongoing comparison. Based on their docs (please report any mistakes):
|
|
678
679
|
|
|
679
|
-
| Feature | **knip** | [depcheck][
|
|
680
|
+
| Feature | **knip** | [depcheck][51] | [unimported][52] | [ts-unused-exports][53] | [ts-prune][54] |
|
|
680
681
|
| :---------------------- | :------: | :------------: | :--------------: | :---------------------: | :------------: |
|
|
681
682
|
| Unused files | ✅ | - | ✅ | - | - |
|
|
682
683
|
| Unused dependencies | ✅ | ✅ | ✅ | - | - |
|
|
@@ -734,25 +735,25 @@ The following commands are similar:
|
|
|
734
735
|
|
|
735
736
|
Many thanks to some of the early adopters of Knip:
|
|
736
737
|
|
|
737
|
-
- [Block Protocol][
|
|
738
|
-
- [DeepmergeTS][
|
|
739
|
-
- [eslint-plugin-functional][
|
|
740
|
-
- [freeCodeCamp.org][
|
|
741
|
-
- [is-immutable-type][
|
|
742
|
-
- [IsaacScript][
|
|
743
|
-
- [Nuxt][
|
|
744
|
-
- [Owncast][
|
|
745
|
-
- [release-it][
|
|
746
|
-
- [Template TypeScript Node Package][
|
|
747
|
-
- [Tipi][
|
|
738
|
+
- [Block Protocol][55]
|
|
739
|
+
- [DeepmergeTS][56]
|
|
740
|
+
- [eslint-plugin-functional][57]
|
|
741
|
+
- [freeCodeCamp.org][58]
|
|
742
|
+
- [is-immutable-type][59]
|
|
743
|
+
- [IsaacScript][60]
|
|
744
|
+
- [Nuxt][61]
|
|
745
|
+
- [Owncast][62]
|
|
746
|
+
- [release-it][63]
|
|
747
|
+
- [Template TypeScript Node Package][64]
|
|
748
|
+
- [Tipi][65]
|
|
748
749
|
|
|
749
750
|
## Articles, etc.
|
|
750
751
|
|
|
751
752
|
- Discord: hang out in [The Knip Barn][8]
|
|
752
|
-
- Ask your questions in the [Knip knowledge base][
|
|
753
|
-
- Smashing Magazine: [Knip: An Automated Tool For Finding Unused Files, Exports, And Dependencies][
|
|
754
|
-
- Effective TypeScript: [Recommendation Update: ✂️ Use knip to detect dead code and types][
|
|
755
|
-
- Josh Goldberg: [Speeding Up Centered Part 4: Unused Code Bloat][
|
|
753
|
+
- Ask your questions in the [Knip knowledge base][66] (powered by OpenAI and [7-docs][67], experimental!)
|
|
754
|
+
- Smashing Magazine: [Knip: An Automated Tool For Finding Unused Files, Exports, And Dependencies][68]
|
|
755
|
+
- Effective TypeScript: [Recommendation Update: ✂️ Use knip to detect dead code and types][69]
|
|
756
|
+
- Josh Goldberg: [Speeding Up Centered Part 4: Unused Code Bloat][70]
|
|
756
757
|
|
|
757
758
|
## Why "Knip"?
|
|
758
759
|
|
|
@@ -770,7 +771,7 @@ each file, and traversing all of this, why not collect the various issues in one
|
|
|
770
771
|
|
|
771
772
|
Special thanks to the wonderful people who have contributed to this project:
|
|
772
773
|
|
|
773
|
-
[![Contributors][
|
|
774
|
+
[![Contributors][72]][71]
|
|
774
775
|
|
|
775
776
|
[1]: #workspaces
|
|
776
777
|
[2]: #plugins
|
|
@@ -796,53 +797,54 @@ Special thanks to the wonderful people who have contributed to this project:
|
|
|
796
797
|
[22]: #paths
|
|
797
798
|
[23]: #production-mode
|
|
798
799
|
[24]: #strict
|
|
799
|
-
[25]: #
|
|
800
|
-
[26]: #
|
|
801
|
-
[27]: #
|
|
802
|
-
[28]: #
|
|
803
|
-
[29]: #
|
|
804
|
-
[30]: #
|
|
805
|
-
[31]: #
|
|
806
|
-
[32]: #
|
|
807
|
-
[33]: #
|
|
808
|
-
[34]: #
|
|
809
|
-
[35]: #
|
|
810
|
-
[36]: #
|
|
811
|
-
[37]: #ts-
|
|
812
|
-
[38]: #
|
|
813
|
-
[39]: #
|
|
814
|
-
[40]: #
|
|
815
|
-
[41]: #
|
|
816
|
-
[42]: #
|
|
817
|
-
[43]:
|
|
818
|
-
[44]:
|
|
819
|
-
[45]: ./docs/
|
|
820
|
-
[46]:
|
|
821
|
-
[47]:
|
|
822
|
-
[48]: ./docs/
|
|
823
|
-
[49]: ./docs/
|
|
824
|
-
[50]:
|
|
825
|
-
[51]: https://github.com/
|
|
826
|
-
[52]: https://github.com/
|
|
827
|
-
[53]: https://github.com/
|
|
828
|
-
[54]: https://github.com/
|
|
829
|
-
[55]: https://github.com/
|
|
830
|
-
[56]: https://github.com/
|
|
831
|
-
[57]: https://github.com/
|
|
832
|
-
[58]: https://github.com/
|
|
833
|
-
[59]: https://github.com/
|
|
834
|
-
[60]: https://github.com/
|
|
835
|
-
[61]: https://github.com/
|
|
836
|
-
[62]: https://github.com/
|
|
837
|
-
[63]: https://github.com/
|
|
838
|
-
[64]: https://github.com/
|
|
839
|
-
[65]: https://
|
|
840
|
-
[66]: https://
|
|
841
|
-
[67]: https://
|
|
842
|
-
[68]: https://
|
|
843
|
-
[69]: https://
|
|
844
|
-
[70]: https://
|
|
845
|
-
[71]: https://
|
|
800
|
+
[25]: #ignore-internal-exports
|
|
801
|
+
[26]: #plugins-1
|
|
802
|
+
[27]: #output
|
|
803
|
+
[28]: #screenshots
|
|
804
|
+
[29]: #reading-the-report
|
|
805
|
+
[30]: #rules--filters
|
|
806
|
+
[31]: #fixing-issues
|
|
807
|
+
[32]: #command-line-options
|
|
808
|
+
[33]: #potential-boost-with---no-gitignore
|
|
809
|
+
[34]: #comparison--migration
|
|
810
|
+
[35]: #depcheck
|
|
811
|
+
[36]: #unimported
|
|
812
|
+
[37]: #ts-unused-exports
|
|
813
|
+
[38]: #ts-prune
|
|
814
|
+
[39]: #projects-using-knip
|
|
815
|
+
[40]: #articles-etc
|
|
816
|
+
[41]: #why-knip
|
|
817
|
+
[42]: #really-another-unused-filedependencyexport-finder
|
|
818
|
+
[43]: #contributors
|
|
819
|
+
[44]: https://nx.dev/concepts/integrated-vs-package-based
|
|
820
|
+
[45]: ./docs/writing-a-plugin.md
|
|
821
|
+
[46]: ./docs/compilers.md
|
|
822
|
+
[47]: #handling-issues
|
|
823
|
+
[48]: ./docs/custom-reporters.md
|
|
824
|
+
[49]: ./docs/handling-issues.md
|
|
825
|
+
[50]: ./docs/perf-boost-with-no-gitignore.md
|
|
826
|
+
[51]: https://github.com/depcheck/depcheck
|
|
827
|
+
[52]: https://github.com/smeijer/unimported
|
|
828
|
+
[53]: https://github.com/pzavolinsky/ts-unused-exports
|
|
829
|
+
[54]: https://github.com/nadeesha/ts-prune
|
|
830
|
+
[55]: https://github.com/blockprotocol/blockprotocol
|
|
831
|
+
[56]: https://github.com/RebeccaStevens/deepmerge-ts
|
|
832
|
+
[57]: https://github.com/eslint-functional/eslint-plugin-functional
|
|
833
|
+
[58]: https://github.com/freeCodeCamp/freeCodeCamp
|
|
834
|
+
[59]: https://github.com/RebeccaStevens/is-immutable-type
|
|
835
|
+
[60]: https://github.com/IsaacScript/isaacscript
|
|
836
|
+
[61]: https://github.com/nuxt/nuxt
|
|
837
|
+
[62]: https://github.com/owncast/owncast
|
|
838
|
+
[63]: https://github.com/release-it/release-it
|
|
839
|
+
[64]: https://github.com/JoshuaKGoldberg/template-typescript-node-package
|
|
840
|
+
[65]: https://github.com/meienberger/runtipi
|
|
841
|
+
[66]: https://knip.deno.dev
|
|
842
|
+
[67]: https://github.com/7-docs/7-docs
|
|
843
|
+
[68]: https://www.smashingmagazine.com/2023/08/knip-automated-tool-find-unused-files-exports-dependencies/
|
|
844
|
+
[69]: https://effectivetypescript.com/2023/07/29/knip/
|
|
845
|
+
[70]: https://www.joshuakgoldberg.com/blog/speeding-up-centered-part-4-unused-code-bloat/
|
|
846
|
+
[71]: https://github.com/webpro/knip/graphs/contributors
|
|
847
|
+
[72]: https://contrib.rocks/image?repo=webpro/knip
|
|
846
848
|
[plugin-ava]: ./src/plugins/ava
|
|
847
849
|
[plugin-babel]: ./src/plugins/babel
|
|
848
850
|
[plugin-capacitor]: ./src/plugins/capacitor
|
package/dist/WorkspaceWorker.js
CHANGED
|
@@ -49,7 +49,8 @@ export class WorkspaceWorker {
|
|
|
49
49
|
if (this.config[pluginName] === false)
|
|
50
50
|
continue;
|
|
51
51
|
const isEnabledInAncestor = this.enabledPluginsInAncestors.includes(pluginName);
|
|
52
|
-
if (isEnabledInAncestor ||
|
|
52
|
+
if (isEnabledInAncestor ||
|
|
53
|
+
(await plugin.isEnabled({ cwd: this.dir, manifest, dependencies, config: this.config }))) {
|
|
53
54
|
this.enabled[pluginName] = true;
|
|
54
55
|
}
|
|
55
56
|
}
|
|
@@ -3,7 +3,8 @@ import { hasDependency } from '../../util/plugin.js';
|
|
|
3
3
|
import { getDependenciesDeep } from './helpers.js';
|
|
4
4
|
export const NAME = 'ESLint';
|
|
5
5
|
export const ENABLERS = ['eslint'];
|
|
6
|
-
export const isEnabled = ({ dependencies, manifest }) => hasDependency(dependencies, ENABLERS) ||
|
|
6
|
+
export const isEnabled = ({ dependencies, manifest, config }) => hasDependency(dependencies, ENABLERS) ||
|
|
7
|
+
'eslint' in config ||
|
|
7
8
|
Boolean(manifest.name && /(^eslint-config|\/eslint-config)/.test(manifest.name));
|
|
8
9
|
export const CONFIG_FILE_PATTERNS = ['.eslintrc', '.eslintrc.{js,json,cjs}', '.eslintrc.{yml,yaml}', 'package.json'];
|
|
9
10
|
export const ENTRY_FILE_PATTERNS = ['eslint.config.js'];
|
|
@@ -2,7 +2,7 @@ import { timerify } from '../../util/Performance.js';
|
|
|
2
2
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
3
3
|
export const NAME = 'Prettier';
|
|
4
4
|
export const ENABLERS = ['prettier'];
|
|
5
|
-
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
5
|
+
export const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, ENABLERS) || 'prettier' in config;
|
|
6
6
|
export const CONFIG_FILE_PATTERNS = [
|
|
7
7
|
'.prettierrc',
|
|
8
8
|
'.prettierrc.{json,js,cjs,yml,yaml}',
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { compact } from '../../util/array.js';
|
|
2
|
-
import { join } from '../../util/path.js';
|
|
3
2
|
import { timerify } from '../../util/Performance.js';
|
|
4
3
|
import { hasDependency, load } from '../../util/plugin.js';
|
|
5
4
|
import { getEnvPackageName, getExternalReporters } from './helpers.js';
|
|
@@ -8,7 +7,7 @@ export const ENABLERS = ['vitest'];
|
|
|
8
7
|
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
9
8
|
export const CONFIG_FILE_PATTERNS = ['vitest.config.ts'];
|
|
10
9
|
export const ENTRY_FILE_PATTERNS = ['vite.config.ts'];
|
|
11
|
-
const findVitestDependencies = async (configFilePath
|
|
10
|
+
const findVitestDependencies = async (configFilePath) => {
|
|
12
11
|
const config = await load(configFilePath);
|
|
13
12
|
if (!config || !config.test)
|
|
14
13
|
return [];
|
|
@@ -16,8 +15,8 @@ const findVitestDependencies = async (configFilePath, { cwd }) => {
|
|
|
16
15
|
const environments = cfg.environment ? [getEnvPackageName(cfg.environment)] : [];
|
|
17
16
|
const reporters = getExternalReporters(cfg.reporters);
|
|
18
17
|
const coverage = cfg.coverage ? [`@vitest/coverage-${cfg.coverage.provider ?? 'v8'}`] : [];
|
|
19
|
-
const setupFiles = cfg.setupFiles ? [cfg.setupFiles].flat()
|
|
20
|
-
const globalSetup = cfg.globalSetup ? [cfg.globalSetup].flat()
|
|
18
|
+
const setupFiles = cfg.setupFiles ? [cfg.setupFiles].flat() : [];
|
|
19
|
+
const globalSetup = cfg.globalSetup ? [cfg.globalSetup].flat() : [];
|
|
21
20
|
return compact([...environments, ...reporters, ...coverage, ...setupFiles, ...globalSetup]);
|
|
22
21
|
};
|
|
23
22
|
export const findDependencies = timerify(findVitestDependencies);
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
/// <reference types="npmcli__package-json" />
|
|
2
|
-
import type { PluginConfiguration } from './config.js';
|
|
2
|
+
import type { PluginConfiguration, WorkspaceConfiguration } from './config.js';
|
|
3
3
|
import type { PackageJson } from '@npmcli/package-json';
|
|
4
4
|
export type PackageJsonWithPlugins = PackageJson & Record<string, unknown>;
|
|
5
5
|
type IsPluginEnabledCallbackOptions = {
|
|
6
6
|
cwd: string;
|
|
7
7
|
manifest: PackageJson;
|
|
8
8
|
dependencies: Set<string>;
|
|
9
|
+
config: WorkspaceConfiguration;
|
|
9
10
|
};
|
|
10
11
|
export type IsPluginEnabledCallback = (options: IsPluginEnabledCallbackOptions) => boolean | Promise<boolean>;
|
|
11
12
|
type GenericPluginCallbackOptions = {
|
|
@@ -112,10 +112,8 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
112
112
|
for (const visitor of visitors.import) {
|
|
113
113
|
if (visitor) {
|
|
114
114
|
const results = visitor(node, options);
|
|
115
|
-
if (results)
|
|
115
|
+
if (results)
|
|
116
116
|
[results].flat().forEach(addImport);
|
|
117
|
-
return;
|
|
118
|
-
}
|
|
119
117
|
}
|
|
120
118
|
}
|
|
121
119
|
for (const visitor of visitors.export) {
|
|
@@ -128,10 +126,8 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
128
126
|
for (const visitor of visitors.script) {
|
|
129
127
|
if (visitor) {
|
|
130
128
|
const results = visitor(node, options);
|
|
131
|
-
if (results)
|
|
129
|
+
if (results)
|
|
132
130
|
[results].flat().forEach(script => scripts.add(script));
|
|
133
|
-
return;
|
|
134
|
-
}
|
|
135
131
|
}
|
|
136
132
|
}
|
|
137
133
|
if (isAccessExpression(node)) {
|
|
@@ -4,4 +4,4 @@ import exportDeclaration from './exportDeclaration.js';
|
|
|
4
4
|
import exportKeyword from './exportKeyword.js';
|
|
5
5
|
import moduleExportsAccessExpression from './moduleExportsAccessExpression.js';
|
|
6
6
|
const visitors = [exportAssignment, exportDeclaration, exportKeyword, moduleExportsAccessExpression];
|
|
7
|
-
export default (sourceFile) => visitors.map(v => v(sourceFile))
|
|
7
|
+
export default (sourceFile) => visitors.map(v => v(sourceFile));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.20.
|
|
1
|
+
export declare const version = "2.20.2";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.20.
|
|
1
|
+
export const version = '2.20.2';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "2.20.
|
|
3
|
+
"version": "2.20.2",
|
|
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",
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
"@types/js-yaml": "4.0.5",
|
|
71
71
|
"@types/micromatch": "4.0.2",
|
|
72
72
|
"@types/minimist": "1.2.2",
|
|
73
|
-
"@types/node": "20.5.
|
|
73
|
+
"@types/node": "20.5.6",
|
|
74
74
|
"@types/npmcli__map-workspaces": "3.0.1",
|
|
75
|
-
"@types/webpack": "5.28.
|
|
75
|
+
"@types/webpack": "5.28.2",
|
|
76
76
|
"@typescript-eslint/eslint-plugin": "6.4.1",
|
|
77
77
|
"@typescript-eslint/parser": "6.4.1",
|
|
78
78
|
"c8": "8.0.1",
|
|
79
|
-
"eslint": "8.
|
|
79
|
+
"eslint": "8.48.0",
|
|
80
80
|
"eslint-import-resolver-typescript": "3.6.0",
|
|
81
81
|
"eslint-plugin-import": "2.28.1",
|
|
82
82
|
"eslint-plugin-n": "16.0.2",
|
|
@@ -85,7 +85,7 @@
|
|
|
85
85
|
"remark-cli": "11.0.0",
|
|
86
86
|
"remark-preset-webpro": "0.0.3",
|
|
87
87
|
"tsx": "3.12.7",
|
|
88
|
-
"type-fest": "4.
|
|
88
|
+
"type-fest": "4.3.0"
|
|
89
89
|
},
|
|
90
90
|
"engines": {
|
|
91
91
|
"node": ">=16.17.0 <17 || >=18.6.0"
|