knip 6.30.0 → 6.31.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.
@@ -352,6 +352,11 @@ export declare class ConfigurationChief {
352
352
  entry?: string | string[] | undefined;
353
353
  project?: string | string[] | undefined;
354
354
  } | undefined;
355
+ marko?: string | boolean | string[] | {
356
+ config?: string | string[] | undefined;
357
+ entry?: string | string[] | undefined;
358
+ project?: string | string[] | undefined;
359
+ } | undefined;
355
360
  mdx?: string | boolean | string[] | {
356
361
  config?: string | string[] | undefined;
357
362
  entry?: string | string[] | undefined;
@@ -1033,6 +1038,7 @@ export declare class ConfigurationChief {
1033
1038
  "lost-pixel"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1034
1039
  lunaria?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1035
1040
  markdownlint?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1041
+ marko?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1036
1042
  mdx?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1037
1043
  mdxlint?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1038
1044
  metro?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
@@ -298,6 +298,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
298
298
  entry?: string | string[] | undefined;
299
299
  project?: string | string[] | undefined;
300
300
  } | undefined;
301
+ marko?: string | boolean | string[] | {
302
+ config?: string | string[] | undefined;
303
+ entry?: string | string[] | undefined;
304
+ project?: string | string[] | undefined;
305
+ } | undefined;
301
306
  mdx?: string | boolean | string[] | {
302
307
  config?: string | string[] | undefined;
303
308
  entry?: string | string[] | undefined;
@@ -1214,6 +1219,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
1214
1219
  entry?: string | string[] | undefined;
1215
1220
  project?: string | string[] | undefined;
1216
1221
  } | undefined;
1222
+ marko?: string | boolean | string[] | {
1223
+ config?: string | string[] | undefined;
1224
+ entry?: string | string[] | undefined;
1225
+ project?: string | string[] | undefined;
1226
+ } | undefined;
1217
1227
  mdx?: string | boolean | string[] | {
1218
1228
  config?: string | string[] | undefined;
1219
1229
  entry?: string | string[] | undefined;
@@ -63,6 +63,7 @@ export declare const Plugins: {
63
63
  'lost-pixel': import("../types/config.ts").Plugin;
64
64
  lunaria: import("../types/config.ts").Plugin;
65
65
  markdownlint: import("../types/config.ts").Plugin;
66
+ marko: import("../types/config.ts").Plugin;
66
67
  mdx: import("../types/config.ts").Plugin;
67
68
  mdxlint: import("../types/config.ts").Plugin;
68
69
  metro: import("../types/config.ts").Plugin;
@@ -57,6 +57,7 @@ import { default as lockfileLint } from './lockfile-lint/index.js';
57
57
  import { default as lostPixel } from './lost-pixel/index.js';
58
58
  import { default as lunaria } from './lunaria/index.js';
59
59
  import { default as markdownlint } from './markdownlint/index.js';
60
+ import { default as marko } from './marko/index.js';
60
61
  import { default as mdx } from './mdx/index.js';
61
62
  import { default as mdxlint } from './mdxlint/index.js';
62
63
  import { default as metro } from './metro/index.js';
@@ -236,6 +237,7 @@ export const Plugins = {
236
237
  'lost-pixel': lostPixel,
237
238
  lunaria,
238
239
  markdownlint,
240
+ marko,
239
241
  mdx,
240
242
  mdxlint,
241
243
  metro,
@@ -0,0 +1,2 @@
1
+ import type { CompilerSync } from '../../compilers/types.ts';
2
+ export declare const createCompiler: (tagDependencies?: Map<string, string[]>, fallbackDependencies?: string[]) => CompilerSync;
@@ -0,0 +1,85 @@
1
+ import { getStyleLang, styleExtractor } from '../../compilers/compilers.js';
2
+ import { compiler as lessCompiler } from '../../compilers/less.js';
3
+ import { compiler as scssCompiler } from '../../compilers/scss.js';
4
+ import { compiler as stylusCompiler } from '../../compilers/stylus.js';
5
+ const commentMatcher = /<!--[\s\S]*?-->|\/\*[\s\S]*?\*\/|^[ \t]*\/\/.*$/gm;
6
+ const conciseStyleMatcher = /^[ \t]*style(?:\.([\w.-]+))?[^\n{]*\{([\s\S]*?)^[ \t]*\}/gm;
7
+ const htmlTagMatcher = /<([a-z][\w.-]*)(?=[\s/|>])/g;
8
+ const conciseTagMatcher = /^[ \t]*([a-z][\w.-]*)(?=[ \t/|]|--|$)/gm;
9
+ const tagImportMatcher = /^[ \t]*(?:(?:server|client|static|\$)[ \t]+)?import[ \t\r\n]+(?:type[ \t\r\n]+)?(?:[$\w]+(?:[ \t\r\n]*,[ \t\r\n]*(?:\*[ \t\r\n]+as[ \t\r\n]+[$\w]+|\{[^}]*\}))?|\*[ \t\r\n]+as[ \t\r\n]+[$\w]+|\{[^}]*\})[ \t\r\n]+from[ \t\r\n]*(["'])<[^"'\r\n]+>\1(?:[ \t\r\n]+with[ \t\r\n]*\{(?:[^}"']+|"[^"]*"|'[^']*')*\})?[ \t]*;?[ \t]*(?:\r?\n|$)/gm;
10
+ const markupLineMatcher = /^[ \t]*<.*$/gm;
11
+ const markoPrefixMatcher = /^([ \t]*)(?:server|client|\$)[ \t]+/gm;
12
+ const staticPrefixMatcher = /^([ \t]*)static[ \t]+(?=(?:import|export|const|let|var|function|class|interface|type|enum|namespace|async[ \t]+function)\b)/gm;
13
+ const staticBlockPrefixMatcher = /^([ \t]*)static[ \t]+(?=\{)/gm;
14
+ const classBodyMatcher = /^([ \t]*)class\b[^{]*\{[\s\S]*?^\1\}/gm;
15
+ const classStaticBlockMatcher = /^([ \t]*)static(?=[ \t]*\{)/gm;
16
+ const classStaticBlockPlaceholder = '__MARKO_CLASS_STATIC_BLOCK__';
17
+ const anonymousClassMatcher = /^([ \t]*)class[ \t]*\{/gm;
18
+ const localExportDeclarationMatcher = /^([ \t]*)export[ \t]+(?:default[ \t]+)?(?=(?:(?:declare|abstract|async)[ \t]+)*(?:interface|type[ \t]+[$\w]+|const|let|var|function|class|enum|namespace)\b)/gm;
19
+ const localExportListMatcher = /^[ \t]*export[ \t]+(?:type[ \t]+)?\{[^}]*\}(?![ \t\r\n]*from\b)[ \t]*;?[ \t]*(?=\r?$)/gm;
20
+ const compileStyle = (body, lang, path) => {
21
+ switch (lang) {
22
+ case 'less':
23
+ return lessCompiler(body, path);
24
+ case 'styl':
25
+ case 'stylus':
26
+ return stylusCompiler(body, path);
27
+ default:
28
+ return scssCompiler(body, path);
29
+ }
30
+ };
31
+ const collectStyles = (text, path) => {
32
+ const imports = [];
33
+ styleExtractor.lastIndex = 0;
34
+ let match;
35
+ while ((match = styleExtractor.exec(text))) {
36
+ const lang = getStyleLang(match[1]) ?? match[1].match(/\.([\w-]+)/)?.[1];
37
+ const output = compileStyle(match[2], lang, path);
38
+ if (output)
39
+ imports.push(output);
40
+ }
41
+ conciseStyleMatcher.lastIndex = 0;
42
+ while ((match = conciseStyleMatcher.exec(text))) {
43
+ const output = compileStyle(match[2], match[1]?.split('.').pop(), path);
44
+ if (output)
45
+ imports.push(output);
46
+ }
47
+ return imports;
48
+ };
49
+ const sanitize = (text) => {
50
+ const source = text
51
+ .replace(styleExtractor, '')
52
+ .replace(conciseStyleMatcher, '')
53
+ .replace(tagImportMatcher, '')
54
+ .replace(markupLineMatcher, '')
55
+ .replace(markoPrefixMatcher, '$1')
56
+ .replace(staticPrefixMatcher, '$1')
57
+ .replace(localExportDeclarationMatcher, '$1')
58
+ .replace(localExportListMatcher, '');
59
+ return source
60
+ .replace(classBodyMatcher, body => body.replace(classStaticBlockMatcher, `$1${classStaticBlockPlaceholder}`))
61
+ .replace(staticBlockPrefixMatcher, '$1')
62
+ .replaceAll(classStaticBlockPlaceholder, 'static')
63
+ .replace(anonymousClassMatcher, '$1class MarkoComponent {');
64
+ };
65
+ const collectTagDependencies = (text, tagDependencies, fallbackDependencies) => {
66
+ const dependencies = new Set(fallbackDependencies);
67
+ for (const matcher of [htmlTagMatcher, conciseTagMatcher]) {
68
+ matcher.lastIndex = 0;
69
+ let match;
70
+ while ((match = matcher.exec(text))) {
71
+ for (const dependency of tagDependencies.get(match[1]) ?? [])
72
+ dependencies.add(dependency);
73
+ }
74
+ }
75
+ return Array.from(dependencies, dependency => `import "${dependency}";`);
76
+ };
77
+ export const createCompiler = (tagDependencies = new Map(), fallbackDependencies = []) => (text, path) => {
78
+ const source = text.replace(commentMatcher, '');
79
+ return [
80
+ 'import "marko";',
81
+ ...collectTagDependencies(source, tagDependencies, fallbackDependencies),
82
+ ...collectStyles(source, path),
83
+ sanitize(source),
84
+ ].join('\n');
85
+ };
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,63 @@
1
+ import { toDeferResolve, toProductionEntry } from '../../util/input.js';
2
+ import { join, relative } from '../../util/path.js';
3
+ import { hasDependency } from '../../util/plugin.js';
4
+ import { createCompiler } from './compiler.js';
5
+ import { getTaglibDependencies } from './taglibs.js';
6
+ const title = 'Marko';
7
+ const enablers = ['marko'];
8
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
9
+ const config = ['**/marko.json', '**/marko-tag.json'];
10
+ const tagDiscoveryDirs = ['components', 'tags'];
11
+ const scriptExtensions = '{js,jsx,ts,tsx,mjs,cjs,mts,cts}';
12
+ const styleExtensions = '{css,less,scss,sass,styl,stylus}';
13
+ const tagFilePatterns = [
14
+ '**/*.marko',
15
+ `**/{component,component-browser}.${scriptExtensions}`,
16
+ `**/*.{component,component-browser}.${scriptExtensions}`,
17
+ `**/style.${styleExtensions}`,
18
+ `**/*.style.${styleExtensions}`,
19
+ ];
20
+ const tagProduction = tagFilePatterns.map(pattern => `**/{${tagDiscoveryDirs.join(',')}}/${pattern}`);
21
+ const production = tagProduction;
22
+ const tagDefFields = [
23
+ 'template',
24
+ 'renderer',
25
+ 'parse',
26
+ 'migrate',
27
+ 'transform',
28
+ 'analyze',
29
+ 'translate',
30
+ ];
31
+ const resolveConfig = (localConfig, options) => {
32
+ const { configFileName, configFileDir, cwd } = options;
33
+ const inputs = [];
34
+ if (!localConfig)
35
+ return inputs;
36
+ if (configFileName === 'marko.json') {
37
+ const dir = relative(cwd, configFileDir);
38
+ return tagProduction.map(pattern => toProductionEntry(join(dir, pattern)));
39
+ }
40
+ for (const field of tagDefFields) {
41
+ for (const id of [localConfig[field]].flat()) {
42
+ if (typeof id === 'string')
43
+ inputs.push(toDeferResolve(join(configFileDir, id)));
44
+ }
45
+ }
46
+ return inputs;
47
+ };
48
+ const registerCompilers = async ({ cwd, registerCompiler, hasDependency }) => {
49
+ if (hasDependency('marko')) {
50
+ const { tagDependencies, fallbackDependencies } = await getTaglibDependencies(cwd);
51
+ registerCompiler({ extension: '.marko', compiler: createCompiler(tagDependencies, fallbackDependencies) });
52
+ }
53
+ };
54
+ const plugin = {
55
+ title,
56
+ enablers,
57
+ isEnabled,
58
+ config,
59
+ production,
60
+ resolveConfig,
61
+ registerCompilers,
62
+ };
63
+ export default plugin;
@@ -0,0 +1,4 @@
1
+ export declare const getTaglibDependencies: (cwd: string) => Promise<{
2
+ tagDependencies: Map<string, string[]>;
3
+ fallbackDependencies: string[];
4
+ }>;
@@ -0,0 +1,111 @@
1
+ import { readdirSync } from 'node:fs';
2
+ import { isFile, loadJSON } from '../../util/fs.js';
3
+ import { basename, dirname, join } from '../../util/path.js';
4
+ const dependencyFields = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
5
+ const isRecord = (value) => typeof value === 'object' && value !== null && !Array.isArray(value);
6
+ const getDependencies = async (cwd) => {
7
+ const manifest = await loadJSON(join(cwd, 'package.json'));
8
+ const dependencies = new Set();
9
+ if (!isRecord(manifest))
10
+ return dependencies;
11
+ for (const field of dependencyFields) {
12
+ const values = manifest[field];
13
+ if (isRecord(values))
14
+ for (const packageName in values)
15
+ dependencies.add(packageName);
16
+ }
17
+ return dependencies;
18
+ };
19
+ const findConfig = (cwd, packageName) => {
20
+ let dir = cwd;
21
+ while (true) {
22
+ const filePath = join(dir, 'node_modules', packageName, 'marko.json');
23
+ if (isFile(filePath))
24
+ return filePath;
25
+ const parent = dirname(dir);
26
+ if (parent === dir)
27
+ return;
28
+ dir = parent;
29
+ }
30
+ };
31
+ const readDir = (dir) => {
32
+ try {
33
+ return readdirSync(dir, { withFileTypes: true });
34
+ }
35
+ catch {
36
+ return [];
37
+ }
38
+ };
39
+ const getTagName = (fileName) => (fileName.endsWith('.marko') ? basename(fileName, '.marko') : undefined);
40
+ const isTagDir = (dir, name) => isFile(dir, 'index.marko') || isFile(dir, `${name}.marko`);
41
+ const getTags = (dir) => {
42
+ const tags = new Set();
43
+ for (const entry of readDir(dir)) {
44
+ if (entry.name.startsWith('.'))
45
+ continue;
46
+ if (entry.isFile()) {
47
+ const name = getTagName(entry.name);
48
+ if (name)
49
+ tags.add(name);
50
+ continue;
51
+ }
52
+ if (!entry.isDirectory())
53
+ continue;
54
+ const tagDir = join(dir, entry.name);
55
+ if (isTagDir(tagDir, entry.name)) {
56
+ tags.add(entry.name);
57
+ continue;
58
+ }
59
+ if (entry.name === 'tags' || entry.name === 'components')
60
+ continue;
61
+ for (const child of readDir(tagDir)) {
62
+ if (child.isFile()) {
63
+ const name = getTagName(child.name);
64
+ if (name)
65
+ tags.add(name);
66
+ }
67
+ else if (child.isDirectory() && isTagDir(join(tagDir, child.name), child.name)) {
68
+ tags.add(child.name);
69
+ }
70
+ }
71
+ }
72
+ return tags;
73
+ };
74
+ export const getTaglibDependencies = async (cwd) => {
75
+ const tagDependencies = new Map();
76
+ const fallbackDependencies = [];
77
+ for (const packageName of await getDependencies(cwd)) {
78
+ const configPath = findConfig(cwd, packageName);
79
+ if (!configPath)
80
+ continue;
81
+ let config;
82
+ try {
83
+ config = await loadJSON(configPath);
84
+ }
85
+ catch {
86
+ fallbackDependencies.push(packageName);
87
+ continue;
88
+ }
89
+ if (!isRecord(config)) {
90
+ fallbackDependencies.push(packageName);
91
+ continue;
92
+ }
93
+ const tagsDir = typeof config.exports === 'string'
94
+ ? config.exports
95
+ : typeof config['tags-dir'] === 'string'
96
+ ? config['tags-dir']
97
+ : undefined;
98
+ if (!tagsDir) {
99
+ fallbackDependencies.push(packageName);
100
+ continue;
101
+ }
102
+ for (const tagName of getTags(join(dirname(configPath), tagsDir))) {
103
+ const dependencies = tagDependencies.get(tagName);
104
+ if (dependencies)
105
+ dependencies.push(packageName);
106
+ else
107
+ tagDependencies.set(tagName, [packageName]);
108
+ }
109
+ }
110
+ return { tagDependencies, fallbackDependencies };
111
+ };
@@ -0,0 +1,9 @@
1
+ export type MarkoTagDef = {
2
+ template?: string;
3
+ renderer?: string;
4
+ parse?: string;
5
+ migrate?: string;
6
+ transform?: string;
7
+ analyze?: string;
8
+ translate?: string;
9
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -296,6 +296,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
296
296
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
297
297
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
298
298
  }, z.core.$strip>]>>;
299
+ marko: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
300
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
301
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
302
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
303
+ }, z.core.$strip>]>>;
299
304
  mdx: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
300
305
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
301
306
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1202,6 +1207,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1202
1207
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1203
1208
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1204
1209
  }, z.core.$strip>]>>;
1210
+ marko: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1211
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1212
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1213
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1214
+ }, z.core.$strip>]>>;
1205
1215
  mdx: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1206
1216
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1207
1217
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -2126,6 +2136,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
2126
2136
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2127
2137
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2128
2138
  }, z.core.$strip>]>>;
2139
+ marko: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2140
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2141
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2142
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2143
+ }, z.core.$strip>]>>;
2129
2144
  mdx: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2130
2145
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2131
2146
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -301,6 +301,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
301
301
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
302
302
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
303
303
  }, z.core.$strip>]>;
304
+ marko: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
305
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
306
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
307
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
308
+ }, z.core.$strip>]>;
304
309
  mdx: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
305
310
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
306
311
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -69,6 +69,7 @@ export const pluginsSchema = z.object({
69
69
  'lost-pixel': pluginSchema,
70
70
  lunaria: pluginSchema,
71
71
  markdownlint: pluginSchema,
72
+ marko: pluginSchema,
72
73
  mdx: pluginSchema,
73
74
  mdxlint: pluginSchema,
74
75
  metro: pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-vite' | 'eleventy' | 'esbuild' | 'eslint' | 'eve' | 'execa' | 'expo' | 'expressive-code' | 'fast' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'markdownlint' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nuxtjs-i18n' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'openclaw' | 'orval' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'quasar' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vite-plugin-pages' | 'vite-plugin-pwa' | 'vite-plugin-vue-layouts-next' | 'vite-plus' | 'vite-pwa-assets-generator' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
- export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'babel', 'biome', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-vite', 'eleventy', 'esbuild', 'eslint', 'eve', 'execa', 'expo', 'expressive-code', 'fast', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'markdownlint', 'mdx', 'mdxlint', 'metro', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nuxtjs-i18n', 'nx', 'nyc', 'oclif', 'openapi-ts', 'openclaw', 'orval', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'preconstruct', 'prettier', 'prisma', 'quasar', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'travis', 'ts-node', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'vercel', 'vercel-og', 'vike', 'vite', 'vite-plugin-pages', 'vite-plugin-pwa', 'vite-plugin-vue-layouts-next', 'vite-plus', 'vite-pwa-assets-generator', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
1
+ export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-vite' | 'eleventy' | 'esbuild' | 'eslint' | 'eve' | 'execa' | 'expo' | 'expressive-code' | 'fast' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jest' | 'karma' | 'knex' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'markdownlint' | 'marko' | 'mdx' | 'mdxlint' | 'metro' | 'mocha' | 'moonrepo' | 'msw' | 'nano-spawn' | 'nano-staged' | 'nest' | 'netlify' | 'next' | 'next-intl' | 'next-mdx' | 'nitro' | 'node' | 'node-modules-inspector' | 'nodemon' | 'npm-package-json-lint' | 'nuxt' | 'nuxtjs-i18n' | 'nx' | 'nyc' | 'oclif' | 'openapi-ts' | 'openclaw' | 'orval' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'preconstruct' | 'prettier' | 'prisma' | 'quasar' | 'qwik' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'sst' | 'starlight' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'travis' | 'ts-node' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'vercel' | 'vercel-og' | 'vike' | 'vite' | 'vite-plugin-pages' | 'vite-plugin-pwa' | 'vite-plugin-vue-layouts-next' | 'vite-plus' | 'vite-pwa-assets-generator' | 'vitepress' | 'vitest' | 'vue' | 'webdriver-io' | 'webpack' | 'wireit' | 'wrangler' | 'wxt' | 'xo' | 'yarn' | 'yorkie' | 'zx';
2
+ export declare const pluginNames: readonly ['angular', 'astro', 'astro-db', 'astro-markdoc', 'astro-og-canvas', 'ava', 'babel', 'biome', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-vite', 'eleventy', 'esbuild', 'eslint', 'eve', 'execa', 'expo', 'expressive-code', 'fast', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jest', 'karma', 'knex', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'markdownlint', 'marko', 'mdx', 'mdxlint', 'metro', 'mocha', 'moonrepo', 'msw', 'nano-spawn', 'nano-staged', 'nest', 'netlify', 'next', 'next-intl', 'next-mdx', 'nitro', 'node', 'node-modules-inspector', 'nodemon', 'npm-package-json-lint', 'nuxt', 'nuxtjs-i18n', 'nx', 'nyc', 'oclif', 'openapi-ts', 'openclaw', 'orval', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'preconstruct', 'prettier', 'prisma', 'quasar', 'qwik', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'sst', 'starlight', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'travis', 'ts-node', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'vercel', 'vercel-og', 'vike', 'vite', 'vite-plugin-pages', 'vite-plugin-pwa', 'vite-plugin-vue-layouts-next', 'vite-plus', 'vite-pwa-assets-generator', 'vitepress', 'vitest', 'vue', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
@@ -58,6 +58,7 @@ export const pluginNames = [
58
58
  'lost-pixel',
59
59
  'lunaria',
60
60
  'markdownlint',
61
+ 'marko',
61
62
  'mdx',
62
63
  'mdxlint',
63
64
  'metro',
@@ -340,6 +340,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
340
340
  entry?: string | string[] | undefined;
341
341
  project?: string | string[] | undefined;
342
342
  } | undefined;
343
+ marko?: string | boolean | string[] | {
344
+ config?: string | string[] | undefined;
345
+ entry?: string | string[] | undefined;
346
+ project?: string | string[] | undefined;
347
+ } | undefined;
343
348
  mdx?: string | boolean | string[] | {
344
349
  config?: string | string[] | undefined;
345
350
  entry?: string | string[] | undefined;
@@ -1258,6 +1263,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1258
1263
  entry?: string | string[] | undefined;
1259
1264
  project?: string | string[] | undefined;
1260
1265
  } | undefined;
1266
+ marko?: string | boolean | string[] | {
1267
+ config?: string | string[] | undefined;
1268
+ entry?: string | string[] | undefined;
1269
+ project?: string | string[] | undefined;
1270
+ } | undefined;
1261
1271
  mdx?: string | boolean | string[] | {
1262
1272
  config?: string | string[] | undefined;
1263
1273
  entry?: string | string[] | undefined;
@@ -226,6 +226,7 @@ export declare const getPublishedTypeManifest: (manifest: PackageJson) => {
226
226
  "lost-pixel": unknown;
227
227
  lunaria: unknown;
228
228
  markdownlint: unknown;
229
+ marko: unknown;
229
230
  mdx: unknown;
230
231
  mdxlint: unknown;
231
232
  metro: unknown;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "6.30.0";
1
+ export declare const version = "6.31.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '6.30.0';
1
+ export const version = '6.31.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "6.30.0",
3
+ "version": "6.31.0",
4
4
  "description": "Find and fix unused dependencies, exports and files in your TypeScript and JavaScript projects",
5
5
  "keywords": [
6
6
  "analysis",
package/schema.json CHANGED
@@ -630,6 +630,10 @@
630
630
  "title": "markdownlint plugin configuration (https://knip.dev/reference/plugins/markdownlint)",
631
631
  "$ref": "#/definitions/plugin"
632
632
  },
633
+ "marko": {
634
+ "title": "marko plugin configuration (https://knip.dev/reference/plugins/marko)",
635
+ "$ref": "#/definitions/plugin"
636
+ },
633
637
  "mdx": {
634
638
  "title": "mdx plugin configuration (https://knip.dev/reference/plugins/mdx)",
635
639
  "$ref": "#/definitions/plugin"