knip 4.2.1 → 4.2.3
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/dist/binaries/resolvers/fallback.js +1 -0
- package/dist/plugins/typescript/index.js +2 -1
- package/dist/typescript/getImportsAndExports.js +2 -7
- package/dist/util/cli-arguments.js +1 -1
- package/dist/util/loader.d.ts +1 -1
- package/dist/util/loader.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +9 -11
- package/dist/util/parse-args.d.ts +0 -3
- package/dist/util/parse-args.js +0 -8
|
@@ -8,7 +8,8 @@ const ENABLERS = ['typescript'];
|
|
|
8
8
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
9
9
|
const CONFIG_FILE_PATTERNS = ['tsconfig.json', 'tsconfig.*.json'];
|
|
10
10
|
const resolveExtensibleConfig = async (configFilePath) => {
|
|
11
|
-
const
|
|
11
|
+
const filePath = configFilePath.replace(/(\.json)?$/, '.json');
|
|
12
|
+
const localConfig = await loadJSON(filePath);
|
|
12
13
|
if (!localConfig)
|
|
13
14
|
return;
|
|
14
15
|
localConfig.extends = localConfig.extends ? [localConfig.extends].flat() : [];
|
|
@@ -3,7 +3,7 @@ import ts from 'typescript';
|
|
|
3
3
|
import { isStartsLikePackageName, sanitizeSpecifier } from '../util/modules.js';
|
|
4
4
|
import { isInNodeModules } from '../util/path.js';
|
|
5
5
|
import { timerify } from '../util/Performance.js';
|
|
6
|
-
import {
|
|
6
|
+
import { isAccessExpression, getJSDocTags, getLineAndCharacterOfPosition, getMemberStringLiterals, } from './ast-helpers.js';
|
|
7
7
|
import getDynamicImportVisitors from './visitors/dynamic-imports/index.js';
|
|
8
8
|
import getExportVisitors from './visitors/exports/index.js';
|
|
9
9
|
import { getJSXImplicitImportBase } from './visitors/helpers.js';
|
|
@@ -93,12 +93,7 @@ const getImportsAndExports = (sourceFile, getResolvedModule, typeChecker, option
|
|
|
93
93
|
if (!isStartsLikePackageName(sanitizedSpecifier)) {
|
|
94
94
|
return;
|
|
95
95
|
}
|
|
96
|
-
|
|
97
|
-
externalImports.add(sanitizedSpecifier);
|
|
98
|
-
}
|
|
99
|
-
else {
|
|
100
|
-
externalImports.add(module.resolvedModule.packageId?.name ?? sanitizedSpecifier);
|
|
101
|
-
}
|
|
96
|
+
externalImports.add(sanitizedSpecifier);
|
|
102
97
|
}
|
|
103
98
|
else {
|
|
104
99
|
addInternalImport({ ...options, identifier, filePath, isReExport });
|
package/dist/util/loader.d.ts
CHANGED
package/dist/util/loader.js
CHANGED
|
@@ -5,7 +5,7 @@ import { isTypeModule } from './fs.js';
|
|
|
5
5
|
import { extname } from './path.js';
|
|
6
6
|
import { timerify } from './Performance.js';
|
|
7
7
|
import { jitiCJS, jitiESM } from './register.js';
|
|
8
|
-
export const FAKE_PATH = '__FAKE__';
|
|
8
|
+
export const FAKE_PATH = '__FAKE__.json';
|
|
9
9
|
const load = async (filePath) => {
|
|
10
10
|
if (filePath === FAKE_PATH)
|
|
11
11
|
return;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "4.2.
|
|
1
|
+
export declare const version = "4.2.3";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '4.2.
|
|
1
|
+
export const version = '4.2.3';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.3",
|
|
4
4
|
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
|
|
5
5
|
"homepage": "https://knip.dev",
|
|
6
6
|
"repository": {
|
|
@@ -57,9 +57,8 @@
|
|
|
57
57
|
"@nodelib/fs.walk": "2.0.0",
|
|
58
58
|
"@npmcli/map-workspaces": "3.0.4",
|
|
59
59
|
"@npmcli/package-json": "5.0.0",
|
|
60
|
-
"@pkgjs/parseargs": "0.11.0",
|
|
61
60
|
"@pnpm/logger": "5.0.0",
|
|
62
|
-
"@pnpm/workspace.pkgs-graph": "^2.0.
|
|
61
|
+
"@pnpm/workspace.pkgs-graph": "^2.0.14",
|
|
63
62
|
"@snyk/github-codeowners": "1.1.0",
|
|
64
63
|
"@types/picomatch": "2.3.3",
|
|
65
64
|
"easy-table": "1.2.0",
|
|
@@ -70,8 +69,8 @@
|
|
|
70
69
|
"minimist": "1.2.8",
|
|
71
70
|
"picocolors": "1.0.0",
|
|
72
71
|
"picomatch": "3.0.1",
|
|
73
|
-
"pretty-ms": "
|
|
74
|
-
"smol-toml": "1.1.
|
|
72
|
+
"pretty-ms": "9.0.0",
|
|
73
|
+
"smol-toml": "1.1.4",
|
|
75
74
|
"strip-json-comments": "5.0.1",
|
|
76
75
|
"summary": "2.1.0",
|
|
77
76
|
"zod": "3.22.4",
|
|
@@ -85,22 +84,21 @@
|
|
|
85
84
|
"@jest/types": "29.6.3",
|
|
86
85
|
"@knip/eslint-config": "0.0.0",
|
|
87
86
|
"@release-it/bumper": "^6.0.1",
|
|
88
|
-
"@swc/cli": "^0.1.
|
|
89
|
-
"@swc/core": "^1.3.
|
|
87
|
+
"@swc/cli": "^0.1.65",
|
|
88
|
+
"@swc/core": "^1.3.107",
|
|
90
89
|
"@types/js-yaml": "^4.0.9",
|
|
91
90
|
"@types/micromatch": "^4.0.6",
|
|
92
91
|
"@types/minimist": "^1.2.5",
|
|
93
92
|
"@types/npmcli__map-workspaces": "^3.0.4",
|
|
94
93
|
"@types/npmcli__package-json": "^4.0.3",
|
|
95
|
-
"@types/pkgjs__parseargs": "^0.10.3",
|
|
96
94
|
"@types/webpack": "^5.28.5",
|
|
97
95
|
"c8": "9.1.0",
|
|
98
96
|
"eslint": "^8.56.0",
|
|
99
|
-
"playwright": "^1.41.
|
|
97
|
+
"playwright": "^1.41.1",
|
|
100
98
|
"prettier": "^3.2.4",
|
|
101
|
-
"release-it": "^17.0.
|
|
99
|
+
"release-it": "^17.0.3",
|
|
102
100
|
"tsx": "^4.7.0",
|
|
103
|
-
"type-fest": "^4.
|
|
101
|
+
"type-fest": "^4.10.1",
|
|
104
102
|
"typescript": "5.3.3"
|
|
105
103
|
},
|
|
106
104
|
"engines": {
|