knip 5.38.0 → 5.38.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/dist/index.js CHANGED
@@ -149,7 +149,7 @@ export const main = async (unresolvedConfiguration) => {
149
149
  const ws = (dependency.containingFilePath && chief.findWorkspaceByFilePath(dependency.containingFilePath)) || workspace;
150
150
  const specifierFilePath = getReferencedInternalFilePath(dependency, ws);
151
151
  if (specifierFilePath)
152
- principal.addEntryPath(specifierFilePath);
152
+ principal.addEntryPath(specifierFilePath, { skipExportsAnalysis: true });
153
153
  }
154
154
  }
155
155
  if (isProduction) {
@@ -8,7 +8,7 @@ const libLocation = path.dirname(ts.getDefaultLibFilePath({}));
8
8
  export const createHosts = ({ cwd, compilerOptions, entryPaths, compilers, isSkipLibs, toSourceFilePath, useResolverCache, }) => {
9
9
  const fileManager = new SourceFileManager({ compilers, isSkipLibs });
10
10
  const compilerExtensions = getCompilerExtensions(compilers);
11
- const resolveModuleNames = createCustomModuleResolver(compilerOptions, compilerExtensions, toSourceFilePath, useResolverCache);
11
+ const resolveModuleNames = createCustomModuleResolver(compilerOptions, compilerExtensions, toSourceFilePath, useResolverCache, isSkipLibs);
12
12
  const languageServiceHost = {
13
13
  getCompilationSettings: () => compilerOptions,
14
14
  getScriptFileNames: () => Array.from(entryPaths),
@@ -1,4 +1,4 @@
1
1
  import ts from 'typescript';
2
2
  import type { ToSourceFilePath } from '../util/to-source-path.js';
3
3
  export type ResolveModuleNames = ReturnType<typeof createCustomModuleResolver>;
4
- export declare function createCustomModuleResolver(compilerOptions: ts.CompilerOptions, customCompilerExtensions: string[], toSourceFilePath: ToSourceFilePath, useCache?: boolean): (moduleNames: string[], containingFile: string) => Array<ts.ResolvedModuleFull | undefined>;
4
+ export declare function createCustomModuleResolver(compilerOptions: ts.CompilerOptions, customCompilerExtensions: string[], toSourceFilePath: ToSourceFilePath, useCache?: boolean, isSkipLibs?: boolean): (moduleNames: string[], containingFile: string) => Array<ts.ResolvedModuleFull | undefined>;
@@ -19,7 +19,7 @@ const fileExists = (name, containingFile) => {
19
19
  };
20
20
  }
21
21
  };
22
- export function createCustomModuleResolver(compilerOptions, customCompilerExtensions, toSourceFilePath, useCache = true) {
22
+ export function createCustomModuleResolver(compilerOptions, customCompilerExtensions, toSourceFilePath, useCache = true, isSkipLibs = true) {
23
23
  const customCompilerExtensionsSet = new Set(customCompilerExtensions);
24
24
  const extensions = [...DEFAULT_EXTENSIONS, ...customCompilerExtensions];
25
25
  const resolveSync = customCompilerExtensionsSet.size === 0 ? _resolveSync : createSyncResolver(extensions);
@@ -57,7 +57,7 @@ export function createCustomModuleResolver(compilerOptions, customCompilerExtens
57
57
  const sanitizedSpecifier = sanitizeSpecifier(name);
58
58
  if (isBuiltin(sanitizedSpecifier))
59
59
  return undefined;
60
- const resolvedFileName = resolveSync(sanitizedSpecifier, dirname(containingFile));
60
+ const resolvedFileName = isSkipLibs && resolveSync(sanitizedSpecifier, dirname(containingFile));
61
61
  if (resolvedFileName) {
62
62
  const ext = extname(resolvedFileName);
63
63
  if (!customCompilerExtensionsSet.has(ext)) {
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.38.0";
1
+ export declare const version = "5.38.2";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.38.0';
1
+ export const version = '5.38.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.38.0",
3
+ "version": "5.38.2",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {