knip 2.31.0 → 2.32.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 (100) hide show
  1. package/README.md +15 -24
  2. package/dist/ConfigurationValidator.d.ts +56 -0
  3. package/dist/ConfigurationValidator.js +1 -0
  4. package/dist/WorkspaceWorker.d.ts +8 -6
  5. package/dist/WorkspaceWorker.js +33 -59
  6. package/dist/binaries/index.js +1 -1
  7. package/dist/binaries/resolvers/c8.js +2 -1
  8. package/dist/binaries/resolvers/dotenv.js +2 -1
  9. package/dist/binaries/resolvers/fallback.js +2 -1
  10. package/dist/binaries/resolvers/nodemon.js +2 -1
  11. package/dist/binaries/resolvers/npx.js +2 -1
  12. package/dist/binaries/resolvers/nx.js +1 -1
  13. package/dist/binaries/resolvers/pnpm.js +1 -1
  14. package/dist/binaries/resolvers/rollup.js +2 -1
  15. package/dist/binaries/resolvers/yarn.js +1 -1
  16. package/dist/binaries/util.d.ts +0 -3
  17. package/dist/binaries/util.js +1 -3
  18. package/dist/constants.d.ts +0 -1
  19. package/dist/constants.js +0 -4
  20. package/dist/index.js +19 -18
  21. package/dist/plugins/ava/index.d.ts +1 -1
  22. package/dist/plugins/ava/index.js +23 -5
  23. package/dist/plugins/ava/types.d.ts +1 -0
  24. package/dist/plugins/babel/index.js +3 -1
  25. package/dist/plugins/capacitor/index.js +3 -1
  26. package/dist/plugins/changesets/index.js +3 -1
  27. package/dist/plugins/commitizen/index.d.ts +1 -0
  28. package/dist/plugins/commitizen/index.js +4 -1
  29. package/dist/plugins/commitlint/index.js +3 -1
  30. package/dist/plugins/cspell/index.js +3 -1
  31. package/dist/plugins/cypress/index.d.ts +3 -1
  32. package/dist/plugins/cypress/index.js +14 -4
  33. package/dist/plugins/drizzle/index.js +3 -5
  34. package/dist/plugins/eslint/helpers.js +2 -1
  35. package/dist/plugins/eslint/index.d.ts +1 -0
  36. package/dist/plugins/eslint/index.js +4 -1
  37. package/dist/plugins/gatsby/index.js +10 -2
  38. package/dist/plugins/github-actions/index.js +3 -1
  39. package/dist/plugins/husky/index.js +3 -1
  40. package/dist/plugins/index.d.ts +1 -0
  41. package/dist/plugins/index.js +1 -0
  42. package/dist/plugins/jest/index.d.ts +1 -1
  43. package/dist/plugins/jest/index.js +16 -7
  44. package/dist/plugins/lefthook/index.js +4 -2
  45. package/dist/plugins/lint-staged/index.d.ts +1 -0
  46. package/dist/plugins/lint-staged/index.js +4 -1
  47. package/dist/plugins/markdownlint/index.js +3 -1
  48. package/dist/plugins/mocha/index.d.ts +1 -0
  49. package/dist/plugins/mocha/index.js +10 -6
  50. package/dist/plugins/next/index.d.ts +2 -1
  51. package/dist/plugins/next/index.js +4 -0
  52. package/dist/plugins/node-test-runner/index.d.ts +6 -0
  53. package/dist/plugins/node-test-runner/index.js +17 -0
  54. package/dist/plugins/npm-package-json-lint/index.d.ts +1 -0
  55. package/dist/plugins/npm-package-json-lint/index.js +5 -2
  56. package/dist/plugins/nx/index.js +3 -1
  57. package/dist/plugins/nyc/index.js +3 -1
  58. package/dist/plugins/playwright/index.d.ts +3 -1
  59. package/dist/plugins/playwright/index.js +22 -2
  60. package/dist/plugins/playwright-ct/index.d.ts +3 -1
  61. package/dist/plugins/playwright-ct/index.js +13 -2
  62. package/dist/plugins/postcss/index.js +8 -6
  63. package/dist/plugins/prettier/index.js +3 -1
  64. package/dist/plugins/release-it/index.d.ts +1 -0
  65. package/dist/plugins/release-it/index.js +5 -2
  66. package/dist/plugins/remark/index.d.ts +1 -0
  67. package/dist/plugins/remark/index.js +10 -3
  68. package/dist/plugins/remix/index.d.ts +2 -1
  69. package/dist/plugins/remix/index.js +10 -0
  70. package/dist/plugins/rollup/index.d.ts +2 -1
  71. package/dist/plugins/rollup/index.js +7 -0
  72. package/dist/plugins/semantic-release/index.d.ts +1 -0
  73. package/dist/plugins/semantic-release/index.js +7 -2
  74. package/dist/plugins/sentry/index.d.ts +2 -1
  75. package/dist/plugins/sentry/index.js +7 -0
  76. package/dist/plugins/storybook/index.js +6 -2
  77. package/dist/plugins/stryker/index.js +9 -8
  78. package/dist/plugins/stylelint/index.js +3 -1
  79. package/dist/plugins/svelte/index.d.ts +2 -1
  80. package/dist/plugins/svelte/index.js +6 -0
  81. package/dist/plugins/typedoc/index.d.ts +1 -0
  82. package/dist/plugins/typedoc/index.js +5 -2
  83. package/dist/plugins/typescript/index.js +3 -1
  84. package/dist/plugins/vite/index.js +2 -2
  85. package/dist/plugins/vitest/index.d.ts +3 -3
  86. package/dist/plugins/vitest/index.js +16 -23
  87. package/dist/plugins/vitest/types.d.ts +1 -0
  88. package/dist/plugins/webpack/index.js +3 -1
  89. package/dist/types/config.d.ts +3 -2
  90. package/dist/types/plugins.d.ts +3 -3
  91. package/dist/util/compilers.d.ts +10 -0
  92. package/dist/util/object.d.ts +1 -0
  93. package/dist/util/object.js +1 -0
  94. package/dist/util/plugin.d.ts +1 -1
  95. package/dist/util/protocols.d.ts +9 -0
  96. package/dist/util/protocols.js +9 -0
  97. package/dist/version.d.ts +1 -1
  98. package/dist/version.js +1 -1
  99. package/package.json +2 -1
  100. package/schema.json +4 -0
@@ -117,6 +117,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
117
117
  entry?: string | string[] | undefined;
118
118
  project?: string | string[] | undefined;
119
119
  } | undefined;
120
+ 'node-test-runner'?: string | boolean | string[] | {
121
+ config?: string | string[] | undefined;
122
+ entry?: string | string[] | undefined;
123
+ project?: string | string[] | undefined;
124
+ } | undefined;
120
125
  'npm-package-json-lint'?: string | boolean | string[] | {
121
126
  config?: string | string[] | undefined;
122
127
  entry?: string | string[] | undefined;
@@ -318,6 +323,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
318
323
  entry?: string | string[] | undefined;
319
324
  project?: string | string[] | undefined;
320
325
  } | undefined;
326
+ 'node-test-runner'?: string | boolean | string[] | {
327
+ config?: string | string[] | undefined;
328
+ entry?: string | string[] | undefined;
329
+ project?: string | string[] | undefined;
330
+ } | undefined;
321
331
  'npm-package-json-lint'?: string | boolean | string[] | {
322
332
  config?: string | string[] | undefined;
323
333
  entry?: string | string[] | undefined;
@@ -1,3 +1,4 @@
1
1
  export declare const getValuesByKeyDeep: (obj: any, key: string) => unknown[];
2
2
  export declare const getStringValues: (obj: any) => string[];
3
3
  export declare const getKeysByValue: <T>(obj: T, value: unknown) => (keyof T)[];
4
+ export declare const get: (obj: unknown, path: string) => unknown;
@@ -35,3 +35,4 @@ export const getKeysByValue = (obj, value) => {
35
35
  }
36
36
  return keys;
37
37
  };
38
+ export const get = (obj, path) => path.split('.').reduce((o, p) => o && o[p], obj);
@@ -1,5 +1,5 @@
1
1
  export { _load as load } from './loader.js';
2
- import type { RawPluginConfiguration } from 'src/types/config.js';
2
+ import type { RawPluginConfiguration } from '../types/config.js';
3
3
  export declare const toCamelCase: (name: string) => string;
4
4
  export declare const hasDependency: (dependencies: Set<string>, values: (string | RegExp)[]) => boolean;
5
5
  export declare const normalizePluginConfig: (pluginConfig: RawPluginConfiguration) => boolean | {
@@ -0,0 +1,9 @@
1
+ export declare const toBinary: (specifier: string) => string;
2
+ export declare const fromBinary: (specifier: string) => string;
3
+ export declare const isBinary: (specifier: string) => boolean;
4
+ export declare const toEntryPattern: (specifier: string) => string;
5
+ export declare const fromEntryPattern: (specifier: string) => string;
6
+ export declare const isEntryPattern: (specifier: string) => boolean;
7
+ export declare const toProductionEntryPattern: (specifier: string) => string;
8
+ export declare const fromProductionEntryPattern: (specifier: string) => string;
9
+ export declare const isProductionEntryPattern: (specifier: string) => boolean;
@@ -0,0 +1,9 @@
1
+ export const toBinary = (specifier) => specifier.replace(/^(bin:)?/, 'bin:');
2
+ export const fromBinary = (specifier) => specifier.replace(/^(bin:)?/, '');
3
+ export const isBinary = (specifier) => specifier.startsWith('bin:');
4
+ export const toEntryPattern = (specifier) => specifier.replace(/^(entry:)?/, 'entry:');
5
+ export const fromEntryPattern = (specifier) => specifier.replace(/^(entry:)?/, '');
6
+ export const isEntryPattern = (specifier) => specifier.startsWith('entry:');
7
+ export const toProductionEntryPattern = (specifier) => specifier.replace(/^(production:)?/, 'production:');
8
+ export const fromProductionEntryPattern = (specifier) => specifier.replace(/^(production:)?/, '');
9
+ export const isProductionEntryPattern = (specifier) => specifier.startsWith('production:');
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "2.31.0";
1
+ export declare const version = "2.32.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '2.31.0';
1
+ export const version = '2.32.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "2.31.0",
3
+ "version": "2.32.0",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://github.com/webpro/knip",
6
6
  "repository": "github:webpro/knip",
@@ -80,6 +80,7 @@
80
80
  "eslint-import-resolver-typescript": "3.6.1",
81
81
  "eslint-plugin-import": "2.28.1",
82
82
  "eslint-plugin-n": "16.1.0",
83
+ "playwright": "1.38.1",
83
84
  "prettier": "3.0.3",
84
85
  "release-it": "16.2.1",
85
86
  "remark-cli": "12.0.0",
package/schema.json CHANGED
@@ -300,6 +300,10 @@
300
300
  "title": "Next.js plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/main/README.md)",
301
301
  "$ref": "#/definitions/plugin"
302
302
  },
303
+ "node-test-runner": {
304
+ "title": "node-test-runner plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/node-test-runner/README.md)",
305
+ "$ref": "#/definitions/plugin"
306
+ },
303
307
  "npm-package-json-lint": {
304
308
  "title": "npm-package-json-lint plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/npm-package-json-lint/README.md)",
305
309
  "$ref": "#/definitions/plugin"