knip 5.15.1 → 5.16.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.
@@ -128,6 +128,7 @@ export declare class ConfigurationChief {
128
128
  githubActions?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
129
129
  graphqlCodegen?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
130
130
  lintStaged?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
131
+ lostPixel?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
131
132
  nodeTestRunner?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
132
133
  npmPackageJsonLint?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
133
134
  playwrightCt?: (boolean | import("./types/config.js").EnsuredPluginConfiguration) | undefined;
@@ -314,6 +314,19 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
314
314
  entry?: string | string[] | undefined;
315
315
  project?: string | string[] | undefined;
316
316
  }>]>>;
317
+ 'lost-pixel': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
318
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
319
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
320
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
321
+ }, "strip", z.ZodTypeAny, {
322
+ config?: string | string[] | undefined;
323
+ entry?: string | string[] | undefined;
324
+ project?: string | string[] | undefined;
325
+ }, {
326
+ config?: string | string[] | undefined;
327
+ entry?: string | string[] | undefined;
328
+ project?: string | string[] | undefined;
329
+ }>]>>;
317
330
  markdownlint: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
318
331
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
319
332
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -948,6 +961,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
948
961
  entry?: string | string[] | undefined;
949
962
  project?: string | string[] | undefined;
950
963
  } | undefined;
964
+ 'lost-pixel'?: string | boolean | string[] | {
965
+ config?: string | string[] | undefined;
966
+ entry?: string | string[] | undefined;
967
+ project?: string | string[] | undefined;
968
+ } | undefined;
951
969
  markdownlint?: string | boolean | string[] | {
952
970
  config?: string | string[] | undefined;
953
971
  entry?: string | string[] | undefined;
@@ -1262,6 +1280,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
1262
1280
  entry?: string | string[] | undefined;
1263
1281
  project?: string | string[] | undefined;
1264
1282
  } | undefined;
1283
+ 'lost-pixel'?: string | boolean | string[] | {
1284
+ config?: string | string[] | undefined;
1285
+ entry?: string | string[] | undefined;
1286
+ project?: string | string[] | undefined;
1287
+ } | undefined;
1265
1288
  markdownlint?: string | boolean | string[] | {
1266
1289
  config?: string | string[] | undefined;
1267
1290
  entry?: string | string[] | undefined;
@@ -1737,6 +1760,19 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
1737
1760
  entry?: string | string[] | undefined;
1738
1761
  project?: string | string[] | undefined;
1739
1762
  }>]>>;
1763
+ 'lost-pixel': z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1764
+ config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1765
+ entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1766
+ project: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1767
+ }, "strip", z.ZodTypeAny, {
1768
+ config?: string | string[] | undefined;
1769
+ entry?: string | string[] | undefined;
1770
+ project?: string | string[] | undefined;
1771
+ }, {
1772
+ config?: string | string[] | undefined;
1773
+ entry?: string | string[] | undefined;
1774
+ project?: string | string[] | undefined;
1775
+ }>]>>;
1740
1776
  markdownlint: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>, z.ZodObject<{
1741
1777
  config: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
1742
1778
  entry: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>;
@@ -2379,6 +2415,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
2379
2415
  entry?: string | string[] | undefined;
2380
2416
  project?: string | string[] | undefined;
2381
2417
  } | undefined;
2418
+ 'lost-pixel'?: string | boolean | string[] | {
2419
+ config?: string | string[] | undefined;
2420
+ entry?: string | string[] | undefined;
2421
+ project?: string | string[] | undefined;
2422
+ } | undefined;
2382
2423
  markdownlint?: string | boolean | string[] | {
2383
2424
  config?: string | string[] | undefined;
2384
2425
  entry?: string | string[] | undefined;
@@ -2693,6 +2734,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
2693
2734
  entry?: string | string[] | undefined;
2694
2735
  project?: string | string[] | undefined;
2695
2736
  } | undefined;
2737
+ 'lost-pixel'?: string | boolean | string[] | {
2738
+ config?: string | string[] | undefined;
2739
+ entry?: string | string[] | undefined;
2740
+ project?: string | string[] | undefined;
2741
+ } | undefined;
2696
2742
  markdownlint?: string | boolean | string[] | {
2697
2743
  config?: string | string[] | undefined;
2698
2744
  entry?: string | string[] | undefined;
@@ -3016,6 +3062,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
3016
3062
  entry?: string | string[] | undefined;
3017
3063
  project?: string | string[] | undefined;
3018
3064
  } | undefined;
3065
+ 'lost-pixel'?: string | boolean | string[] | {
3066
+ config?: string | string[] | undefined;
3067
+ entry?: string | string[] | undefined;
3068
+ project?: string | string[] | undefined;
3069
+ } | undefined;
3019
3070
  markdownlint?: string | boolean | string[] | {
3020
3071
  config?: string | string[] | undefined;
3021
3072
  entry?: string | string[] | undefined;
@@ -3330,6 +3381,11 @@ export declare const ConfigurationValidator: z.ZodObject<z.objectUtil.extendShap
3330
3381
  entry?: string | string[] | undefined;
3331
3382
  project?: string | string[] | undefined;
3332
3383
  } | undefined;
3384
+ 'lost-pixel'?: string | boolean | string[] | {
3385
+ config?: string | string[] | undefined;
3386
+ entry?: string | string[] | undefined;
3387
+ project?: string | string[] | undefined;
3388
+ } | undefined;
3333
3389
  markdownlint?: string | boolean | string[] | {
3334
3390
  config?: string | string[] | undefined;
3335
3391
  entry?: string | string[] | undefined;
@@ -84,6 +84,7 @@ const pluginsSchema = z.object({
84
84
  lefthook: pluginSchema,
85
85
  'lint-staged': pluginSchema,
86
86
  linthtml: pluginSchema,
87
+ 'lost-pixel': pluginSchema,
87
88
  markdownlint: pluginSchema,
88
89
  mocha: pluginSchema,
89
90
  moonrepo: pluginSchema,
@@ -28,7 +28,7 @@ export declare class WorkspaceWorker {
28
28
  isStrict: boolean;
29
29
  rootIgnore: Configuration['ignore'];
30
30
  negatedWorkspacePatterns: string[];
31
- enabledPluginsMap: Record<"astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", boolean>;
31
+ enabledPluginsMap: Record<"astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "lostPixel" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", boolean>;
32
32
  enabledPlugins: PluginName[];
33
33
  enabledPluginsInAncestors: string[];
34
34
  cache: CacheConsultant<unknown>;
@@ -48,7 +48,7 @@ export declare class WorkspaceWorker {
48
48
  entryFilePatterns: Set<string>;
49
49
  productionEntryFilePatterns: Set<string>;
50
50
  referencedDependencies: ReferencedDependencies;
51
- enabledPlugins: ("astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg")[];
51
+ enabledPlugins: ("astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "lostPixel" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg")[];
52
52
  }>;
53
53
  onDispose(): void;
54
54
  }
@@ -123,6 +123,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
123
123
  entry?: string | string[] | undefined;
124
124
  project?: string | string[] | undefined;
125
125
  } | undefined;
126
+ 'lost-pixel'?: string | boolean | string[] | {
127
+ config?: string | string[] | undefined;
128
+ entry?: string | string[] | undefined;
129
+ project?: string | string[] | undefined;
130
+ } | undefined;
126
131
  markdownlint?: string | boolean | string[] | {
127
132
  config?: string | string[] | undefined;
128
133
  entry?: string | string[] | undefined;
@@ -437,6 +442,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
437
442
  entry?: string | string[] | undefined;
438
443
  project?: string | string[] | undefined;
439
444
  } | undefined;
445
+ 'lost-pixel'?: string | boolean | string[] | {
446
+ config?: string | string[] | undefined;
447
+ entry?: string | string[] | undefined;
448
+ project?: string | string[] | undefined;
449
+ } | undefined;
440
450
  markdownlint?: string | boolean | string[] | {
441
451
  config?: string | string[] | undefined;
442
452
  entry?: string | string[] | undefined;
@@ -8,7 +8,7 @@ const config = [
8
8
  'commitlint.config.{js,cjs,ts,cts}',
9
9
  'package.json',
10
10
  ];
11
- const resolveConfig = config => {
11
+ const resolveConfig = async (config) => {
12
12
  const extendsConfigs = config.extends
13
13
  ? [config.extends]
14
14
  .flat()
@@ -16,8 +16,15 @@ const resolveConfig = config => {
16
16
  : [];
17
17
  const plugins = config.plugins ? [config.plugins].flat().filter(s => typeof s === 'string') : [];
18
18
  const formatter = config.formatter ? [config.formatter] : [];
19
- const parserPreset = config.parserPreset ? [config.parserPreset] : [];
20
- return [...extendsConfigs, ...plugins, ...formatter, ...parserPreset];
19
+ const parserPreset = await config.parserPreset;
20
+ const parserPresetPaths = parserPreset
21
+ ? typeof parserPreset === 'string'
22
+ ? [parserPreset]
23
+ : parserPreset.path
24
+ ? [parserPreset.path ?? parserPreset]
25
+ : []
26
+ : [];
27
+ return [...extendsConfigs, ...plugins, ...formatter, ...parserPresetPaths];
21
28
  };
22
29
  export default {
23
30
  title,
@@ -2,5 +2,11 @@ export type CommitLintConfig = {
2
2
  extends?: string | string[];
3
3
  plugins?: string[];
4
4
  formatter?: string;
5
- parserPreset?: string;
5
+ parserPreset?: string | ParserPreset | Promise<ParserPreset>;
6
6
  };
7
+ type ParserPreset = {
8
+ name?: string;
9
+ path?: string;
10
+ parserOpts?: unknown;
11
+ };
12
+ export {};
@@ -20,6 +20,7 @@ export { default as jest } from './jest/index.js';
20
20
  export { default as lefthook } from './lefthook/index.js';
21
21
  export { default as lintStaged } from './lint-staged/index.js';
22
22
  export { default as linthtml } from './linthtml/index.js';
23
+ export { default as lostPixel } from './lost-pixel/index.js';
23
24
  export { default as markdownlint } from './markdownlint/index.js';
24
25
  export { default as mocha } from './mocha/index.js';
25
26
  export { default as moonrepo } from './moonrepo/index.js';
@@ -20,6 +20,7 @@ export { default as jest } from './jest/index.js';
20
20
  export { default as lefthook } from './lefthook/index.js';
21
21
  export { default as lintStaged } from './lint-staged/index.js';
22
22
  export { default as linthtml } from './linthtml/index.js';
23
+ export { default as lostPixel } from './lost-pixel/index.js';
23
24
  export { default as markdownlint } from './markdownlint/index.js';
24
25
  export { default as mocha } from './mocha/index.js';
25
26
  export { default as moonrepo } from './moonrepo/index.js';
@@ -0,0 +1,8 @@
1
+ import type { IsPluginEnabled } from '#p/types/plugins.js';
2
+ declare const _default: {
3
+ title: string;
4
+ enablers: import("#p/types/config.js").IgnorePatterns;
5
+ isEnabled: IsPluginEnabled;
6
+ config: string[];
7
+ };
8
+ export default _default;
@@ -0,0 +1,11 @@
1
+ import { hasDependency } from '#p/util/plugin.js';
2
+ const title = 'Lost Pixel';
3
+ const enablers = ['lost-pixel'];
4
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
+ const config = ['lostpixel.config.{js,ts}'];
6
+ export default {
7
+ title,
8
+ enablers,
9
+ isEnabled,
10
+ config,
11
+ };
package/dist/plugins.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  import type { Plugin } from './types/plugins.js';
2
- declare const plugins: Record<"astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", Plugin>;
2
+ declare const plugins: Record<"astro" | "angular" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cucumber" | "cypress" | "eleventy" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "linthtml" | "markdownlint" | "mocha" | "moonrepo" | "msw" | "netlify" | "next" | "nx" | "nyc" | "oclif" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "stylelint" | "svelte" | "syncpack" | "tailwind" | "tsup" | "typedoc" | "typescript" | "unbuild" | "vue" | "vite" | "vitest" | "webpack" | "wireit" | "wrangler" | "xo" | "yorkie" | "drizzle" | "githubActions" | "graphqlCodegen" | "lintStaged" | "lostPixel" | "nodeTestRunner" | "npmPackageJsonLint" | "playwrightCt" | "releaseIt" | "semanticRelease" | "vercelOg", Plugin>;
3
3
  export { plugins };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.15.1";
1
+ export declare const version = "5.16.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.15.1';
1
+ export const version = '5.16.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.15.1",
3
+ "version": "5.16.0",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {
package/schema.json CHANGED
@@ -359,6 +359,10 @@
359
359
  "title": "linthtml plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/linthtml/README.md)",
360
360
  "$ref": "#/definitions/plugin"
361
361
  },
362
+ "lost-pixel": {
363
+ "title": "lost-pixel plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/lost-pixel/README.md)",
364
+ "$ref": "#/definitions/plugin"
365
+ },
362
366
  "markdownlint": {
363
367
  "title": "markdownlint plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/markdownlint/README.md)",
364
368
  "$ref": "#/definitions/plugin"