knip 5.63.1 → 5.64.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.
- package/dist/CacheConsultant.js +1 -1
- package/dist/ConfigurationChief.d.ts +20 -8
- package/dist/DependencyDeputy.js +5 -4
- package/dist/IssueCollector.js +1 -1
- package/dist/IssueFixer.js +3 -1
- package/dist/ProjectPrincipal.d.ts +1 -1
- package/dist/ProjectPrincipal.js +2 -2
- package/dist/WorkspaceWorker.d.ts +1 -1
- package/dist/WorkspaceWorker.js +2 -2
- package/dist/binaries/bash-parser.d.ts +1 -0
- package/dist/binaries/bash-parser.js +3 -0
- package/dist/binaries/fallback.js +3 -2
- package/dist/binaries/index.js +1 -1
- package/dist/binaries/package-manager/bun.js +1 -0
- package/dist/binaries/plugins.js +3 -1
- package/dist/cli.js +9 -9
- package/dist/compilers/index.d.ts +57 -30
- package/dist/compilers/index.js +1 -1
- package/dist/constants.js +2 -0
- package/dist/graph/analyze.js +7 -4
- package/dist/graph/build.js +9 -9
- package/dist/index.js +2 -2
- package/dist/manifest/index.js +1 -1
- package/dist/plugins/angular/index.js +2 -3
- package/dist/plugins/bumpp/index.d.ts +8 -0
- package/dist/plugins/bumpp/index.js +11 -0
- package/dist/plugins/changelogen/index.js +1 -1
- package/dist/plugins/changelogithub/index.js +1 -1
- package/dist/plugins/commitlint/index.js +1 -1
- package/dist/plugins/eslint/index.d.ts +7 -0
- package/dist/plugins/eslint/index.js +12 -0
- package/dist/plugins/glob/index.d.ts +0 -1
- package/dist/plugins/glob/index.js +0 -1
- package/dist/plugins/index.d.ts +19 -7
- package/dist/plugins/index.js +6 -2
- package/dist/plugins/karma/helpers.js +1 -1
- package/dist/plugins/lint-staged/index.js +1 -1
- package/dist/plugins/linthtml/index.js +1 -1
- package/dist/plugins/lockfile-lint/index.js +1 -1
- package/dist/plugins/node-modules-inspector/index.d.ts +0 -1
- package/dist/plugins/node-modules-inspector/index.js +1 -2
- package/dist/plugins/npm-package-json-lint/index.js +1 -1
- package/dist/plugins/nuxt/index.js +7 -1
- package/dist/plugins/nuxt/types.d.ts +1 -1
- package/dist/plugins/oxlint/index.d.ts +0 -1
- package/dist/plugins/oxlint/index.js +0 -1
- package/dist/plugins/playwright/index.d.ts +0 -1
- package/dist/plugins/playwright/index.js +0 -1
- package/dist/plugins/playwright-test/index.d.ts +0 -1
- package/dist/plugins/playwright-test/index.js +0 -1
- package/dist/plugins/pnpm/index.d.ts +1 -0
- package/dist/plugins/pnpm/index.js +5 -1
- package/dist/plugins/postcss/index.js +1 -1
- package/dist/plugins/prisma/index.d.ts +0 -1
- package/dist/plugins/prisma/index.js +0 -1
- package/dist/plugins/react-router/index.js +1 -1
- package/dist/plugins/rslib/index.js +1 -1
- package/dist/plugins/rstest/index.d.ts +10 -0
- package/dist/plugins/rstest/index.js +29 -0
- package/dist/plugins/rstest/types.d.ts +6 -0
- package/dist/plugins/rstest/types.js +1 -0
- package/dist/plugins/semantic-release/index.js +1 -1
- package/dist/plugins/size-limit/index.js +1 -1
- package/dist/plugins/stylelint/index.js +1 -1
- package/dist/plugins/syncpack/index.js +1 -1
- package/dist/plugins/ts-node/index.d.ts +0 -1
- package/dist/plugins/ts-node/index.js +0 -1
- package/dist/plugins/unocss/index.js +1 -1
- package/dist/plugins.d.ts +1 -1
- package/dist/reporters/githubActions.d.ts +3 -0
- package/dist/reporters/githubActions.js +94 -0
- package/dist/reporters/index.d.ts +1 -0
- package/dist/reporters/index.js +2 -0
- package/dist/reporters/json.js +1 -1
- package/dist/reporters/util/configuration-hints.d.ts +13 -1
- package/dist/reporters/util/configuration-hints.js +1 -0
- package/dist/schema/configuration.d.ts +1187 -6393
- package/dist/schema/configuration.js +54 -51
- package/dist/schema/plugins.d.ts +579 -2595
- package/dist/schema/plugins.js +6 -4
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +2 -0
- package/dist/types/args.d.ts +2 -0
- package/dist/types/config.d.ts +2 -2
- package/dist/types/exports.d.ts +1 -1
- package/dist/types/imports.d.ts +1 -1
- package/dist/types/module-graph.d.ts +5 -4
- package/dist/typescript/SourceFile.d.ts +2 -2
- package/dist/typescript/ast-helpers.d.ts +4 -0
- package/dist/typescript/ast-helpers.js +29 -0
- package/dist/typescript/find-internal-references.js +10 -1
- package/dist/typescript/get-imports-and-exports.js +28 -18
- package/dist/typescript/resolve-module-names.js +1 -1
- package/dist/typescript/visitors/dynamic-imports/importCall.js +6 -1
- package/dist/util/cli-arguments.d.ts +3 -2
- package/dist/util/cli-arguments.js +2 -2
- package/dist/util/create-options.d.ts +61 -35
- package/dist/util/create-options.js +1 -1
- package/dist/util/errors.d.ts +4 -4
- package/dist/util/errors.js +8 -8
- package/dist/util/file-entry-cache.js +1 -1
- package/dist/util/glob-core.js +1 -1
- package/dist/util/glob.js +1 -1
- package/dist/util/input.d.ts +1 -1
- package/dist/util/load-config.d.ts +2 -1
- package/dist/util/load-config.js +4 -4
- package/dist/util/loader.js +1 -1
- package/dist/util/modules.js +18 -7
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +18 -19
- package/schema.json +8 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { z } from 'zod';
|
|
1
|
+
import { z } from 'zod/mini';
|
|
2
2
|
import { globSchema, pluginsSchema } from './plugins.js';
|
|
3
3
|
const pathsSchema = z.record(z.string(), z.array(z.string()));
|
|
4
|
-
const syncCompilerSchema = z.union([z.
|
|
5
|
-
const asyncCompilerSchema = z.
|
|
4
|
+
const syncCompilerSchema = z.union([z.literal(true), z.custom()]);
|
|
5
|
+
const asyncCompilerSchema = z.custom();
|
|
6
6
|
const compilerSchema = z.union([syncCompilerSchema, asyncCompilerSchema]);
|
|
7
7
|
const compilersSchema = z.record(z.string(), compilerSchema);
|
|
8
8
|
const stringOrRegexSchema = z.array(z.union([z.string(), z.instanceof(RegExp)]));
|
|
@@ -22,59 +22,62 @@ const issueTypeSchema = z.union([
|
|
|
22
22
|
z.literal('enumMembers'),
|
|
23
23
|
z.literal('classMembers'),
|
|
24
24
|
]);
|
|
25
|
-
const rulesSchema = z.
|
|
26
|
-
const
|
|
27
|
-
z.boolean(),
|
|
28
|
-
z.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
]), z.boolean()),
|
|
36
|
-
]);
|
|
25
|
+
const rulesSchema = z.partialRecord(issueTypeSchema, z.enum(['error', 'warn', 'off']));
|
|
26
|
+
const ignoreExportsUsedInFileObjectSchema = z.strictObject({
|
|
27
|
+
class: z.optional(z.boolean()),
|
|
28
|
+
enum: z.optional(z.boolean()),
|
|
29
|
+
function: z.optional(z.boolean()),
|
|
30
|
+
interface: z.optional(z.boolean()),
|
|
31
|
+
member: z.optional(z.boolean()),
|
|
32
|
+
type: z.optional(z.boolean()),
|
|
33
|
+
});
|
|
34
|
+
const ignoreExportsUsedInFileSchema = z.union([z.boolean(), ignoreExportsUsedInFileObjectSchema]);
|
|
37
35
|
const rootConfigurationSchema = z.object({
|
|
38
|
-
$schema: z.
|
|
39
|
-
rules:
|
|
40
|
-
entry:
|
|
41
|
-
project:
|
|
42
|
-
paths:
|
|
43
|
-
ignore:
|
|
44
|
-
ignoreBinaries:
|
|
45
|
-
ignoreDependencies:
|
|
46
|
-
ignoreMembers:
|
|
47
|
-
ignoreUnresolved:
|
|
48
|
-
ignoreExportsUsedInFile:
|
|
49
|
-
ignoreWorkspaces: z.array(z.string())
|
|
50
|
-
includeEntryExports: z.
|
|
51
|
-
compilers:
|
|
52
|
-
syncCompilers: z.record(z.string(), syncCompilerSchema)
|
|
53
|
-
asyncCompilers: z.record(z.string(), asyncCompilerSchema)
|
|
54
|
-
tags: z.array(z.string())
|
|
55
|
-
treatConfigHintsAsErrors: z.
|
|
36
|
+
$schema: z.optional(z.string()),
|
|
37
|
+
rules: z.optional(rulesSchema),
|
|
38
|
+
entry: z.optional(globSchema),
|
|
39
|
+
project: z.optional(globSchema),
|
|
40
|
+
paths: z.optional(pathsSchema),
|
|
41
|
+
ignore: z.optional(globSchema),
|
|
42
|
+
ignoreBinaries: z.optional(stringOrRegexSchema),
|
|
43
|
+
ignoreDependencies: z.optional(stringOrRegexSchema),
|
|
44
|
+
ignoreMembers: z.optional(stringOrRegexSchema),
|
|
45
|
+
ignoreUnresolved: z.optional(stringOrRegexSchema),
|
|
46
|
+
ignoreExportsUsedInFile: z.optional(ignoreExportsUsedInFileSchema),
|
|
47
|
+
ignoreWorkspaces: z.optional(z.array(z.string())),
|
|
48
|
+
includeEntryExports: z.optional(z.boolean()),
|
|
49
|
+
compilers: z.optional(compilersSchema),
|
|
50
|
+
syncCompilers: z.optional(z.record(z.string(), syncCompilerSchema)),
|
|
51
|
+
asyncCompilers: z.optional(z.record(z.string(), asyncCompilerSchema)),
|
|
52
|
+
tags: z.optional(z.array(z.string())),
|
|
53
|
+
treatConfigHintsAsErrors: z.optional(z.boolean()),
|
|
56
54
|
});
|
|
57
55
|
const reportConfigSchema = z.object({
|
|
58
|
-
include: z.array(issueTypeSchema)
|
|
59
|
-
exclude: z.array(issueTypeSchema)
|
|
56
|
+
include: z.optional(z.array(issueTypeSchema)),
|
|
57
|
+
exclude: z.optional(z.array(issueTypeSchema)),
|
|
60
58
|
});
|
|
61
59
|
const baseWorkspaceConfigurationSchema = z.object({
|
|
62
|
-
entry:
|
|
63
|
-
project:
|
|
64
|
-
paths:
|
|
65
|
-
ignore:
|
|
66
|
-
ignoreBinaries:
|
|
67
|
-
ignoreDependencies:
|
|
68
|
-
ignoreMembers:
|
|
69
|
-
ignoreUnresolved:
|
|
70
|
-
includeEntryExports: z.
|
|
60
|
+
entry: z.optional(globSchema),
|
|
61
|
+
project: z.optional(globSchema),
|
|
62
|
+
paths: z.optional(pathsSchema),
|
|
63
|
+
ignore: z.optional(globSchema),
|
|
64
|
+
ignoreBinaries: z.optional(stringOrRegexSchema),
|
|
65
|
+
ignoreDependencies: z.optional(stringOrRegexSchema),
|
|
66
|
+
ignoreMembers: z.optional(stringOrRegexSchema),
|
|
67
|
+
ignoreUnresolved: z.optional(stringOrRegexSchema),
|
|
68
|
+
includeEntryExports: z.optional(z.boolean()),
|
|
69
|
+
});
|
|
70
|
+
const partialPluginsSchema = z.partial(pluginsSchema);
|
|
71
|
+
const workspaceConfigurationSchema = z.strictObject({
|
|
72
|
+
...baseWorkspaceConfigurationSchema.shape,
|
|
73
|
+
...partialPluginsSchema.shape,
|
|
71
74
|
});
|
|
72
|
-
const workspaceConfigurationSchema = baseWorkspaceConfigurationSchema.merge(pluginsSchema.partial());
|
|
73
75
|
const workspacesConfigurationSchema = z.object({
|
|
74
|
-
workspaces: z.record(z.string(), workspaceConfigurationSchema)
|
|
76
|
+
workspaces: z.optional(z.record(z.string(), workspaceConfigurationSchema)),
|
|
77
|
+
});
|
|
78
|
+
export const knipConfigurationSchema = z.strictObject({
|
|
79
|
+
...rootConfigurationSchema.shape,
|
|
80
|
+
...reportConfigSchema.shape,
|
|
81
|
+
...workspacesConfigurationSchema.shape,
|
|
82
|
+
...partialPluginsSchema.shape,
|
|
75
83
|
});
|
|
76
|
-
export const knipConfigurationSchema = rootConfigurationSchema
|
|
77
|
-
.merge(reportConfigSchema)
|
|
78
|
-
.merge(workspacesConfigurationSchema)
|
|
79
|
-
.merge(pluginsSchema.partial())
|
|
80
|
-
.strict();
|