knip 5.69.1 → 5.70.1

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.
Files changed (54) hide show
  1. package/dist/ConfigurationChief.d.ts +6 -0
  2. package/dist/binaries/package-manager/yarn.js +1 -0
  3. package/dist/binaries/plugins.js +4 -4
  4. package/dist/compilers/index.d.ts +10 -0
  5. package/dist/compilers/index.js +2 -0
  6. package/dist/compilers/prisma.d.ts +6 -0
  7. package/dist/compilers/prisma.js +13 -0
  8. package/dist/constants.d.ts +4 -0
  9. package/dist/constants.js +4 -0
  10. package/dist/graph/build.js +3 -3
  11. package/dist/plugins/index.d.ts +1 -0
  12. package/dist/plugins/index.js +2 -0
  13. package/dist/plugins/prisma/index.js +27 -5
  14. package/dist/plugins/prisma/types.d.ts +1 -0
  15. package/dist/plugins/taskfile/index.d.ts +3 -0
  16. package/dist/plugins/taskfile/index.js +111 -0
  17. package/dist/plugins/taskfile/types.d.ts +25 -0
  18. package/dist/plugins/taskfile/types.js +1 -0
  19. package/dist/plugins/vitest/helpers.d.ts +1 -1
  20. package/dist/plugins/vitest/helpers.js +1 -1
  21. package/dist/plugins/vitest/index.js +11 -4
  22. package/dist/reporters/util/configuration-hints.js +1 -1
  23. package/dist/schema/configuration.d.ts +10 -0
  24. package/dist/schema/plugins.d.ts +5 -0
  25. package/dist/schema/plugins.js +1 -0
  26. package/dist/types/PluginNames.d.ts +2 -2
  27. package/dist/types/PluginNames.js +1 -0
  28. package/dist/types/args.d.ts +4 -1
  29. package/dist/types/module-graph.d.ts +6 -6
  30. package/dist/typescript/ast-helpers.d.ts +9 -0
  31. package/dist/typescript/ast-helpers.js +33 -4
  32. package/dist/typescript/get-imports-and-exports.js +46 -38
  33. package/dist/typescript/pragmas/custom.d.ts +3 -0
  34. package/dist/typescript/pragmas/custom.js +25 -0
  35. package/dist/typescript/pragmas/index.d.ts +3 -0
  36. package/dist/typescript/pragmas/index.js +3 -0
  37. package/dist/typescript/pragmas/typescript.d.ts +3 -0
  38. package/dist/typescript/pragmas/typescript.js +29 -0
  39. package/dist/typescript/visitors/dynamic-imports/importCall.js +21 -9
  40. package/dist/typescript/visitors/dynamic-imports/jsDocType.js +23 -9
  41. package/dist/typescript/visitors/dynamic-imports/requireCall.js +7 -4
  42. package/dist/typescript/visitors/helpers.d.ts +0 -2
  43. package/dist/typescript/visitors/helpers.js +0 -38
  44. package/dist/typescript/visitors/imports/importDeclaration.js +1 -1
  45. package/dist/typescript/visitors/imports/reExportDeclaration.js +4 -4
  46. package/dist/util/create-options.d.ts +10 -0
  47. package/dist/util/has-strictly-ns-references.d.ts +3 -3
  48. package/dist/util/is-identifier-referenced.js +10 -10
  49. package/dist/util/module-graph.d.ts +2 -2
  50. package/dist/util/module-graph.js +22 -22
  51. package/dist/version.d.ts +1 -1
  52. package/dist/version.js +1 -1
  53. package/package.json +5 -5
  54. package/schema.json +4 -0
@@ -537,6 +537,11 @@ export declare class ConfigurationChief {
537
537
  entry?: string | string[] | undefined;
538
538
  project?: string | string[] | undefined;
539
539
  } | undefined;
540
+ taskfile?: string | boolean | string[] | {
541
+ config?: string | string[] | undefined;
542
+ entry?: string | string[] | undefined;
543
+ project?: string | string[] | undefined;
544
+ } | undefined;
540
545
  travis?: string | boolean | string[] | {
541
546
  config?: string | string[] | undefined;
542
547
  entry?: string | string[] | undefined;
@@ -758,6 +763,7 @@ export declare class ConfigurationChief {
758
763
  svgo?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
759
764
  syncpack?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
760
765
  tailwind?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
766
+ taskfile?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
761
767
  travis?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
762
768
  "ts-node"?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
763
769
  tsdown?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
@@ -21,6 +21,7 @@ const commands = [
21
21
  'patch-commit',
22
22
  'patch',
23
23
  'plugin',
24
+ 'publish',
24
25
  'rebuild',
25
26
  'remove',
26
27
  'search',
@@ -9,13 +9,13 @@ const isGlobLikeMatch = /(^!|[*+\\(|{^$])/;
9
9
  const isGlobLike = (value) => isGlobLikeMatch.test(value);
10
10
  const nodeLoadersArgs = { import: ['r', 'experimental-loader', 'require', 'loader'] };
11
11
  export const resolve = (binary, _args, options) => {
12
- const { fromArgs, containingFilePath } = options;
12
+ const { cwd, fromArgs, containingFilePath } = options;
13
13
  const [pluginName, pluginArgs] = pluginArgsMap.get(binary) ?? [];
14
14
  if (!pluginArgs)
15
15
  return fallbackResolve(binary, _args, options);
16
16
  const inputOpts = {};
17
- if (options.cwd && dirname(containingFilePath) !== options.cwd)
18
- Object.assign(inputOpts, { dir: options.cwd });
17
+ if (cwd && dirname(containingFilePath) !== cwd)
18
+ Object.assign(inputOpts, { dir: cwd });
19
19
  const args = typeof pluginArgs.args === 'function' ? pluginArgs.args(_args) : _args;
20
20
  const parsed = parseArgs(args, {
21
21
  string: [
@@ -58,7 +58,7 @@ export const resolve = (binary, _args, options) => {
58
58
  return parsed[id] && pluginName ? [toConfig(pluginName, fn(parsed[id]), inputOpts)] : [];
59
59
  };
60
60
  const configFilePaths = config.flatMap(mapToConfigPattern);
61
- const inputs = pluginArgs.resolveInputs?.(parsed, args) ?? [];
61
+ const inputs = pluginArgs.resolveInputs?.(parsed, { args, cwd }) ?? [];
62
62
  return [
63
63
  toBinary(binary, inputOpts),
64
64
  ...positionals,
@@ -489,6 +489,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
489
489
  entry?: string | string[] | undefined;
490
490
  project?: string | string[] | undefined;
491
491
  } | undefined;
492
+ taskfile?: string | boolean | string[] | {
493
+ config?: string | string[] | undefined;
494
+ entry?: string | string[] | undefined;
495
+ project?: string | string[] | undefined;
496
+ } | undefined;
492
497
  travis?: string | boolean | string[] | {
493
498
  config?: string | string[] | undefined;
494
499
  entry?: string | string[] | undefined;
@@ -1080,6 +1085,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
1080
1085
  entry?: string | string[] | undefined;
1081
1086
  project?: string | string[] | undefined;
1082
1087
  } | undefined;
1088
+ taskfile?: string | boolean | string[] | {
1089
+ config?: string | string[] | undefined;
1090
+ entry?: string | string[] | undefined;
1091
+ project?: string | string[] | undefined;
1092
+ } | undefined;
1083
1093
  travis?: string | boolean | string[] | {
1084
1094
  config?: string | string[] | undefined;
1085
1095
  entry?: string | string[] | undefined;
@@ -1,6 +1,7 @@
1
1
  import Astro from './astro.js';
2
2
  import AstroMDX from './astro-mdx.js';
3
3
  import MDX from './mdx.js';
4
+ import Prisma from './prisma.js';
4
5
  import Svelte from './svelte.js';
5
6
  import CSS from './tailwind.js';
6
7
  import Vue from './vue.js';
@@ -31,6 +32,7 @@ const compilers = new Map([
31
32
  ['.astro', Astro],
32
33
  ['.css', CSS],
33
34
  ['.mdx', MDX],
35
+ ['.prisma', Prisma],
34
36
  ['.svelte', Svelte],
35
37
  ['.vue', Vue],
36
38
  ]);
@@ -0,0 +1,6 @@
1
+ import type { HasDependency } from './types.js';
2
+ declare const _default: {
3
+ condition: (hasDependency: HasDependency) => boolean;
4
+ compiler: (text: string) => string;
5
+ };
6
+ export default _default;
@@ -0,0 +1,13 @@
1
+ const condition = (hasDependency) => hasDependency('prisma');
2
+ const directiveMatcher = /generator\s+(?!client)\w+\s*\{\s*provider\s*=\s*"([^"]+)"[^}]*\}/g;
3
+ const compiler = (text) => {
4
+ const imports = [];
5
+ let match;
6
+ while ((match = directiveMatcher.exec(text))) {
7
+ if (match[1]) {
8
+ imports.push(`import '${match[1]}';`);
9
+ }
10
+ }
11
+ return imports.join('\n');
12
+ };
13
+ export default { condition, compiler };
@@ -50,10 +50,14 @@ export declare const FIX_FLAGS: {
50
50
  readonly EMPTY_DECLARATION: number;
51
51
  readonly WITH_NEWLINE: number;
52
52
  };
53
+ export declare const SIDE_EFFECTS = "__side-effects";
54
+ export declare const OPAQUE = "__opaque";
53
55
  export declare const IMPORT_MODIFIERS: {
54
56
  readonly NONE: 0;
55
57
  readonly RE_EXPORT: number;
56
58
  readonly TYPE_ONLY: number;
57
59
  readonly ENTRY: number;
58
60
  readonly OPTIONAL: number;
61
+ readonly SIDE_EFFECTS: number;
62
+ readonly OPAQUE: number;
59
63
  };
package/dist/constants.js CHANGED
@@ -208,10 +208,14 @@ export const FIX_FLAGS = {
208
208
  EMPTY_DECLARATION: 1 << 1,
209
209
  WITH_NEWLINE: 1 << 2,
210
210
  };
211
+ export const SIDE_EFFECTS = '__side-effects';
212
+ export const OPAQUE = '__opaque';
211
213
  export const IMPORT_MODIFIERS = {
212
214
  NONE: 0,
213
215
  RE_EXPORT: 1 << 0,
214
216
  TYPE_ONLY: 1 << 1,
215
217
  ENTRY: 1 << 2,
216
218
  OPTIONAL: 1 << 3,
219
+ SIDE_EFFECTS: 1 << 4,
220
+ OPAQUE: 1 << 5,
217
221
  };
@@ -294,10 +294,10 @@ export async function build({ chief, collector, counselor, deputy, factory, isGi
294
294
  if (!isIgnored)
295
295
  principal.addEntryPath(filePath, { skipExportsAnalysis: true });
296
296
  }
297
- for (const [import_, specifierFilePath] of file.imports.specifiers) {
298
- const packageName = getPackageNameFromModuleSpecifier(import_.specifier);
297
+ for (const [_import, specifierFilePath] of file.imports.imports) {
298
+ const packageName = getPackageNameFromModuleSpecifier(_import.specifier);
299
299
  if (packageName && isInternalWorkspace(packageName)) {
300
- file.imports.external.add({ ...import_, specifier: packageName });
300
+ file.imports.external.add({ ..._import, specifier: packageName });
301
301
  const principal = getPrincipalByFilePath(specifierFilePath);
302
302
  if (principal && !isGitIgnored(specifierFilePath)) {
303
303
  principal.addNonEntryPath(specifierFilePath);
@@ -96,6 +96,7 @@ export declare const Plugins: {
96
96
  svgo: import("../types/config.js").Plugin;
97
97
  syncpack: import("../types/config.js").Plugin;
98
98
  tailwind: import("../types/config.js").Plugin;
99
+ taskfile: import("../types/config.js").Plugin;
99
100
  travis: import("../types/config.js").Plugin;
100
101
  'ts-node': import("../types/config.js").Plugin;
101
102
  tsdown: import("../types/config.js").Plugin;
@@ -95,6 +95,7 @@ import { default as svelte } from './svelte/index.js';
95
95
  import { default as svgo } from './svgo/index.js';
96
96
  import { default as syncpack } from './syncpack/index.js';
97
97
  import { default as tailwind } from './tailwind/index.js';
98
+ import { default as taskfile } from './taskfile/index.js';
98
99
  import { default as travis } from './travis/index.js';
99
100
  import { default as tsNode } from './ts-node/index.js';
100
101
  import { default as tsdown } from './tsdown/index.js';
@@ -214,6 +215,7 @@ export const Plugins = {
214
215
  svgo,
215
216
  syncpack,
216
217
  tailwind,
218
+ taskfile,
217
219
  travis,
218
220
  'ts-node': tsNode,
219
221
  tsdown,
@@ -1,28 +1,50 @@
1
+ import { isDirectory } from '../../util/fs.js';
2
+ import { toEntry } from '../../util/input.js';
3
+ import { join } from '../../util/path.js';
1
4
  import { hasDependency } from '../../util/plugin.js';
2
5
  const title = 'Prisma';
3
6
  const enablers = ['prisma', /^@prisma\/.*/];
4
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
+ const entry = ['prisma/schema.prisma', 'schema.prisma'];
5
9
  const config = [
6
10
  'prisma.config.{js,ts,mjs,cjs,mts,cts}',
7
11
  '.config/prisma.{js,ts,mjs,cjs,mts,cts}',
8
12
  'package.json',
9
13
  ];
14
+ const resolveSchema = (path, cwd) => {
15
+ if (!isDirectory(join(cwd, path))) {
16
+ return toEntry(path);
17
+ }
18
+ return toEntry(join(path, '**/*.prisma'));
19
+ };
10
20
  const resolveConfig = async (config, options) => {
11
- if (options.configFileName === 'package.json' && config.seed) {
12
- return options.getInputsFromScripts(config.seed);
21
+ const inputs = [];
22
+ if (config.seed) {
23
+ inputs.push(...options.getInputsFromScripts(config.seed));
24
+ }
25
+ else if (config.migrations?.seed) {
26
+ inputs.push(...options.getInputsFromScripts(config.migrations.seed));
13
27
  }
14
- if (config.migrations?.seed) {
15
- return options.getInputsFromScripts(config.migrations.seed);
28
+ if (config.schema) {
29
+ inputs.push(resolveSchema(config.schema, options.cwd));
16
30
  }
17
- return [];
31
+ return inputs;
18
32
  };
19
33
  const args = {
20
34
  config: true,
35
+ resolveInputs: (parsed, { cwd }) => {
36
+ const inputs = [];
37
+ if (parsed['schema']) {
38
+ inputs.push(resolveSchema(parsed['schema'], cwd));
39
+ }
40
+ return inputs;
41
+ },
21
42
  };
22
43
  const plugin = {
23
44
  title,
24
45
  enablers,
25
46
  isEnabled,
47
+ entry,
26
48
  config,
27
49
  args,
28
50
  resolveConfig,
@@ -3,4 +3,5 @@ export type PrismaConfig = {
3
3
  migrations?: {
4
4
  seed?: string;
5
5
  };
6
+ schema?: string;
6
7
  };
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.js';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,111 @@
1
+ import { _firstGlob } from '../../util/glob.js';
2
+ import { toConfig } from '../../util/input.js';
3
+ import { join, relative } from '../../util/path.js';
4
+ const title = 'Taskfile';
5
+ const enablers = 'This plugin is enabled when a Taskfile is found (Taskfile.yml, taskfile.yml, Taskfile.yaml, taskfile.yaml, etc.).';
6
+ const isRootOnly = true;
7
+ const defaultConfigPatterns = ['{T,t}askfile.{yml,yaml}', '{T,t}askfile.dist.{yml,yaml}'];
8
+ const isEnabled = async ({ cwd, config }) => {
9
+ if (config.taskfile)
10
+ return true;
11
+ return Boolean(await _firstGlob({ cwd, patterns: defaultConfigPatterns }));
12
+ };
13
+ const extractScriptsFromCommand = (command) => {
14
+ const scripts = [];
15
+ if (typeof command === 'string') {
16
+ scripts.push(command);
17
+ }
18
+ else if (command && typeof command === 'object') {
19
+ if (command.cmd && typeof command.cmd === 'string') {
20
+ scripts.push(command.cmd);
21
+ }
22
+ if (command.defer) {
23
+ if (typeof command.defer === 'string') {
24
+ scripts.push(command.defer);
25
+ }
26
+ else if (command.defer && typeof command.defer === 'object' && 'cmd' in command.defer) {
27
+ if (typeof command.defer.cmd === 'string') {
28
+ scripts.push(command.defer.cmd);
29
+ }
30
+ }
31
+ }
32
+ if (command.for && 'cmd' in command && typeof command.cmd === 'string') {
33
+ scripts.push(command.cmd);
34
+ }
35
+ }
36
+ return scripts;
37
+ };
38
+ const extractScriptsFromTask = (task) => {
39
+ const scripts = [];
40
+ if (typeof task === 'string') {
41
+ scripts.push(task);
42
+ return scripts;
43
+ }
44
+ if (Array.isArray(task)) {
45
+ for (const cmd of task) {
46
+ if (typeof cmd === 'string') {
47
+ scripts.push(cmd);
48
+ }
49
+ }
50
+ return scripts;
51
+ }
52
+ if (task && typeof task === 'object') {
53
+ if (task.cmd && typeof task.cmd === 'string') {
54
+ scripts.push(task.cmd);
55
+ }
56
+ if (task.cmds) {
57
+ if (typeof task.cmds === 'string') {
58
+ scripts.push(task.cmds);
59
+ }
60
+ else if (Array.isArray(task.cmds)) {
61
+ for (const cmd of task.cmds) {
62
+ scripts.push(...extractScriptsFromCommand(cmd));
63
+ }
64
+ }
65
+ }
66
+ }
67
+ return scripts;
68
+ };
69
+ const resolveConfig = async (localConfig, options) => {
70
+ if (!localConfig || !options.configFilePath)
71
+ return [];
72
+ const { configFilePath, getInputsFromScripts, isProduction, configFileDir } = options;
73
+ const inputs = [];
74
+ if (localConfig.includes && typeof localConfig.includes === 'object') {
75
+ for (const includeValue of Object.values(localConfig.includes)) {
76
+ const includePath = typeof includeValue === 'string'
77
+ ? includeValue
78
+ : includeValue && typeof includeValue === 'object' && 'taskfile' in includeValue
79
+ ? includeValue.taskfile
80
+ : undefined;
81
+ if (includePath) {
82
+ const resolvedPath = join(configFileDir, includePath);
83
+ inputs.push(toConfig('taskfile', relative(configFileDir, resolvedPath), { containingFilePath: configFilePath }));
84
+ }
85
+ }
86
+ }
87
+ if (localConfig.tasks && typeof localConfig.tasks === 'object') {
88
+ for (const task of Object.values(localConfig.tasks)) {
89
+ for (const script of extractScriptsFromTask(task)) {
90
+ for (const input of getInputsFromScripts([script], {
91
+ knownBinsOnly: true,
92
+ containingFilePath: configFilePath,
93
+ })) {
94
+ if (isProduction)
95
+ Object.assign(input, { optional: true });
96
+ inputs.push({ ...input, dir: configFileDir });
97
+ }
98
+ }
99
+ }
100
+ }
101
+ return inputs;
102
+ };
103
+ const plugin = {
104
+ title,
105
+ enablers,
106
+ isEnabled,
107
+ config: defaultConfigPatterns,
108
+ resolveConfig,
109
+ isRootOnly,
110
+ };
111
+ export default plugin;
@@ -0,0 +1,25 @@
1
+ export type TaskfileCommand = string | {
2
+ cmd?: string;
3
+ task?: string;
4
+ defer?: string | {
5
+ task?: string;
6
+ [key: string]: unknown;
7
+ };
8
+ for?: unknown;
9
+ [key: string]: unknown;
10
+ };
11
+ export type TaskfileTask = string | string[] | {
12
+ cmds?: string | TaskfileCommand[];
13
+ cmd?: string;
14
+ [key: string]: unknown;
15
+ };
16
+ type TaskfileInclude = string | {
17
+ taskfile: string;
18
+ [key: string]: unknown;
19
+ };
20
+ export type TaskfileConfig = {
21
+ tasks?: Record<string, TaskfileTask>;
22
+ includes?: Record<string, TaskfileInclude>;
23
+ [key: string]: unknown;
24
+ };
25
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
1
  import type { ViteConfig } from './types.js';
2
- export declare const getEnvPackageName: (env: string) => string;
2
+ export declare const getEnvSpecifier: (env: string) => string;
3
3
  export declare const getExternalReporters: (reporters?: ViteConfig["test"]["reporters"]) => string[];
@@ -9,7 +9,7 @@ const envPackageNames = {
9
9
  'happy-dom': 'happy-dom',
10
10
  'edge-runtime': '@edge-runtime/vm',
11
11
  };
12
- export const getEnvPackageName = (env) => {
12
+ export const getEnvSpecifier = (env) => {
13
13
  if (env in envPackageNames)
14
14
  return envPackageNames[env];
15
15
  return `vitest-environment-${env}`;
@@ -1,9 +1,9 @@
1
1
  import { DEFAULT_EXTENSIONS } from '../../constants.js';
2
2
  import { _glob } from '../../util/glob.js';
3
3
  import { toAlias, toConfig, toDeferResolve, toDependency, toEntry } from '../../util/input.js';
4
- import { join, toPosix } from '../../util/path.js';
4
+ import { isAbsolute, isInternal, join, toPosix } from '../../util/path.js';
5
5
  import { hasDependency } from '../../util/plugin.js';
6
- import { getEnvPackageName, getExternalReporters } from './helpers.js';
6
+ import { getEnvSpecifier, getExternalReporters } from './helpers.js';
7
7
  const title = 'Vitest';
8
8
  const enablers = ['vitest'];
9
9
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -17,7 +17,12 @@ const findConfigDependencies = (localConfig, options) => {
17
17
  const testConfig = localConfig.test;
18
18
  if (!testConfig)
19
19
  return [];
20
- const environments = testConfig.environment && testConfig.environment !== 'node' ? [getEnvPackageName(testConfig.environment)] : [];
20
+ const env = testConfig.environment;
21
+ const environments = env && env !== 'node'
22
+ ? isInternal(env) || isAbsolute(env)
23
+ ? [toDeferResolve(env)]
24
+ : [toDependency(getEnvSpecifier(env))]
25
+ : [];
21
26
  const reporters = getExternalReporters(testConfig.reporters);
22
27
  const hasCoverageEnabled = (testConfig.coverage && testConfig.coverage.enabled !== false) || hasScriptWithCoverage(manifest.scripts);
23
28
  const coverage = hasCoverageEnabled ? [`@vitest/coverage-${testConfig.coverage?.provider ?? 'v8'}`] : [];
@@ -38,7 +43,9 @@ const findConfigDependencies = (localConfig, options) => {
38
43
  }
39
44
  }
40
45
  return [
41
- ...[...environments, ...reporters, ...coverage].map(id => toDependency(id)),
46
+ ...environments,
47
+ ...reporters.map(id => toDependency(id)),
48
+ ...coverage.map(id => toDependency(id)),
42
49
  ...setupFiles,
43
50
  ...globalSetup,
44
51
  ...workspaceDependencies,
@@ -107,7 +107,7 @@ export const printConfigurationHints = ({ cwd, counters, issues, tagHints, confi
107
107
  console.warn(getTableForHints(rows).toString());
108
108
  }
109
109
  if (tagHints.size > 0) {
110
- console.log(getColoredTitle('Tag issues', tagHints.size));
110
+ console.log(getDimmedTitle('Tag hints', tagHints.size));
111
111
  for (const hint of tagHints) {
112
112
  const { filePath, identifier, tagName } = hint;
113
113
  const message = `Unused tag in ${toRelative(filePath, cwd)}:`;
@@ -487,6 +487,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
487
487
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
488
488
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
489
489
  }, z.core.$strip>]>>;
490
+ taskfile: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
491
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
492
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
493
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
494
+ }, z.core.$strip>]>>;
490
495
  travis: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
491
496
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
492
497
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1078,6 +1083,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1078
1083
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1079
1084
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1080
1085
  }, z.core.$strip>]>>;
1086
+ taskfile: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1087
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1088
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1089
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1090
+ }, z.core.$strip>]>>;
1081
1091
  travis: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1082
1092
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1083
1093
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -491,6 +491,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
491
491
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
492
492
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
493
493
  }, z.core.$strip>]>;
494
+ taskfile: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
495
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
496
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
497
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
498
+ }, z.core.$strip>]>;
494
499
  travis: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
495
500
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
496
501
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -107,6 +107,7 @@ export const pluginsSchema = z.object({
107
107
  svgo: pluginSchema,
108
108
  syncpack: pluginSchema,
109
109
  tailwind: pluginSchema,
110
+ taskfile: pluginSchema,
110
111
  travis: pluginSchema,
111
112
  'ts-node': pluginSchema,
112
113
  tsdown: pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'astro-db' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'svgo' | 'syncpack' | 'tailwind' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
- export declare const pluginNames: readonly ["angular", "astro", "astro-db", "ava", "babel", "biome", "bumpp", "bun", "c8", "capacitor", "changelogen", "changelogithub", "changesets", "commitizen", "commitlint", "convex", "create-typescript-app", "cspell", "cucumber", "cypress", "danger", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "hardhat", "husky", "i18next-parser", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "mdx", "mdxlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "node", "node-modules-inspector", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "pnpm", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rslib", "rspack", "rstest", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "storybook", "stryker", "stylelint", "svelte", "svgo", "syncpack", "tailwind", "travis", "ts-node", "tsdown", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
1
+ export type PluginName = 'angular' | 'astro' | 'astro-db' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'eleventy' | 'eslint' | 'expo' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'ladle' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lockfile-lint' | 'lost-pixel' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nx' | 'nyc' | 'oclif' | 'oxlint' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'react-cosmos' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'semantic-release' | 'sentry' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'svgo' | 'syncpack' | 'tailwind' | 'taskfile' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'vercel-og' | 'vike' | 'vite' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'xo' | 'yarn' | 'yorkie';
2
+ export declare const pluginNames: readonly ["angular", "astro", "astro-db", "ava", "babel", "biome", "bumpp", "bun", "c8", "capacitor", "changelogen", "changelogithub", "changesets", "commitizen", "commitlint", "convex", "create-typescript-app", "cspell", "cucumber", "cypress", "danger", "dependency-cruiser", "docusaurus", "dotenv", "drizzle", "eleventy", "eslint", "expo", "gatsby", "github-action", "github-actions", "glob", "graphql-codegen", "hardhat", "husky", "i18next-parser", "jest", "karma", "ladle", "lefthook", "lint-staged", "linthtml", "lockfile-lint", "lost-pixel", "markdownlint", "mdx", "mdxlint", "metro", "mocha", "moonrepo", "msw", "nano-staged", "nest", "netlify", "next", "node", "node-modules-inspector", "nodemon", "npm-package-json-lint", "nuxt", "nx", "nyc", "oclif", "oxlint", "playwright", "playwright-ct", "playwright-test", "plop", "pnpm", "postcss", "preconstruct", "prettier", "prisma", "react-cosmos", "react-router", "relay", "release-it", "remark", "remix", "rollup", "rsbuild", "rslib", "rspack", "rstest", "semantic-release", "sentry", "simple-git-hooks", "size-limit", "sst", "starlight", "storybook", "stryker", "stylelint", "svelte", "svgo", "syncpack", "tailwind", "taskfile", "travis", "ts-node", "tsdown", "tsup", "tsx", "typedoc", "typescript", "unbuild", "unocss", "vercel-og", "vike", "vite", "vitest", "vue", "webdriver-io", "webpack", "wireit", "wrangler", "xo", "yarn", "yorkie"];
@@ -96,6 +96,7 @@ export const pluginNames = [
96
96
  'svgo',
97
97
  'syncpack',
98
98
  'tailwind',
99
+ 'taskfile',
99
100
  'travis',
100
101
  'ts-node',
101
102
  'tsdown',
@@ -12,5 +12,8 @@ export type Args = {
12
12
  config?: ConfigArg;
13
13
  args?: (args: string[]) => string[];
14
14
  fromArgs?: string[] | ((parsed: ParsedArgs, args: string[]) => string[]);
15
- resolveInputs?: (parsed: ParsedArgs, args: string[]) => Input[];
15
+ resolveInputs?: (parsed: ParsedArgs, options: {
16
+ cwd: string;
17
+ args: string[];
18
+ }) => Input[];
16
19
  };
@@ -9,7 +9,7 @@ type References = Set<Reference>;
9
9
  type Tags = Set<string>;
10
10
  export type IdToFileMap = Map<Identifier, Set<FilePath>>;
11
11
  export type IdToNsToFileMap = Map<Identifier, Map<NamespaceOrAlias, Set<FilePath>>>;
12
- export type ImportDetails = {
12
+ export type ImportMaps = {
13
13
  refs: References;
14
14
  imported: IdToFileMap;
15
15
  importedAs: IdToNsToFileMap;
@@ -18,9 +18,10 @@ export type ImportDetails = {
18
18
  reExportedAs: IdToNsToFileMap;
19
19
  reExportedNs: IdToFileMap;
20
20
  };
21
- export type ImportMap = Map<FilePath, ImportDetails>;
21
+ export type ImportMap = Map<FilePath, ImportMaps>;
22
22
  export type Import = {
23
23
  specifier: string;
24
+ identifier: string;
24
25
  pos?: number;
25
26
  line?: number;
26
27
  col?: number;
@@ -36,7 +37,6 @@ export interface Export {
36
37
  refs: [number, boolean];
37
38
  fixes: Fixes;
38
39
  symbol?: ts.Symbol;
39
- isReExport: boolean;
40
40
  }
41
41
  export type ExportMember = {
42
42
  identifier: Identifier;
@@ -50,19 +50,19 @@ export type ExportMember = {
50
50
  jsDocTags: Tags;
51
51
  };
52
52
  export type ExportMap = Map<Identifier, Export>;
53
- export type Specifiers = Set<[Import, FilePath]>;
53
+ export type Imports = Set<[Import, FilePath]>;
54
54
  export type FileNode = {
55
55
  imports: {
56
56
  internal: ImportMap;
57
57
  external: Set<Import>;
58
58
  unresolved: Set<Import>;
59
59
  resolved: Set<FilePath>;
60
- specifiers: Specifiers;
60
+ imports: Imports;
61
61
  };
62
62
  exports: ExportMap;
63
63
  duplicates: Iterable<Array<IssueSymbol>>;
64
64
  scripts: Set<string>;
65
- imported?: ImportDetails;
65
+ imported?: ImportMaps;
66
66
  internalImportCache?: ImportMap;
67
67
  traceRefs: References;
68
68
  };
@@ -1,6 +1,7 @@
1
1
  import ts from 'typescript';
2
2
  import type { Fix } from '../types/exports.js';
3
3
  import type { SymbolType } from '../types/issues.js';
4
+ import type { BoundSourceFile } from './SourceFile.js';
4
5
  export declare function isDefaultImport(node: ts.ImportDeclaration | ts.ImportEqualsDeclaration | ts.ExportDeclaration): node is ts.ImportDeclaration;
5
6
  export declare function isAccessExpression(node: ts.Node): node is ts.AccessExpression;
6
7
  export declare function isImportCall(node: ts.Node): node is ts.ImportCall;
@@ -25,6 +26,13 @@ export declare const getEnumMember: (member: ts.EnumMember, isFixTypes: boolean)
25
26
  export declare function stripQuotes(name: string): string;
26
27
  export declare function findAncestor<T>(node: ts.Node | undefined, callback: (element: ts.Node) => boolean | 'STOP'): T | undefined;
27
28
  export declare function findDescendants<T>(node: ts.Node | undefined, callback: (element: ts.Node) => boolean | 'STOP'): T[];
29
+ export declare const getLeadingComments: (sourceFile: BoundSourceFile) => {
30
+ text: string;
31
+ hasTrailingNewLine?: boolean;
32
+ kind: ts.CommentKind;
33
+ pos: number;
34
+ end: number;
35
+ }[];
28
36
  export declare const isDeclarationFileExtension: (extension: string) => extension is ".d.ts" | ".d.mts" | ".d.cts";
29
37
  export declare const getJSDocTags: (node: ts.Node) => Set<string>;
30
38
  export declare const getLineAndCharacterOfPosition: (node: ts.Node, pos: number) => {
@@ -36,6 +44,7 @@ export declare const getAccessMembers: (typeChecker: ts.TypeChecker, node: ts.Id
36
44
  export declare const isDestructuring: (node: ts.Node) => boolean;
37
45
  export declare const getDestructuredNames: (name: ts.ObjectBindingPattern) => [string[], boolean];
38
46
  export declare const isConsiderReferencedNS: (node: ts.Identifier) => boolean;
47
+ export declare const isInOpaqueExpression: (node: ts.Node) => boolean;
39
48
  export declare const isObjectEnumerationCallExpressionArgument: (node: ts.Identifier) => boolean;
40
49
  export declare const isInForIteration: (node: ts.Node) => boolean;
41
50
  export declare const isTopLevel: (node: ts.Node) => boolean;