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
|
@@ -8,7 +8,6 @@ const enablers = ['@angular/cli'];
|
|
|
8
8
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
9
9
|
const config = ['angular.json'];
|
|
10
10
|
const resolveConfig = async (config, options) => {
|
|
11
|
-
const { cwd, configFilePath } = options;
|
|
12
11
|
if (!config?.projects)
|
|
13
12
|
return [];
|
|
14
13
|
const inputs = new Set();
|
|
@@ -22,7 +21,7 @@ const resolveConfig = async (config, options) => {
|
|
|
22
21
|
inputs.add(toDependency(packageName));
|
|
23
22
|
if (opts) {
|
|
24
23
|
if ('tsConfig' in opts && typeof opts.tsConfig === 'string') {
|
|
25
|
-
inputs.add(toConfig('typescript', opts.tsConfig
|
|
24
|
+
inputs.add(toConfig('typescript', opts.tsConfig));
|
|
26
25
|
}
|
|
27
26
|
}
|
|
28
27
|
const defaultEntriesByOption = opts ? entriesByOption(opts) : new Map();
|
|
@@ -31,7 +30,7 @@ const resolveConfig = async (config, options) => {
|
|
|
31
30
|
const isBuildTarget = targetName === BUILD_TARGET_NAME;
|
|
32
31
|
const maybeExternal = (option) => option === 'polyfills';
|
|
33
32
|
const toInput = (specifier, opts) => {
|
|
34
|
-
const normalizedPath = join(cwd, specifier);
|
|
33
|
+
const normalizedPath = join(options.cwd, specifier);
|
|
35
34
|
if (opts.maybeExternal && !isInternal(specifier) && !existsSync(normalizedPath)) {
|
|
36
35
|
return toDeferResolve(specifier);
|
|
37
36
|
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
const title = 'bumpp';
|
|
3
|
+
const enablers = ['bumpp'];
|
|
4
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
|
+
const entry = ['bump.config.{mjs,ts,js,cjs,mts,cts}'];
|
|
6
|
+
export default {
|
|
7
|
+
title,
|
|
8
|
+
enablers,
|
|
9
|
+
isEnabled,
|
|
10
|
+
entry,
|
|
11
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toC12config } from '../../util/plugin-config.js';
|
|
2
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { toC12config } from '../../util/plugin-config.js';
|
|
3
3
|
const title = 'Changelogen';
|
|
4
4
|
const enablers = ['changelogen'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toC12config } from '../../util/plugin-config.js';
|
|
2
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { toC12config } from '../../util/plugin-config.js';
|
|
3
3
|
const title = 'Changelogithub';
|
|
4
4
|
const enablers = ['changelogithub'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toDependency } from '../../util/input.js';
|
|
2
|
-
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
4
4
|
const title = 'commitlint';
|
|
5
5
|
const enablers = ['@commitlint/cli'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
+
import type { ParsedArgs } from 'minimist';
|
|
1
2
|
import type { IsLoadConfig, IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
3
|
+
import { type Input } from '../../util/input.js';
|
|
2
4
|
import type { ESLintConfigDeprecated } from './types.js';
|
|
3
5
|
export declare const docs: {
|
|
4
6
|
note: string;
|
|
@@ -9,6 +11,11 @@ declare const _default: {
|
|
|
9
11
|
isEnabled: IsPluginEnabled;
|
|
10
12
|
packageJsonPath: string;
|
|
11
13
|
config: string[];
|
|
14
|
+
args: {
|
|
15
|
+
config: boolean;
|
|
16
|
+
boolean: string[];
|
|
17
|
+
resolveInputs: (parsed: ParsedArgs) => Input[];
|
|
18
|
+
};
|
|
12
19
|
isLoadConfig: IsLoadConfig;
|
|
13
20
|
resolveConfig: ResolveConfig<ESLintConfigDeprecated>;
|
|
14
21
|
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { toDependency } from '../../util/input.js';
|
|
1
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
3
|
import { getInputs } from './helpers.js';
|
|
3
4
|
const title = 'ESLint';
|
|
@@ -41,12 +42,23 @@ consider using an extended glob pattern like this:
|
|
|
41
42
|
\`\`\`
|
|
42
43
|
`;
|
|
43
44
|
export const docs = { note };
|
|
45
|
+
const args = {
|
|
46
|
+
config: true,
|
|
47
|
+
boolean: ['inspect-config'],
|
|
48
|
+
resolveInputs: (parsed) => {
|
|
49
|
+
const inputs = [];
|
|
50
|
+
if (parsed['inspect-config'])
|
|
51
|
+
inputs.push(toDependency('@eslint/config-inspector', { optional: true }));
|
|
52
|
+
return inputs;
|
|
53
|
+
},
|
|
54
|
+
};
|
|
44
55
|
export default {
|
|
45
56
|
title,
|
|
46
57
|
enablers,
|
|
47
58
|
isEnabled,
|
|
48
59
|
packageJsonPath,
|
|
49
60
|
config,
|
|
61
|
+
args,
|
|
50
62
|
isLoadConfig,
|
|
51
63
|
resolveConfig,
|
|
52
64
|
};
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -39,6 +39,12 @@ export declare const Plugins: {
|
|
|
39
39
|
config: string[];
|
|
40
40
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./biome/types.js").BiomeConfig>;
|
|
41
41
|
};
|
|
42
|
+
bumpp: {
|
|
43
|
+
title: string;
|
|
44
|
+
enablers: string[];
|
|
45
|
+
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
46
|
+
entry: string[];
|
|
47
|
+
};
|
|
42
48
|
bun: {
|
|
43
49
|
title: string;
|
|
44
50
|
enablers: string[];
|
|
@@ -181,6 +187,11 @@ export declare const Plugins: {
|
|
|
181
187
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
182
188
|
packageJsonPath: string;
|
|
183
189
|
config: string[];
|
|
190
|
+
args: {
|
|
191
|
+
config: boolean;
|
|
192
|
+
boolean: string[];
|
|
193
|
+
resolveInputs: (parsed: import("minimist").ParsedArgs) => import("../util/input.js").Input[];
|
|
194
|
+
};
|
|
184
195
|
isLoadConfig: import("../types/config.js").IsLoadConfig;
|
|
185
196
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./eslint/types.js").ESLintConfigDeprecated>;
|
|
186
197
|
};
|
|
@@ -218,7 +229,6 @@ export declare const Plugins: {
|
|
|
218
229
|
glob: {
|
|
219
230
|
title: string;
|
|
220
231
|
args: {
|
|
221
|
-
binaries: string[];
|
|
222
232
|
positional: boolean;
|
|
223
233
|
alias: {
|
|
224
234
|
cmd: string[];
|
|
@@ -412,7 +422,6 @@ export declare const Plugins: {
|
|
|
412
422
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
413
423
|
config: string[];
|
|
414
424
|
args: {
|
|
415
|
-
binaries: string[];
|
|
416
425
|
config: boolean;
|
|
417
426
|
};
|
|
418
427
|
};
|
|
@@ -472,7 +481,6 @@ export declare const Plugins: {
|
|
|
472
481
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
473
482
|
config: string[];
|
|
474
483
|
args: {
|
|
475
|
-
binaries: string[];
|
|
476
484
|
config: boolean;
|
|
477
485
|
};
|
|
478
486
|
};
|
|
@@ -484,7 +492,6 @@ export declare const Plugins: {
|
|
|
484
492
|
entry: string[];
|
|
485
493
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./playwright/types.js").PlaywrightTestConfig>;
|
|
486
494
|
args: {
|
|
487
|
-
binaries: string[];
|
|
488
495
|
positional: boolean;
|
|
489
496
|
args: (args: string[]) => string[];
|
|
490
497
|
config: boolean;
|
|
@@ -503,7 +510,6 @@ export declare const Plugins: {
|
|
|
503
510
|
enablers: string[];
|
|
504
511
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
505
512
|
args: {
|
|
506
|
-
binaries: string[];
|
|
507
513
|
positional: boolean;
|
|
508
514
|
args: (args: string[]) => string[];
|
|
509
515
|
config: boolean;
|
|
@@ -518,6 +524,7 @@ export declare const Plugins: {
|
|
|
518
524
|
pnpm: {
|
|
519
525
|
title: string;
|
|
520
526
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
527
|
+
isRootOnly: true;
|
|
521
528
|
config: string[];
|
|
522
529
|
};
|
|
523
530
|
postcss: {
|
|
@@ -547,7 +554,6 @@ export declare const Plugins: {
|
|
|
547
554
|
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
548
555
|
config: string[];
|
|
549
556
|
args: {
|
|
550
|
-
binaries: string[];
|
|
551
557
|
config: boolean;
|
|
552
558
|
};
|
|
553
559
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./prisma/types.js").PrismaConfig>;
|
|
@@ -629,6 +635,13 @@ export declare const Plugins: {
|
|
|
629
635
|
config: string[];
|
|
630
636
|
resolveConfig: import("../types/config.js").ResolveConfig<import("./webpack/types.js").WebpackConfig>;
|
|
631
637
|
};
|
|
638
|
+
rstest: {
|
|
639
|
+
title: string;
|
|
640
|
+
enablers: string[];
|
|
641
|
+
isEnabled: import("../types/config.js").IsPluginEnabled;
|
|
642
|
+
config: string[];
|
|
643
|
+
resolveConfig: import("../types/config.js").ResolveConfig<import("./rstest/types.js").RstestConfig>;
|
|
644
|
+
};
|
|
632
645
|
'semantic-release': {
|
|
633
646
|
title: string;
|
|
634
647
|
enablers: string[];
|
|
@@ -732,7 +745,6 @@ export declare const Plugins: {
|
|
|
732
745
|
'ts-node': {
|
|
733
746
|
title: string;
|
|
734
747
|
args: {
|
|
735
|
-
binaries: string[];
|
|
736
748
|
positional: boolean;
|
|
737
749
|
nodeImportArgs: boolean;
|
|
738
750
|
boolean: string[];
|
package/dist/plugins/index.js
CHANGED
|
@@ -3,6 +3,7 @@ import { default as astro } from './astro/index.js';
|
|
|
3
3
|
import { default as ava } from './ava/index.js';
|
|
4
4
|
import { default as babel } from './babel/index.js';
|
|
5
5
|
import { default as biome } from './biome/index.js';
|
|
6
|
+
import { default as bumpp } from './bumpp/index.js';
|
|
6
7
|
import { default as bun } from './bun/index.js';
|
|
7
8
|
import { default as c8 } from './c8/index.js';
|
|
8
9
|
import { default as capacitor } from './capacitor/index.js';
|
|
@@ -48,8 +49,8 @@ import { default as nanoStaged } from './nano-staged/index.js';
|
|
|
48
49
|
import { default as nest } from './nest/index.js';
|
|
49
50
|
import { default as netlify } from './netlify/index.js';
|
|
50
51
|
import { default as next } from './next/index.js';
|
|
51
|
-
import { default as nodeModulesInspector } from './node-modules-inspector/index.js';
|
|
52
52
|
import { default as node } from './node/index.js';
|
|
53
|
+
import { default as nodeModulesInspector } from './node-modules-inspector/index.js';
|
|
53
54
|
import { default as nodemon } from './nodemon/index.js';
|
|
54
55
|
import { default as npmPackageJsonLint } from './npm-package-json-lint/index.js';
|
|
55
56
|
import { default as nuxt } from './nuxt/index.js';
|
|
@@ -57,9 +58,9 @@ import { default as nx } from './nx/index.js';
|
|
|
57
58
|
import { default as nyc } from './nyc/index.js';
|
|
58
59
|
import { default as oclif } from './oclif/index.js';
|
|
59
60
|
import { default as oxlint } from './oxlint/index.js';
|
|
61
|
+
import { default as playwright } from './playwright/index.js';
|
|
60
62
|
import { default as playwrightCt } from './playwright-ct/index.js';
|
|
61
63
|
import { default as playwrightTest } from './playwright-test/index.js';
|
|
62
|
-
import { default as playwright } from './playwright/index.js';
|
|
63
64
|
import { default as plop } from './plop/index.js';
|
|
64
65
|
import { default as pnpm } from './pnpm/index.js';
|
|
65
66
|
import { default as postcss } from './postcss/index.js';
|
|
@@ -76,6 +77,7 @@ import { default as rollup } from './rollup/index.js';
|
|
|
76
77
|
import { default as rsbuild } from './rsbuild/index.js';
|
|
77
78
|
import { default as rslib } from './rslib/index.js';
|
|
78
79
|
import { default as rspack } from './rspack/index.js';
|
|
80
|
+
import { default as rstest } from './rstest/index.js';
|
|
79
81
|
import { default as semanticRelease } from './semantic-release/index.js';
|
|
80
82
|
import { default as sentry } from './sentry/index.js';
|
|
81
83
|
import { default as simpleGitHooks } from './simple-git-hooks/index.js';
|
|
@@ -116,6 +118,7 @@ export const Plugins = {
|
|
|
116
118
|
ava,
|
|
117
119
|
babel,
|
|
118
120
|
biome,
|
|
121
|
+
bumpp,
|
|
119
122
|
bun,
|
|
120
123
|
c8,
|
|
121
124
|
capacitor,
|
|
@@ -189,6 +192,7 @@ export const Plugins = {
|
|
|
189
192
|
rsbuild,
|
|
190
193
|
rslib,
|
|
191
194
|
rspack,
|
|
195
|
+
rstest,
|
|
192
196
|
'semantic-release': semanticRelease,
|
|
193
197
|
sentry,
|
|
194
198
|
'simple-git-hooks': simpleGitHooks,
|
|
@@ -15,7 +15,7 @@ export const inputsFromPlugins = (plugins, devDependencies) => {
|
|
|
15
15
|
return;
|
|
16
16
|
return isInternal(plugin) ? toDeferResolveEntry(plugin) : toDependency(plugin);
|
|
17
17
|
})
|
|
18
|
-
.filter(input => !!input);
|
|
18
|
+
.filter((input) => !!input);
|
|
19
19
|
};
|
|
20
20
|
export const loadConfig = (configFile) => {
|
|
21
21
|
if (typeof configFile !== 'function')
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toLilconfig } from '../../util/plugin-config.js';
|
|
2
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { toLilconfig } from '../../util/plugin-config.js';
|
|
3
3
|
const title = 'lint-staged';
|
|
4
4
|
const enablers = ['lint-staged'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
-
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
4
4
|
const title = 'LintHTML';
|
|
5
5
|
const packageJsonPath = 'linthtmlConfig';
|
|
6
6
|
const enablers = ['@linthtml/linthtml'];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
2
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
3
|
const title = 'lockfile-lint';
|
|
4
4
|
const enablers = ['lockfile-lint'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { toUnconfig } from '../../util/plugin-config.js';
|
|
2
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { toUnconfig } from '../../util/plugin-config.js';
|
|
3
3
|
const title = 'node-modules-inspector';
|
|
4
4
|
const enablers = ['node-modules-inspector'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = [...toUnconfig('node-modules-inspector.config')];
|
|
7
7
|
const args = {
|
|
8
|
-
binaries: ['node-modules-inspector'],
|
|
9
8
|
config: true,
|
|
10
9
|
};
|
|
11
10
|
export default {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toDependency } from '../../util/input.js';
|
|
2
|
-
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
4
4
|
const title = 'npm-package-json-lint';
|
|
5
5
|
const enablers = ['npm-package-json-lint'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -34,7 +34,13 @@ const resolveConfig = async (localConfig) => {
|
|
|
34
34
|
'server/middleware/**/*.ts',
|
|
35
35
|
'server/plugins/**/*.ts',
|
|
36
36
|
].map(pattern => toProductionEntry(join(srcDir, pattern)));
|
|
37
|
-
const deps = localConfig.modules?.
|
|
37
|
+
const deps = localConfig.modules?.reduce((acc, id) => {
|
|
38
|
+
if (Array.isArray(id) && typeof id[0] === 'string')
|
|
39
|
+
acc.push(toDependency(id[0]));
|
|
40
|
+
if (typeof id === 'string')
|
|
41
|
+
acc.push(toDependency(id));
|
|
42
|
+
return acc;
|
|
43
|
+
}, []) ?? [];
|
|
38
44
|
return [...deps, ...patterns];
|
|
39
45
|
};
|
|
40
46
|
const note = `Knip works best with [explicit imports](https://nuxt.com/docs/guide/concepts/auto-imports#explicit-imports).
|
|
@@ -3,7 +3,6 @@ const title = 'playwright-test';
|
|
|
3
3
|
const enablers = ['playwright-test'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const args = {
|
|
6
|
-
binaries: ['playwright-test'],
|
|
7
6
|
positional: true,
|
|
8
7
|
args: (args) => args.filter(arg => arg !== 'install' && arg !== 'test'),
|
|
9
8
|
config: true,
|
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
import { _firstGlob } from '../../util/glob.js';
|
|
1
2
|
const title = 'pnpm';
|
|
2
|
-
const isEnabled = ({ manifest }) => Boolean(manifest.packageManager?.startsWith('pnpm@')
|
|
3
|
+
const isEnabled = async ({ cwd, manifest }) => Boolean(manifest.packageManager?.startsWith('pnpm@') ||
|
|
4
|
+
(await _firstGlob({ cwd, patterns: ['pnpm-lock.yaml', 'pnpm-workspace.yaml'] })));
|
|
5
|
+
const isRootOnly = true;
|
|
3
6
|
const config = ['.pnpmfile.cjs'];
|
|
4
7
|
export default {
|
|
5
8
|
title,
|
|
6
9
|
isEnabled,
|
|
10
|
+
isRootOnly,
|
|
7
11
|
config,
|
|
8
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toDeferResolve, toDependency } from '../../util/input.js';
|
|
2
|
-
import { toLilconfig } from '../../util/plugin-config.js';
|
|
3
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toLilconfig } from '../../util/plugin-config.js';
|
|
4
4
|
const title = 'PostCSS';
|
|
5
5
|
const enablers = ['postcss', 'postcss-cli', 'next'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -29,7 +29,7 @@ const resolveConfig = async (localConfig, options) => {
|
|
|
29
29
|
};
|
|
30
30
|
const routes = routeConfig
|
|
31
31
|
.flatMap(mapRoute)
|
|
32
|
-
.map(route => (isWindows ? route : route.replace(/[\^*+?()
|
|
32
|
+
.map(route => (isWindows ? route : route.replace(/[\^*+?()[\]]/g, '\\$&')));
|
|
33
33
|
const resolved = [
|
|
34
34
|
toEntry(join(appDir, 'routes.{js,ts}')),
|
|
35
35
|
toProductionEntry(join(appDir, 'root.{jsx,tsx}')),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
2
|
const title = 'Rslib';
|
|
3
|
-
const enablers = ['rslib'];
|
|
3
|
+
const enablers = ['@rslib/core'];
|
|
4
4
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
5
5
|
const entry = ['rslib*.config.{mjs,ts,js,cjs,mts,cts}'];
|
|
6
6
|
const resolveConfig = () => {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { IsPluginEnabled, ResolveConfig } from '../../types/config.js';
|
|
2
|
+
import type { RstestConfig } from './types.js';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
enablers: string[];
|
|
6
|
+
isEnabled: IsPluginEnabled;
|
|
7
|
+
config: string[];
|
|
8
|
+
resolveConfig: ResolveConfig<RstestConfig>;
|
|
9
|
+
};
|
|
10
|
+
export default _default;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { toDeferResolve, toEntry } from '../../util/input.js';
|
|
2
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
const title = 'Rstest';
|
|
4
|
+
const enablers = ['@rstest/core'];
|
|
5
|
+
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
|
+
const config = ['rstest.config.{js,cjs,mjs,ts,cts,mts}'];
|
|
7
|
+
const mocks = ['**/__mocks__/**/*.?(c|m)[jt]s?(x)'];
|
|
8
|
+
const entry = ['**/*.{test,spec}.?(c|m)[jt]s?(x)'];
|
|
9
|
+
function testEnvironment(config) {
|
|
10
|
+
if (!config.testEnvironment || config.testEnvironment === 'node')
|
|
11
|
+
return [];
|
|
12
|
+
return [config.testEnvironment];
|
|
13
|
+
}
|
|
14
|
+
const resolveConfig = async (config) => {
|
|
15
|
+
const entries = (config.include ?? entry)
|
|
16
|
+
.concat(...mocks)
|
|
17
|
+
.map(toEntry)
|
|
18
|
+
.concat(...(config.exclude ?? []).map(id => toEntry(`!${id}`)));
|
|
19
|
+
const environments = testEnvironment(config);
|
|
20
|
+
const setupFiles = config.setupFiles ?? [];
|
|
21
|
+
return [...environments, ...setupFiles, ...entries].map(id => (typeof id === 'string' ? toDeferResolve(id) : id));
|
|
22
|
+
};
|
|
23
|
+
export default {
|
|
24
|
+
title,
|
|
25
|
+
enablers,
|
|
26
|
+
isEnabled,
|
|
27
|
+
config,
|
|
28
|
+
resolveConfig,
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
-
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
4
4
|
const title = 'Semantic Release';
|
|
5
5
|
const enablers = ['semantic-release'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toDependency } from '../../util/input.js';
|
|
2
|
-
import { toLilconfig } from '../../util/plugin-config.js';
|
|
3
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toLilconfig } from '../../util/plugin-config.js';
|
|
4
4
|
const title = 'size-limit';
|
|
5
5
|
const enablers = ['size-limit'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { toDeferResolve } from '../../util/input.js';
|
|
2
|
-
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
2
|
import { hasDependency } from '../../util/plugin.js';
|
|
3
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
4
4
|
const title = 'Stylelint';
|
|
5
5
|
const enablers = ['stylelint'];
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
2
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { toCosmiconfig } from '../../util/plugin-config.js';
|
|
3
3
|
const title = 'Syncpack';
|
|
4
4
|
const enablers = ['syncpack'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toUnconfig } from '../../util/plugin-config.js';
|
|
2
1
|
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
import { toUnconfig } from '../../util/plugin-config.js';
|
|
3
3
|
const title = 'UnoCSS';
|
|
4
4
|
const enablers = ['unocss'];
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
package/dist/plugins.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { PluginName } from './types/PluginNames.js';
|
|
2
1
|
import type { Args } from './types/args.js';
|
|
3
2
|
import type { Entries, PluginMap } from './types/config.js';
|
|
3
|
+
import type { PluginName } from './types/PluginNames.js';
|
|
4
4
|
declare const PMap: PluginMap;
|
|
5
5
|
declare const PluginEntries: Entries;
|
|
6
6
|
declare const pluginArgsMap: Map<string, [PluginName, Args]>;
|