Skip to content

Commit 8292981

Browse files
committed
Ignore more globally available binaries
Add az, cmd.exe, code, code-insiders, codesign, devtunnel, dotnet, open, powershell, powershell.exe, python and python3 — system/platform CLIs. Each same-named npm package (where one exists) ships no bin of that name, so it can't be the source of the binary; extend the criteria comment with that rule.
1 parent ef3b601 commit 8292981

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

packages/knip/src/constants.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,14 @@ export const PROTOCOL_VIRTUAL = 'virtual:';
3333
/**
3434
* Binaries that are expected to be globally available. The package at
3535
* https://www.npmjs.com/package/[name] might exist, but is not expected to be
36-
* listed in package.json because last npm publish was >6 years ago OR weekly downloads <5_000
36+
* listed in package.json because last npm publish was >6 years ago OR weekly
37+
* downloads <5_000 OR it doesn't even provide a bin of that name (so the package
38+
* can't be the source of the binary)
3739
*/
3840
export const IGNORED_GLOBAL_BINARIES = new Set([
3941
'amplify',
4042
'aws',
43+
'az',
4144
'base64',
4245
'basename',
4346
'bash',
@@ -52,6 +55,10 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
5255
'cksum',
5356
'clear',
5457
'cmd',
58+
'cmd.exe',
59+
'code',
60+
'code-insiders',
61+
'codesign',
5562
'comm',
5663
'command',
5764
'corepack',
@@ -60,10 +67,12 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
6067
'cut',
6168
'date',
6269
'deno',
70+
'devtunnel',
6371
'df',
6472
'dir',
6573
'dirname',
6674
'docker',
75+
'dotnet',
6776
'echo',
6877
'env',
6978
'exec',
@@ -101,12 +110,17 @@ export const IGNORED_GLOBAL_BINARIES = new Set([
101110
'npx',
102111
'nub',
103112
'nubx',
113+
'open',
104114
'paste',
105115
'pnpm',
106116
'pnpx',
117+
'powershell',
118+
'powershell.exe',
107119
'pr',
108120
'printenv',
109121
'pwd',
122+
'python',
123+
'python3',
110124
'rm',
111125
'rmdir',
112126
'rsync',

0 commit comments

Comments
 (0)