knip 6.32.0 → 6.32.2

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.
@@ -223,7 +223,6 @@ export class WorkspaceWorker {
223
223
  const hasProductionInput = (input) => productionInputsFromManifest.find(d => d.specifier === input.specifier && d.type === input.type);
224
224
  const createGetInputsFromScripts = (containingFilePath) => (scripts, options) => _getInputsFromScripts(scripts, { ...baseOptions, ...options, containingFilePath });
225
225
  const inputs = [];
226
- const enabledPlugins = new Set(this.enabledPlugins);
227
226
  const configFilesMap = this.configFilesMap;
228
227
  const seen = new Map();
229
228
  const parsedConfigCache = new Map();
@@ -434,21 +433,20 @@ export class WorkspaceWorker {
434
433
  break;
435
434
  const [pluginName, dependencies] = entry;
436
435
  configFiles.delete(pluginName);
437
- if (enabledPlugins.has(pluginName)) {
438
- const seenConfigFiles = getSeenConfigFiles(pluginName);
439
- const unprocessed = [];
440
- for (const filePath of dependencies) {
441
- if (!seenConfigFiles.has(filePath))
442
- unprocessed.push(filePath);
443
- }
444
- if (unprocessed.length > 0) {
445
- for (const input of await runPlugin(pluginName, unprocessed, true))
446
- inputs.push(input);
447
- }
448
- }
449
- else {
436
+ if (this.config[pluginName] === false) {
450
437
  for (const id of dependencies)
451
438
  inputs.push(toEntry(id));
439
+ continue;
440
+ }
441
+ const seenConfigFiles = getSeenConfigFiles(pluginName);
442
+ const unprocessed = [];
443
+ for (const filePath of dependencies) {
444
+ if (!seenConfigFiles.has(filePath))
445
+ unprocessed.push(filePath);
446
+ }
447
+ if (unprocessed.length > 0) {
448
+ for (const input of await runPlugin(pluginName, unprocessed, true))
449
+ inputs.push(input);
452
450
  }
453
451
  }
454
452
  }
@@ -1,4 +1,4 @@
1
- import { toAlias, toDependency, toEntry, toIgnore, toProductionEntry } from '../../util/input.js';
1
+ import { toAlias, toConfig, toDependency, toIgnore, toProductionEntry } from '../../util/input.js';
2
2
  import { join } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import { CORE_CLIENT_API, resolveConfigItems } from './helpers.js';
@@ -7,7 +7,7 @@ const enablers = ['@docusaurus/core'];
7
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
8
  const config = ['docusaurus.config.{js,cjs,mjs,ts,cts,mts}'];
9
9
  const production = ['src/pages/**/*.{js,ts,jsx,tsx}', '{blog,docs}/**/*.mdx', 'versioned_docs/**/*.{mdx,jsx,tsx}'];
10
- const entry = ['babel.config.{js,cjs,mjs,cts}'];
10
+ const resolve = () => [toConfig('babel', 'babel.config')];
11
11
  const resolveStaticAssets = (items, cwd) => {
12
12
  const entries = [];
13
13
  for (const item of items ?? []) {
@@ -33,7 +33,6 @@ const resolveConfig = async (config, options) => {
33
33
  toIgnore('@generated/.*', 'dependencies'),
34
34
  ...(config.future?.experimental_faster ? [toDependency('@docusaurus/faster')] : []),
35
35
  ...production.map(id => toProductionEntry(id)),
36
- ...entry.map(id => toEntry(id)),
37
36
  ...themes,
38
37
  ...plugins,
39
38
  ...presets,
@@ -46,8 +45,8 @@ const plugin = {
46
45
  enablers,
47
46
  isEnabled,
48
47
  config,
49
- entry,
50
48
  production,
49
+ resolve,
51
50
  resolveConfig,
52
51
  };
53
52
  export default plugin;
@@ -1,4 +1,4 @@
1
- import { toProductionEntry } from '../../util/input.js';
1
+ import { toConfig, toIgnore, toProductionEntry } from '../../util/input.js';
2
2
  import { join } from '../../util/path.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  import { getConfig, getDependencies } from './helpers.js';
@@ -7,6 +7,7 @@ const enablers = ['expo'];
7
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
8
  const config = ['app.json', 'app.config.{ts,js}'];
9
9
  const production = ['app/**/*.{js,jsx,ts,tsx}', 'src/app/**/*.{js,jsx,ts,tsx}'];
10
+ const resolve = () => [toConfig('babel', 'babel.config'), toIgnore('babel-preset-expo', 'unresolved')];
10
11
  const resolveConfig = async (localConfig, options) => {
11
12
  const { manifest } = options;
12
13
  const config = getConfig(localConfig, options);
@@ -30,6 +31,7 @@ const plugin = {
30
31
  isEnabled,
31
32
  config,
32
33
  production,
34
+ resolve,
33
35
  resolveConfig,
34
36
  };
35
37
  export default plugin;
@@ -1,14 +1,12 @@
1
1
  import { hasDependency } from '../../util/plugin.js';
2
- import { toLilconfig } from '../../util/plugin-config.js';
3
2
  const title = 'lint-staged';
4
3
  const enablers = ['lint-staged'];
5
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
5
  const config = [
7
- 'package.json',
8
- 'package.yaml',
9
- 'package.yml',
10
- ...toLilconfig('lint-staged'),
11
- ...toLilconfig('lintstaged'),
6
+ 'package.{json,yaml,yml}',
7
+ '.lintstagedrc',
8
+ '.lintstagedrc.{json,yaml,yml,mjs,mts,js,ts,cjs,cts}',
9
+ 'lint-staged.config.{mjs,mts,js,ts,cjs,cts}',
12
10
  ];
13
11
  const resolveEntry = async (value) => {
14
12
  if (Array.isArray(value))
@@ -2,7 +2,7 @@ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Oxfmt';
3
3
  const enablers = ['oxfmt'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['.oxfmtrc.json', '.oxfmtrc.jsonc', 'oxfmt.config.ts'];
5
+ const config = ['.oxfmtrc.json', '.oxfmtrc.jsonc', 'oxfmt.config.{ts,mts}'];
6
6
  const args = {
7
7
  config: true,
8
8
  };
@@ -6,7 +6,7 @@ import { hasDependency } from '../../util/plugin.js';
6
6
  const title = 'Oxlint';
7
7
  const enablers = ['oxlint', 'vite-plus'];
8
8
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
9
- const config = ['.oxlintrc.json', 'oxlint.config.ts', 'vite.config.{js,mjs,ts,cjs,mts,cts}'];
9
+ const config = ['.oxlintrc.json', 'oxlint.config.{ts,mts}', 'vite.config.{js,mjs,ts,cjs,mts,cts}'];
10
10
  const isViteConfig = (configFileName) => configFileName.startsWith('vite.config.');
11
11
  const args = {
12
12
  config: true,
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "6.32.0";
1
+ export declare const version = "6.32.2";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '6.32.0';
1
+ export const version = '6.32.2';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "6.32.0",
3
+ "version": "6.32.2",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "keywords": [
6
6
  "analysis",
@@ -81,13 +81,13 @@
81
81
  "formatly": "^0.3.0",
82
82
  "get-tsconfig": "4.14.1",
83
83
  "jiti": "^2.7.0",
84
- "oxc-parser": "^0.142.0",
84
+ "oxc-parser": "^0.143.0",
85
85
  "oxc-resolver": "11.24.2",
86
86
  "picomatch": "^4.0.5",
87
87
  "smol-toml": "^1.7.1",
88
88
  "strip-json-comments": "5.0.3",
89
89
  "tinyglobby": "^0.2.17",
90
- "unbash": "^4.0.4",
90
+ "unbash": "^4.0.9",
91
91
  "yaml": "^2.9.0",
92
92
  "zod": "^4.4.3"
93
93
  },
@@ -98,7 +98,7 @@
98
98
  "@types/webpack": "^5.28.5",
99
99
  "codeclimate-types": "^0.3.1",
100
100
  "prettier": "^3.9.6",
101
- "tsx": "^4.23.5",
101
+ "tsx": "^4.23.11",
102
102
  "typescript": "7.0.2"
103
103
  },
104
104
  "engines": {