knip 5.47.0 → 5.49.0

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 (82) hide show
  1. package/dist/ConfigurationChief.d.ts +3 -0
  2. package/dist/ProjectPrincipal.d.ts +2 -2
  3. package/dist/ProjectPrincipal.js +9 -7
  4. package/dist/WorkspaceWorker.d.ts +9 -8
  5. package/dist/WorkspaceWorker.js +100 -72
  6. package/dist/cli.js +2 -2
  7. package/dist/compilers/index.d.ts +31 -0
  8. package/dist/graph/analyze.js +0 -2
  9. package/dist/graph/build.js +62 -33
  10. package/dist/plugins/astro/index.d.ts +1 -0
  11. package/dist/plugins/astro/index.js +3 -1
  12. package/dist/plugins/ava/index.js +1 -1
  13. package/dist/plugins/cucumber/index.js +1 -1
  14. package/dist/plugins/cypress/index.js +1 -1
  15. package/dist/plugins/github-actions/index.js +1 -1
  16. package/dist/plugins/index.d.ts +27 -2
  17. package/dist/plugins/index.js +6 -0
  18. package/dist/plugins/jest/index.js +3 -1
  19. package/dist/plugins/ladle/index.js +1 -1
  20. package/dist/plugins/mocha/index.js +2 -2
  21. package/dist/plugins/next/index.d.ts +3 -2
  22. package/dist/plugins/next/index.js +19 -8
  23. package/dist/plugins/next/resolveFromAST.d.ts +2 -0
  24. package/dist/plugins/next/resolveFromAST.js +15 -0
  25. package/dist/plugins/node/index.js +1 -1
  26. package/dist/plugins/nodemon/index.js +1 -1
  27. package/dist/plugins/nuxt/index.d.ts +1 -1
  28. package/dist/plugins/nuxt/index.js +2 -2
  29. package/dist/plugins/playwright/index.js +1 -3
  30. package/dist/plugins/preconstruct/index.js +1 -1
  31. package/dist/plugins/react-cosmos/index.js +1 -1
  32. package/dist/plugins/react-router/index.js +4 -2
  33. package/dist/plugins/sst/index.d.ts +9 -0
  34. package/dist/plugins/sst/index.js +17 -0
  35. package/dist/plugins/sst/resolveFromAST.d.ts +2 -0
  36. package/dist/plugins/sst/resolveFromAST.js +47 -0
  37. package/dist/plugins/starlight/index.d.ts +9 -0
  38. package/dist/plugins/starlight/index.js +18 -0
  39. package/dist/plugins/starlight/resolveFromAST.d.ts +2 -0
  40. package/dist/plugins/starlight/resolveFromAST.js +20 -0
  41. package/dist/plugins/storybook/index.js +5 -2
  42. package/dist/plugins/tanstack-router/index.d.ts +12 -0
  43. package/dist/plugins/tanstack-router/index.js +46 -0
  44. package/dist/plugins/tanstack-router/resolveFromAST.d.ts +2 -0
  45. package/dist/plugins/tanstack-router/resolveFromAST.js +28 -0
  46. package/dist/plugins/tanstack-router/types.d.ts +7 -0
  47. package/dist/plugins/tanstack-router/types.js +1 -0
  48. package/dist/plugins/unbuild/index.js +1 -1
  49. package/dist/plugins/vitest/index.js +1 -1
  50. package/dist/reporters/codeowners.js +8 -6
  51. package/dist/reporters/json.js +3 -3
  52. package/dist/schema/configuration.d.ts +172 -1
  53. package/dist/schema/configuration.js +3 -1
  54. package/dist/schema/plugins.d.ts +69 -0
  55. package/dist/schema/plugins.js +3 -0
  56. package/dist/types/PluginNames.d.ts +2 -2
  57. package/dist/types/PluginNames.js +3 -0
  58. package/dist/types/config.d.ts +8 -0
  59. package/dist/typescript/ast-helpers.d.ts +4 -0
  60. package/dist/typescript/ast-helpers.js +62 -0
  61. package/dist/typescript/create-hosts.d.ts +3 -2
  62. package/dist/typescript/create-hosts.js +1 -3
  63. package/dist/util/Performance.js +7 -7
  64. package/dist/util/codeowners.d.ts +2 -0
  65. package/dist/util/codeowners.js +32 -0
  66. package/dist/util/errors.d.ts +1 -1
  67. package/dist/util/errors.js +2 -2
  68. package/dist/util/glob-core.js +1 -1
  69. package/dist/util/input.d.ts +1 -0
  70. package/dist/util/math.d.ts +6 -0
  71. package/dist/util/math.js +11 -0
  72. package/dist/util/object.d.ts +0 -1
  73. package/dist/util/object.js +0 -16
  74. package/dist/util/package-json.d.ts +1 -3
  75. package/dist/util/package-json.js +28 -5
  76. package/dist/util/plugin.d.ts +0 -2
  77. package/dist/util/plugin.js +1 -14
  78. package/dist/util/to-source-path.js +9 -12
  79. package/dist/version.d.ts +1 -1
  80. package/dist/version.js +1 -1
  81. package/package.json +3 -5
  82. package/schema.json +12 -0
@@ -0,0 +1,47 @@
1
+ import ts from 'typescript';
2
+ import { getImportMap, getPropertyValues } from '../../typescript/ast-helpers.js';
3
+ import { toDeferResolveProductionEntry } from '../../util/input.js';
4
+ export const getInputsFromHandlers = (sourceFile, options) => {
5
+ const { getSourceFile, getReferencedInternalFilePath } = options;
6
+ const entries = new Set();
7
+ const importMap = getImportMap(sourceFile);
8
+ function addHandlerSpecifiers(node) {
9
+ if (ts.isObjectLiteralExpression(node)) {
10
+ const specifiers = getPropertyValues(node, 'handler');
11
+ for (const specifier of specifiers)
12
+ entries.add(specifier.substring(0, specifier.lastIndexOf('.')));
13
+ }
14
+ ts.forEachChild(node, addHandlerSpecifiers);
15
+ }
16
+ function visit(node) {
17
+ if (ts.isCallExpression(node)) {
18
+ if (ts.isPropertyAccessExpression(node.expression)) {
19
+ if (node.expression.name.text === 'stack') {
20
+ const arg = node.arguments[0];
21
+ if (ts.isIdentifier(arg)) {
22
+ const importPath = importMap.get(arg.text);
23
+ if (importPath) {
24
+ const input = toDeferResolveProductionEntry(importPath, { containingFilePath: options.configFilePath });
25
+ const resolvedPath = getReferencedInternalFilePath(input);
26
+ if (resolvedPath) {
27
+ const stackFile = getSourceFile(resolvedPath);
28
+ if (stackFile)
29
+ ts.forEachChild(stackFile, addHandlerSpecifiers);
30
+ }
31
+ }
32
+ }
33
+ }
34
+ if (node.expression.name.text === 'route' && node.arguments.length >= 2) {
35
+ const handlerArg = node.arguments[1];
36
+ if (ts.isStringLiteral(handlerArg)) {
37
+ entries.add(handlerArg.text);
38
+ }
39
+ }
40
+ }
41
+ }
42
+ ts.forEachChild(node, visit);
43
+ }
44
+ ts.forEachChild(sourceFile, addHandlerSpecifiers);
45
+ ts.forEachChild(sourceFile, visit);
46
+ return Array.from(entries).map(specifier => toDeferResolveProductionEntry(specifier, { containingFilePath: options.configFilePath }));
47
+ };
@@ -0,0 +1,9 @@
1
+ import type { IsPluginEnabled, ResolveFromAST } from '../../types/config.js';
2
+ declare const _default: {
3
+ title: string;
4
+ enablers: string[];
5
+ isEnabled: IsPluginEnabled;
6
+ config: string[];
7
+ resolveFromAST: ResolveFromAST;
8
+ };
9
+ export default _default;
@@ -0,0 +1,18 @@
1
+ import { toProductionEntry } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
+ import { getComponentPathsFromSourceFile } from './resolveFromAST.js';
4
+ const title = 'Starlight';
5
+ const enablers = ['@astrojs/starlight'];
6
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
7
+ const config = ['astro.config.{js,cjs,mjs,ts}'];
8
+ const resolveFromAST = (sourceFile) => {
9
+ const componentPaths = getComponentPathsFromSourceFile(sourceFile);
10
+ return Array.from(componentPaths).map(id => toProductionEntry(id));
11
+ };
12
+ export default {
13
+ title,
14
+ enablers,
15
+ isEnabled,
16
+ config,
17
+ resolveFromAST,
18
+ };
@@ -0,0 +1,2 @@
1
+ import ts from 'typescript';
2
+ export declare const getComponentPathsFromSourceFile: (sourceFile: ts.SourceFile) => Set<string>;
@@ -0,0 +1,20 @@
1
+ import ts from 'typescript';
2
+ import { getDefaultImportName, getImportMap, getPropertyValues } from '../../typescript/ast-helpers.js';
3
+ export const getComponentPathsFromSourceFile = (sourceFile) => {
4
+ const componentPaths = new Set();
5
+ const importMap = getImportMap(sourceFile);
6
+ const starlightImportName = getDefaultImportName(importMap, '@astrojs/starlight');
7
+ function visit(node) {
8
+ if (ts.isCallExpression(node) && ts.isIdentifier(node.expression) && node.expression.text === starlightImportName) {
9
+ const starlightConfig = node.arguments[0];
10
+ if (ts.isObjectLiteralExpression(starlightConfig)) {
11
+ const values = getPropertyValues(starlightConfig, 'components');
12
+ for (const value of values)
13
+ componentPaths.add(value);
14
+ }
15
+ }
16
+ ts.forEachChild(node, visit);
17
+ }
18
+ visit(sourceFile);
19
+ return componentPaths;
20
+ };
@@ -17,8 +17,11 @@ const resolveEntryPaths = async (localConfig, options) => {
17
17
  return relative(cwd, join(configFileDir, pattern));
18
18
  return relative(cwd, join(configFileDir, pattern.directory, pattern.files ?? stories[0]));
19
19
  });
20
- const patterns = [...restEntry, ...(relativePatterns && relativePatterns.length > 0 ? relativePatterns : stories)];
21
- return patterns.map(toEntry);
20
+ const patterns = [
21
+ ...(options.config.entry ?? restEntry),
22
+ ...(relativePatterns && relativePatterns.length > 0 ? relativePatterns : stories),
23
+ ];
24
+ return patterns.map(id => toEntry(id));
22
25
  };
23
26
  const resolveConfig = async (localConfig) => {
24
27
  const addons = localConfig.addons?.map(addon => (typeof addon === 'string' ? addon : addon.name)) ?? [];
@@ -0,0 +1,12 @@
1
+ import type { IsPluginEnabled, ResolveEntryPaths, ResolveFromAST } from '../../types/config.js';
2
+ import type { TanstackRouterConfig } from './types.js';
3
+ declare const _default: {
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ production: string[];
9
+ resolveEntryPaths: ResolveEntryPaths<TanstackRouterConfig>;
10
+ resolveFromAST: ResolveFromAST;
11
+ };
12
+ export default _default;
@@ -0,0 +1,46 @@
1
+ import { toEntry } from '../../util/input.js';
2
+ import { extname, join } from '../../util/path.js';
3
+ import { hasDependency } from '../../util/plugin.js';
4
+ import { getCustomConfig } from './resolveFromAST.js';
5
+ const title = 'TanStack Router';
6
+ const enablers = ['@tanstack/react-router', '@tanstack/router-plugin', '@tanstack/router-cli'];
7
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
+ const config = [
9
+ 'tsr.config.json',
10
+ 'vite.config.{js,mjs,ts,cjs,mts,cts}',
11
+ 'rs{pack,build}.config.{js,mjs,ts,cjs,mts,cts}',
12
+ 'webpack.config.{js,mjs,ts,cjs,mts,cts}',
13
+ ];
14
+ const production = ['./src/routeTree.gen.ts', './src/routes/**/*.{ts,tsx}', '!src/routes/**/-*/**'];
15
+ const getEntryPatterns = (config) => {
16
+ const dir = config.routesDirectory ?? 'src/routes';
17
+ const entries = [
18
+ toEntry(join(config.generatedRouteTree ?? './src/routeTree.gen.ts')),
19
+ toEntry(join(dir, '**', `${config.routeFilePrefix ?? ''}*`)),
20
+ toEntry(join(`!${dir}`, '**', `${config.routeFileIgnorePrefix ?? '-'}*`)),
21
+ ];
22
+ if (config.routeFileIgnorePattern) {
23
+ entries.push(toEntry(join(`!${dir}`, '**', `*${config.routeFileIgnorePattern}*`)));
24
+ }
25
+ return entries;
26
+ };
27
+ const resolveEntryPaths = (localConfig, options) => {
28
+ if (extname(options.configFileName) !== '.json')
29
+ return [];
30
+ return getEntryPatterns(localConfig);
31
+ };
32
+ const resolveFromAST = (sourceFile, options) => {
33
+ if (extname(options.configFileName) === '.json')
34
+ return [];
35
+ const resolvedConfig = getCustomConfig(sourceFile);
36
+ return getEntryPatterns(resolvedConfig);
37
+ };
38
+ export default {
39
+ title,
40
+ enablers,
41
+ isEnabled,
42
+ config,
43
+ production,
44
+ resolveEntryPaths,
45
+ resolveFromAST,
46
+ };
@@ -0,0 +1,2 @@
1
+ import ts from 'typescript';
2
+ export declare const getCustomConfig: (sourceFile: ts.SourceFile) => Record<string, string>;
@@ -0,0 +1,28 @@
1
+ import ts from 'typescript';
2
+ import { getPropertyValueEntries } from '../../typescript/ast-helpers.js';
3
+ const CONFIG_KEYS = new Set([
4
+ 'routeFilePrefix',
5
+ 'routeFileIgnorePrefix',
6
+ 'routeFileIgnorePattern',
7
+ 'routesDirectory',
8
+ 'generatedRouteTree',
9
+ ]);
10
+ const FUNCTIONS = new Set(['TanStackRouterVite', 'TanStackRouterRspack', 'TanStackRouterWebpack']);
11
+ export const getCustomConfig = (sourceFile) => {
12
+ const config = {};
13
+ function visit(node) {
14
+ if (ts.isCallExpression(node)) {
15
+ const callee = node.expression;
16
+ if (ts.isIdentifier(callee) && FUNCTIONS.has(callee.text)) {
17
+ const firstArg = node.arguments[0];
18
+ if (ts.isObjectLiteralExpression(firstArg)) {
19
+ for (const [key, value] of getPropertyValueEntries(firstArg, CONFIG_KEYS))
20
+ config[key] = value;
21
+ }
22
+ }
23
+ }
24
+ ts.forEachChild(node, visit);
25
+ }
26
+ visit(sourceFile);
27
+ return config;
28
+ };
@@ -0,0 +1,7 @@
1
+ export type TanstackRouterConfig = {
2
+ routeFilePrefix?: string;
3
+ routeFileIgnorePrefix?: string;
4
+ routeFileIgnorePattern?: string;
5
+ routesDirectory?: string;
6
+ generatedRouteTree?: string;
7
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -9,7 +9,7 @@ const resolveConfig = config => {
9
9
  .flat()
10
10
  .map(obj => obj.entries)
11
11
  .flatMap(entries => entries?.map(entry => (typeof entry === 'string' ? entry : entry.input)) ?? [])
12
- .map(toEntry);
12
+ .map(id => toEntry(id));
13
13
  };
14
14
  export default {
15
15
  title,
@@ -84,7 +84,7 @@ export const resolveConfig = async (localConfig, options) => {
84
84
  const dir = join(options.configFileDir, cfg.test?.root ?? '.');
85
85
  const deps = (typeof entry === 'string' ? [entry] : Object.values(entry))
86
86
  .map(specifier => join(dir, specifier))
87
- .map(toEntry);
87
+ .map(id => toEntry(id));
88
88
  for (const dependency of deps)
89
89
  inputs.add(dependency);
90
90
  }
@@ -1,5 +1,5 @@
1
- import { OwnershipEngine } from '@snyk/github-codeowners/dist/lib/ownership/index.js';
2
1
  import picocolors from 'picocolors';
2
+ import { createOwnershipEngine } from '../util/codeowners.js';
3
3
  import { relative, resolve, toRelative } from '../util/path.js';
4
4
  import { getTitle, logIssueLine, logTitle } from './util.js';
5
5
  const logIssueSet = (issues) => {
@@ -22,13 +22,15 @@ export default ({ report, issues, isShowProgress, options }) => {
22
22
  console.error(error);
23
23
  }
24
24
  const codeownersFilePath = resolve(opts.path ?? '.github/CODEOWNERS');
25
- const codeownersEngine = OwnershipEngine.FromCodeownersFile(codeownersFilePath);
25
+ const findOwners = createOwnershipEngine(codeownersFilePath);
26
26
  const reportMultipleGroups = Object.values(report).filter(Boolean).length > 1;
27
- const [dependenciesOwner = '[no-owner]'] = codeownersEngine.calcFileOwnership('package.json');
28
- const fallbackOwner = dependenciesOwner;
27
+ const [dependenciesOwner = '[no-owner]'] = findOwners('package.json');
29
28
  let totalIssues = 0;
30
- const calcFileOwnership = (filePath) => codeownersEngine.calcFileOwnership(relative(filePath))[0] ?? fallbackOwner;
31
- const addOwner = (issue) => ({ ...issue, owner: calcFileOwnership(issue.filePath) });
29
+ const calcFileOwnership = (filePath) => findOwners(relative(filePath))[0] ?? dependenciesOwner;
30
+ const addOwner = (issue) => ({
31
+ ...issue,
32
+ owner: calcFileOwnership(issue.filePath),
33
+ });
32
34
  for (const [reportType, isReportType] of Object.entries(report)) {
33
35
  if (isReportType) {
34
36
  const title = reportMultipleGroups && getTitle(reportType);
@@ -1,4 +1,4 @@
1
- import { OwnershipEngine } from '@snyk/github-codeowners/dist/lib/ownership/index.js';
1
+ import { createOwnershipEngine } from '../util/codeowners.js';
2
2
  import { isFile } from '../util/fs.js';
3
3
  import { relative, resolve } from '../util/path.js';
4
4
  import { convert } from './util.js';
@@ -12,13 +12,13 @@ export default async ({ report, issues, options }) => {
12
12
  }
13
13
  const json = {};
14
14
  const codeownersFilePath = resolve(opts.codeowners ?? '.github/CODEOWNERS');
15
- const codeownersEngine = isFile(codeownersFilePath) && OwnershipEngine.FromCodeownersFile(codeownersFilePath);
15
+ const findOwners = isFile(codeownersFilePath) && createOwnershipEngine(codeownersFilePath);
16
16
  const flatten = (issues) => Object.values(issues).flatMap(Object.values);
17
17
  const initRow = (filePath) => {
18
18
  const file = relative(filePath);
19
19
  const row = {
20
20
  file,
21
- ...(codeownersEngine && { owners: codeownersEngine.calcFileOwnership(file) }),
21
+ ...(findOwners && { owners: findOwners(file).map(name => ({ name })) }),
22
22
  ...(report.dependencies && { dependencies: [] }),
23
23
  ...(report.devDependencies && { devDependencies: [] }),
24
24
  ...(report.optionalPeerDependencies && { optionalPeerDependencies: [] }),
@@ -1,5 +1,6 @@
1
1
  import { z } from 'zod';
2
2
  export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3
+ $schema: z.ZodOptional<z.ZodString>;
3
4
  rules: z.ZodOptional<z.ZodRecord<z.ZodUnion<[z.ZodLiteral<"files">, z.ZodLiteral<"dependencies">, z.ZodLiteral<"devDependencies">, z.ZodLiteral<"optionalPeerDependencies">, z.ZodLiteral<"unlisted">, z.ZodLiteral<"binaries">, z.ZodLiteral<"unresolved">, z.ZodLiteral<"exports">, z.ZodLiteral<"types">, z.ZodLiteral<"nsExports">, z.ZodLiteral<"nsTypes">, z.ZodLiteral<"duplicates">, z.ZodLiteral<"enumMembers">, z.ZodLiteral<"classMembers">]>, z.ZodEnum<["error", "warn", "off"]>>>;
4
5
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
5
6
  project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -889,6 +890,32 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
889
890
  entry?: string | string[] | undefined;
890
891
  project?: string | string[] | undefined;
891
892
  }>]>>;
893
+ sst: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
894
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
895
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
896
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
897
+ }, "strip", z.ZodTypeAny, {
898
+ config?: string | string[] | undefined;
899
+ entry?: string | string[] | undefined;
900
+ project?: string | string[] | undefined;
901
+ }, {
902
+ config?: string | string[] | undefined;
903
+ entry?: string | string[] | undefined;
904
+ project?: string | string[] | undefined;
905
+ }>]>>;
906
+ starlight: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
907
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
908
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
909
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
910
+ }, "strip", z.ZodTypeAny, {
911
+ config?: string | string[] | undefined;
912
+ entry?: string | string[] | undefined;
913
+ project?: string | string[] | undefined;
914
+ }, {
915
+ config?: string | string[] | undefined;
916
+ entry?: string | string[] | undefined;
917
+ project?: string | string[] | undefined;
918
+ }>]>>;
892
919
  storybook: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
893
920
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
894
921
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -967,6 +994,19 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
967
994
  entry?: string | string[] | undefined;
968
995
  project?: string | string[] | undefined;
969
996
  }>]>>;
997
+ 'tanstack-router': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
998
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
999
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1000
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1001
+ }, "strip", z.ZodTypeAny, {
1002
+ config?: string | string[] | undefined;
1003
+ entry?: string | string[] | undefined;
1004
+ project?: string | string[] | undefined;
1005
+ }, {
1006
+ config?: string | string[] | undefined;
1007
+ entry?: string | string[] | undefined;
1008
+ project?: string | string[] | undefined;
1009
+ }>]>>;
970
1010
  travis: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
971
1011
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
972
1012
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -1560,6 +1600,16 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
1560
1600
  entry?: string | string[] | undefined;
1561
1601
  project?: string | string[] | undefined;
1562
1602
  } | undefined;
1603
+ sst?: string | boolean | string[] | {
1604
+ config?: string | string[] | undefined;
1605
+ entry?: string | string[] | undefined;
1606
+ project?: string | string[] | undefined;
1607
+ } | undefined;
1608
+ starlight?: string | boolean | string[] | {
1609
+ config?: string | string[] | undefined;
1610
+ entry?: string | string[] | undefined;
1611
+ project?: string | string[] | undefined;
1612
+ } | undefined;
1563
1613
  storybook?: string | boolean | string[] | {
1564
1614
  config?: string | string[] | undefined;
1565
1615
  entry?: string | string[] | undefined;
@@ -1590,6 +1640,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
1590
1640
  entry?: string | string[] | undefined;
1591
1641
  project?: string | string[] | undefined;
1592
1642
  } | undefined;
1643
+ 'tanstack-router'?: string | boolean | string[] | {
1644
+ config?: string | string[] | undefined;
1645
+ entry?: string | string[] | undefined;
1646
+ project?: string | string[] | undefined;
1647
+ } | undefined;
1593
1648
  travis?: string | boolean | string[] | {
1594
1649
  config?: string | string[] | undefined;
1595
1650
  entry?: string | string[] | undefined;
@@ -2030,6 +2085,16 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
2030
2085
  entry?: string | string[] | undefined;
2031
2086
  project?: string | string[] | undefined;
2032
2087
  } | undefined;
2088
+ sst?: string | boolean | string[] | {
2089
+ config?: string | string[] | undefined;
2090
+ entry?: string | string[] | undefined;
2091
+ project?: string | string[] | undefined;
2092
+ } | undefined;
2093
+ starlight?: string | boolean | string[] | {
2094
+ config?: string | string[] | undefined;
2095
+ entry?: string | string[] | undefined;
2096
+ project?: string | string[] | undefined;
2097
+ } | undefined;
2033
2098
  storybook?: string | boolean | string[] | {
2034
2099
  config?: string | string[] | undefined;
2035
2100
  entry?: string | string[] | undefined;
@@ -2060,6 +2125,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
2060
2125
  entry?: string | string[] | undefined;
2061
2126
  project?: string | string[] | undefined;
2062
2127
  } | undefined;
2128
+ 'tanstack-router'?: string | boolean | string[] | {
2129
+ config?: string | string[] | undefined;
2130
+ entry?: string | string[] | undefined;
2131
+ project?: string | string[] | undefined;
2132
+ } | undefined;
2063
2133
  travis?: string | boolean | string[] | {
2064
2134
  config?: string | string[] | undefined;
2065
2135
  entry?: string | string[] | undefined;
@@ -3027,6 +3097,32 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
3027
3097
  entry?: string | string[] | undefined;
3028
3098
  project?: string | string[] | undefined;
3029
3099
  }>]>>;
3100
+ sst: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3101
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3102
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3103
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3104
+ }, "strip", z.ZodTypeAny, {
3105
+ config?: string | string[] | undefined;
3106
+ entry?: string | string[] | undefined;
3107
+ project?: string | string[] | undefined;
3108
+ }, {
3109
+ config?: string | string[] | undefined;
3110
+ entry?: string | string[] | undefined;
3111
+ project?: string | string[] | undefined;
3112
+ }>]>>;
3113
+ starlight: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3114
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3115
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3116
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3117
+ }, "strip", z.ZodTypeAny, {
3118
+ config?: string | string[] | undefined;
3119
+ entry?: string | string[] | undefined;
3120
+ project?: string | string[] | undefined;
3121
+ }, {
3122
+ config?: string | string[] | undefined;
3123
+ entry?: string | string[] | undefined;
3124
+ project?: string | string[] | undefined;
3125
+ }>]>>;
3030
3126
  storybook: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3031
3127
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3032
3128
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -3105,6 +3201,19 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
3105
3201
  entry?: string | string[] | undefined;
3106
3202
  project?: string | string[] | undefined;
3107
3203
  }>]>>;
3204
+ 'tanstack-router': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3205
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3206
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3207
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3208
+ }, "strip", z.ZodTypeAny, {
3209
+ config?: string | string[] | undefined;
3210
+ entry?: string | string[] | undefined;
3211
+ project?: string | string[] | undefined;
3212
+ }, {
3213
+ config?: string | string[] | undefined;
3214
+ entry?: string | string[] | undefined;
3215
+ project?: string | string[] | undefined;
3216
+ }>]>>;
3108
3217
  travis: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
3109
3218
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
3110
3219
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -3365,7 +3474,7 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
3365
3474
  entry?: string | string[] | undefined;
3366
3475
  project?: string | string[] | undefined;
3367
3476
  }>]>>;
3368
- }>, "strip", z.ZodTypeAny, {
3477
+ }>, "strict", z.ZodTypeAny, {
3369
3478
  exclude?: ("dependencies" | "exports" | "files" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
3370
3479
  tags?: string[] | undefined;
3371
3480
  include?: ("dependencies" | "exports" | "files" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers")[] | undefined;
@@ -3701,6 +3810,16 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
3701
3810
  entry?: string | string[] | undefined;
3702
3811
  project?: string | string[] | undefined;
3703
3812
  } | undefined;
3813
+ sst?: string | boolean | string[] | {
3814
+ config?: string | string[] | undefined;
3815
+ entry?: string | string[] | undefined;
3816
+ project?: string | string[] | undefined;
3817
+ } | undefined;
3818
+ starlight?: string | boolean | string[] | {
3819
+ config?: string | string[] | undefined;
3820
+ entry?: string | string[] | undefined;
3821
+ project?: string | string[] | undefined;
3822
+ } | undefined;
3704
3823
  storybook?: string | boolean | string[] | {
3705
3824
  config?: string | string[] | undefined;
3706
3825
  entry?: string | string[] | undefined;
@@ -3731,6 +3850,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
3731
3850
  entry?: string | string[] | undefined;
3732
3851
  project?: string | string[] | undefined;
3733
3852
  } | undefined;
3853
+ 'tanstack-router'?: string | boolean | string[] | {
3854
+ config?: string | string[] | undefined;
3855
+ entry?: string | string[] | undefined;
3856
+ project?: string | string[] | undefined;
3857
+ } | undefined;
3734
3858
  travis?: string | boolean | string[] | {
3735
3859
  config?: string | string[] | undefined;
3736
3860
  entry?: string | string[] | undefined;
@@ -3831,6 +3955,7 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
3831
3955
  entry?: string | string[] | undefined;
3832
3956
  project?: string | string[] | undefined;
3833
3957
  } | undefined;
3958
+ $schema?: string | undefined;
3834
3959
  rules?: Partial<Record<"dependencies" | "exports" | "files" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers", "error" | "warn" | "off">> | undefined;
3835
3960
  paths?: Record<string, string[]> | undefined;
3836
3961
  ignore?: string | string[] | undefined;
@@ -4177,6 +4302,16 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
4177
4302
  entry?: string | string[] | undefined;
4178
4303
  project?: string | string[] | undefined;
4179
4304
  } | undefined;
4305
+ sst?: string | boolean | string[] | {
4306
+ config?: string | string[] | undefined;
4307
+ entry?: string | string[] | undefined;
4308
+ project?: string | string[] | undefined;
4309
+ } | undefined;
4310
+ starlight?: string | boolean | string[] | {
4311
+ config?: string | string[] | undefined;
4312
+ entry?: string | string[] | undefined;
4313
+ project?: string | string[] | undefined;
4314
+ } | undefined;
4180
4315
  storybook?: string | boolean | string[] | {
4181
4316
  config?: string | string[] | undefined;
4182
4317
  entry?: string | string[] | undefined;
@@ -4207,6 +4342,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
4207
4342
  entry?: string | string[] | undefined;
4208
4343
  project?: string | string[] | undefined;
4209
4344
  } | undefined;
4345
+ 'tanstack-router'?: string | boolean | string[] | {
4346
+ config?: string | string[] | undefined;
4347
+ entry?: string | string[] | undefined;
4348
+ project?: string | string[] | undefined;
4349
+ } | undefined;
4210
4350
  travis?: string | boolean | string[] | {
4211
4351
  config?: string | string[] | undefined;
4212
4352
  entry?: string | string[] | undefined;
@@ -4651,6 +4791,16 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
4651
4791
  entry?: string | string[] | undefined;
4652
4792
  project?: string | string[] | undefined;
4653
4793
  } | undefined;
4794
+ sst?: string | boolean | string[] | {
4795
+ config?: string | string[] | undefined;
4796
+ entry?: string | string[] | undefined;
4797
+ project?: string | string[] | undefined;
4798
+ } | undefined;
4799
+ starlight?: string | boolean | string[] | {
4800
+ config?: string | string[] | undefined;
4801
+ entry?: string | string[] | undefined;
4802
+ project?: string | string[] | undefined;
4803
+ } | undefined;
4654
4804
  storybook?: string | boolean | string[] | {
4655
4805
  config?: string | string[] | undefined;
4656
4806
  entry?: string | string[] | undefined;
@@ -4681,6 +4831,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
4681
4831
  entry?: string | string[] | undefined;
4682
4832
  project?: string | string[] | undefined;
4683
4833
  } | undefined;
4834
+ 'tanstack-router'?: string | boolean | string[] | {
4835
+ config?: string | string[] | undefined;
4836
+ entry?: string | string[] | undefined;
4837
+ project?: string | string[] | undefined;
4838
+ } | undefined;
4684
4839
  travis?: string | boolean | string[] | {
4685
4840
  config?: string | string[] | undefined;
4686
4841
  entry?: string | string[] | undefined;
@@ -4781,6 +4936,7 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
4781
4936
  entry?: string | string[] | undefined;
4782
4937
  project?: string | string[] | undefined;
4783
4938
  } | undefined;
4939
+ $schema?: string | undefined;
4784
4940
  rules?: Partial<Record<"dependencies" | "exports" | "files" | "devDependencies" | "optionalPeerDependencies" | "unlisted" | "binaries" | "unresolved" | "types" | "nsExports" | "nsTypes" | "duplicates" | "enumMembers" | "classMembers", "error" | "warn" | "off">> | undefined;
4785
4941
  paths?: Record<string, string[]> | undefined;
4786
4942
  ignore?: string | string[] | undefined;
@@ -5127,6 +5283,16 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
5127
5283
  entry?: string | string[] | undefined;
5128
5284
  project?: string | string[] | undefined;
5129
5285
  } | undefined;
5286
+ sst?: string | boolean | string[] | {
5287
+ config?: string | string[] | undefined;
5288
+ entry?: string | string[] | undefined;
5289
+ project?: string | string[] | undefined;
5290
+ } | undefined;
5291
+ starlight?: string | boolean | string[] | {
5292
+ config?: string | string[] | undefined;
5293
+ entry?: string | string[] | undefined;
5294
+ project?: string | string[] | undefined;
5295
+ } | undefined;
5130
5296
  storybook?: string | boolean | string[] | {
5131
5297
  config?: string | string[] | undefined;
5132
5298
  entry?: string | string[] | undefined;
@@ -5157,6 +5323,11 @@ export declare const knipConfigurationSchema: z.ZodObject<z.objectUtil.extendSha
5157
5323
  entry?: string | string[] | undefined;
5158
5324
  project?: string | string[] | undefined;
5159
5325
  } | undefined;
5326
+ 'tanstack-router'?: string | boolean | string[] | {
5327
+ config?: string | string[] | undefined;
5328
+ entry?: string | string[] | undefined;
5329
+ project?: string | string[] | undefined;
5330
+ } | undefined;
5160
5331
  travis?: string | boolean | string[] | {
5161
5332
  config?: string | string[] | undefined;
5162
5333
  entry?: string | string[] | undefined;
@@ -35,6 +35,7 @@ const ignoreExportsUsedInFileSchema = z.union([
35
35
  ]), z.boolean()),
36
36
  ]);
37
37
  const rootConfigurationSchema = z.object({
38
+ $schema: z.string().optional(),
38
39
  rules: rulesSchema.optional(),
39
40
  entry: globSchema.optional(),
40
41
  project: globSchema.optional(),
@@ -74,4 +75,5 @@ const workspacesConfigurationSchema = z.object({
74
75
  export const knipConfigurationSchema = rootConfigurationSchema
75
76
  .merge(reportConfigSchema)
76
77
  .merge(workspacesConfigurationSchema)
77
- .merge(pluginsSchema.partial());
78
+ .merge(pluginsSchema.partial())
79
+ .strict();