knip 5.50.3 → 5.50.5

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.
@@ -305,6 +305,17 @@ export class DependencyDeputy {
305
305
  counters.unresolved--;
306
306
  manifest.usedIgnoreUnresolved.add(ignoreItem);
307
307
  }
308
+ else {
309
+ const manifest = this.getWorkspaceManifest(ROOT_WORKSPACE_NAME);
310
+ if (manifest) {
311
+ const ignoreItem = findMatch(manifest.ignoreUnresolved, issue.symbol);
312
+ if (ignoreItem) {
313
+ delete issueSet[issueKey];
314
+ counters.unresolved--;
315
+ manifest.usedIgnoreUnresolved.add(ignoreItem);
316
+ }
317
+ }
318
+ }
308
319
  }
309
320
  }
310
321
  }
@@ -3,7 +3,7 @@ import { compact } from '../util/array.js';
3
3
  import { toBinary, toDeferResolve, toEntry } from '../util/input.js';
4
4
  const spawningBinaries = ['cross-env', 'retry-cli'];
5
5
  const endOfCommandBinaries = ['dotenvx'];
6
- const positionals = new Set(['babel-node', 'esbuild', 'execa', 'vite-node', 'zx']);
6
+ const positionals = new Set(['babel-node', 'esbuild', 'execa', 'jiti', 'vite-node', 'zx']);
7
7
  export const resolve = (binary, args, { fromArgs }) => {
8
8
  const parsed = parseArgs(args, { boolean: ['quiet', 'verbose'], '--': endOfCommandBinaries.includes(binary) });
9
9
  const bin = binary.startsWith('.') ? toEntry(binary) : toBinary(binary);
@@ -1,3 +1,4 @@
1
+ import { toDependency } from '../../util/input.js';
1
2
  import { hasDependency } from '../../util/plugin.js';
2
3
  const title = 'simple-git-hooks';
3
4
  const enablers = ['simple-git-hooks'];
@@ -13,7 +14,7 @@ const resolveConfig = async (config, options) => {
13
14
  for (const id of options.getInputsFromScripts(hook))
14
15
  inputs.add(id);
15
16
  }
16
- return Array.from(inputs);
17
+ return [toDependency('simple-git-hooks'), ...Array.from(inputs)];
17
18
  };
18
19
  export default {
19
20
  title,
@@ -4,8 +4,8 @@ import { debugLog } from './debug.js';
4
4
  import { isDirectory } from './fs.js';
5
5
  import { isInternal, join, toRelative } from './path.js';
6
6
  const defaultExtensions = `.{${DEFAULT_EXTENSIONS.map(ext => ext.slice(1)).join(',')}}`;
7
- const hasJSExt = /\.(m|c)js$/;
8
7
  const hasTSExt = /(?<!\.d)\.(m|c)?tsx?$/;
8
+ const hasDTSExt = /.d\.(m|c)?ts$/;
9
9
  const matchExt = /(\.d)?\.(m|c)?(j|t)s$/;
10
10
  export const augmentWorkspace = (workspace, dir, compilerOptions) => {
11
11
  const srcDir = join(dir, 'src');
@@ -15,13 +15,14 @@ export const augmentWorkspace = (workspace, dir, compilerOptions) => {
15
15
  export const getToSourcePathHandler = (chief) => {
16
16
  const toSourceMapCache = new Map();
17
17
  return (filePath) => {
18
- if (!isInternal(filePath) || hasJSExt.test(filePath) || hasTSExt.test(filePath))
18
+ if (!isInternal(filePath) || hasTSExt.test(filePath))
19
19
  return;
20
20
  if (toSourceMapCache.has(filePath))
21
21
  return toSourceMapCache.get(filePath);
22
22
  const workspace = chief.findWorkspaceByFilePath(filePath);
23
23
  if (workspace?.srcDir && workspace.outDir) {
24
- if (filePath.startsWith(workspace.outDir)) {
24
+ if ((!filePath.startsWith(workspace.srcDir) && filePath.startsWith(workspace.outDir)) ||
25
+ (workspace.srcDir === workspace.outDir && hasDTSExt.test(filePath))) {
25
26
  const pattern = filePath.replace(workspace.outDir, workspace.srcDir).replace(matchExt, defaultExtensions);
26
27
  const [srcFilePath] = fastGlob.sync(pattern);
27
28
  toSourceMapCache.set(filePath, srcFilePath);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.50.3";
1
+ export declare const version = "5.50.5";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.50.3';
1
+ export const version = '5.50.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.50.3",
3
+ "version": "5.50.5",
4
4
  "description": "Find and fix unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {