knip 5.34.2 → 5.34.4
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/constants.js +1 -0
- package/dist/plugins/cspell/index.js +1 -1
- package/dist/plugins/cspell/types.d.ts +1 -1
- package/dist/plugins/linthtml/index.js +3 -3
- package/dist/plugins/nyc/index.js +3 -3
- package/dist/plugins/stylelint/index.js +3 -3
- package/dist/plugins/travis/index.js +4 -4
- package/dist/plugins/vitest/index.js +2 -6
- package/dist/reporters/symbols.js +2 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +2 -2
package/dist/constants.js
CHANGED
|
@@ -7,9 +7,9 @@ const enablers = ['@linthtml/linthtml'];
|
|
|
7
7
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
8
8
|
const config = ['package.json', ...toCosmiconfig('linthtml')];
|
|
9
9
|
const resolveConfig = config => {
|
|
10
|
-
const extensions =
|
|
11
|
-
const plugins =
|
|
12
|
-
return [
|
|
10
|
+
const extensions = config.extends ?? [];
|
|
11
|
+
const plugins = config.plugins ?? [];
|
|
12
|
+
return [extensions, plugins].flat().map(toDeferResolve);
|
|
13
13
|
};
|
|
14
14
|
export default {
|
|
15
15
|
title,
|
|
@@ -5,9 +5,9 @@ const enablers = ['nyc'];
|
|
|
5
5
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
6
6
|
const config = ['.nycrc', '.nycrc.json', '.nycrc.{yml,yaml}', 'nyc.config.js', 'package.json'];
|
|
7
7
|
const resolveConfig = config => {
|
|
8
|
-
const extend = config?.extends
|
|
9
|
-
const requires = config?.require
|
|
10
|
-
return [
|
|
8
|
+
const extend = config?.extends ?? [];
|
|
9
|
+
const requires = config?.require ?? [];
|
|
10
|
+
return [extend, requires].flat().map(toDeferResolve);
|
|
11
11
|
};
|
|
12
12
|
export default {
|
|
13
13
|
title,
|
|
@@ -6,11 +6,11 @@ const enablers = ['stylelint'];
|
|
|
6
6
|
const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
|
|
7
7
|
const config = ['package.json', ...toCosmiconfig('stylelint')];
|
|
8
8
|
const resolve = (config) => {
|
|
9
|
-
const extend = config.extends
|
|
10
|
-
const plugins = config.plugins
|
|
9
|
+
const extend = config.extends ?? [];
|
|
10
|
+
const plugins = config.plugins ?? [];
|
|
11
11
|
const customSyntax = config.customSyntax ? [config.customSyntax] : [];
|
|
12
12
|
const overrideConfigs = 'overrides' in config ? config.overrides.flatMap(resolve) : [];
|
|
13
|
-
return [...[
|
|
13
|
+
return [...[extend, plugins, customSyntax].flat().map(toDeferResolve), ...overrideConfigs];
|
|
14
14
|
};
|
|
15
15
|
const resolveConfig = config => resolve(config);
|
|
16
16
|
export default {
|
|
@@ -6,10 +6,10 @@ const config = ['.travis.yml'];
|
|
|
6
6
|
const resolveConfig = async (config, options) => {
|
|
7
7
|
if (!config)
|
|
8
8
|
return [];
|
|
9
|
-
const beforeDeploy =
|
|
10
|
-
const beforeInstall =
|
|
11
|
-
const beforeScript =
|
|
12
|
-
const scripts = [
|
|
9
|
+
const beforeDeploy = config.before_deploy ?? [];
|
|
10
|
+
const beforeInstall = config.before_install ?? [];
|
|
11
|
+
const beforeScript = config.before_script ?? [];
|
|
12
|
+
const scripts = [beforeDeploy, beforeInstall, beforeScript].flat();
|
|
13
13
|
return options.getInputsFromScripts(scripts, { knownBinsOnly: true });
|
|
14
14
|
};
|
|
15
15
|
export default {
|
|
@@ -23,12 +23,8 @@ const findConfigDependencies = (localConfig, options) => {
|
|
|
23
23
|
const hasCoverageEnabled = (testConfig.coverage && testConfig.coverage.enabled !== false) || hasScriptWithCoverage(manifest.scripts);
|
|
24
24
|
const coverage = hasCoverageEnabled ? [`@vitest/coverage-${testConfig.coverage?.provider ?? 'v8'}`] : [];
|
|
25
25
|
const dir = join(configFileDir, testConfig.root ?? '.');
|
|
26
|
-
const setupFiles = [testConfig.setupFiles ?? []].flat().map(specifier => {
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
-
const globalSetup = [testConfig.globalSetup ?? []].flat().map(specifier => {
|
|
30
|
-
return { ...toDeferResolve(specifier), dir };
|
|
31
|
-
});
|
|
26
|
+
const setupFiles = [testConfig.setupFiles ?? []].flat().map(specifier => ({ ...toDeferResolve(specifier), dir }));
|
|
27
|
+
const globalSetup = [testConfig.globalSetup ?? []].flat().map(specifier => ({ ...toDeferResolve(specifier), dir }));
|
|
32
28
|
return [...[...environments, ...reporters, ...coverage].map(toDependency), ...setupFiles, ...globalSetup];
|
|
33
29
|
};
|
|
34
30
|
const getConfigs = async (localConfig) => {
|
|
@@ -42,7 +42,8 @@ export default ({ report, issues, tagHints, configurationHints, noConfigHints, i
|
|
|
42
42
|
const issuesForType = Array.from(issues._files);
|
|
43
43
|
if (issuesForType.length > 0) {
|
|
44
44
|
title && logTitle(title, issuesForType.length);
|
|
45
|
-
|
|
45
|
+
const sortedIssues = issuesForType.sort((a, b) => a.filePath.localeCompare(b.filePath));
|
|
46
|
+
for (const issue of sortedIssues) {
|
|
46
47
|
const relPath = toRelative(issue.filePath);
|
|
47
48
|
if (issue.isFixed)
|
|
48
49
|
console.log(dim(`${relPath} (removed)`));
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "5.34.
|
|
1
|
+
export declare const version = "5.34.4";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '5.34.
|
|
1
|
+
export const version = '5.34.4';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "5.34.
|
|
3
|
+
"version": "5.34.4",
|
|
4
4
|
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
|
|
5
5
|
"homepage": "https://knip.dev",
|
|
6
6
|
"repository": {
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"jiti": "^2.3.3",
|
|
67
67
|
"js-yaml": "^4.1.0",
|
|
68
68
|
"minimist": "^1.2.8",
|
|
69
|
-
"picocolors": "^1.
|
|
69
|
+
"picocolors": "^1.1.0",
|
|
70
70
|
"picomatch": "^4.0.1",
|
|
71
71
|
"pretty-ms": "^9.0.0",
|
|
72
72
|
"smol-toml": "^1.3.0",
|