knip 6.37.0 → 6.38.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 (37) hide show
  1. package/dist/ConfigurationChief.d.ts +12 -0
  2. package/dist/compilers/compilers.js +1 -1
  3. package/dist/graph/analyze.js +16 -12
  4. package/dist/plugins/eslint/helpers.d.ts +2 -0
  5. package/dist/plugins/eslint/helpers.js +14 -3
  6. package/dist/plugins/eslint/resolveFromAST.js +12 -8
  7. package/dist/plugins/eve/index.js +26 -8
  8. package/dist/plugins/index.d.ts +2 -0
  9. package/dist/plugins/index.js +4 -0
  10. package/dist/plugins/mdx/index.d.ts +3 -0
  11. package/dist/plugins/mdx/index.js +16 -6
  12. package/dist/plugins/mocha/index.js +3 -1
  13. package/dist/plugins/mocha/types.d.ts +1 -0
  14. package/dist/plugins/oxlint/index.js +24 -8
  15. package/dist/plugins/oxlint/types.d.ts +1 -0
  16. package/dist/plugins/plop/index.js +2 -2
  17. package/dist/plugins/turbo/index.d.ts +3 -0
  18. package/dist/plugins/turbo/index.js +23 -0
  19. package/dist/plugins/typescript/content-mappers.d.ts +4 -0
  20. package/dist/plugins/typescript/content-mappers.js +4 -0
  21. package/dist/plugins/typescript/index.js +14 -18
  22. package/dist/plugins/typescript-content-mapper/index.d.ts +3 -0
  23. package/dist/plugins/typescript-content-mapper/index.js +23 -0
  24. package/dist/plugins/typescript-content-mapper/types.d.ts +3 -0
  25. package/dist/plugins/typescript-content-mapper/types.js +1 -0
  26. package/dist/schema/configuration.d.ts +30 -0
  27. package/dist/schema/plugins.d.ts +10 -0
  28. package/dist/schema/plugins.js +2 -0
  29. package/dist/types/PluginNames.d.ts +2 -2
  30. package/dist/types/PluginNames.js +2 -0
  31. package/dist/types/tsconfig-json.d.ts +1 -3
  32. package/dist/util/create-options.d.ts +20 -0
  33. package/dist/util/package-json.d.ts +2 -0
  34. package/dist/version.d.ts +1 -1
  35. package/dist/version.js +1 -1
  36. package/package.json +1 -1
  37. package/schema.json +8 -0
@@ -822,6 +822,11 @@ export declare class ConfigurationChief {
822
822
  entry?: string | string[] | undefined;
823
823
  project?: string | string[] | undefined;
824
824
  } | undefined;
825
+ turbo?: string | boolean | string[] | {
826
+ config?: string | string[] | undefined;
827
+ entry?: string | string[] | undefined;
828
+ project?: string | string[] | undefined;
829
+ } | undefined;
825
830
  typedoc?: string | boolean | string[] | {
826
831
  config?: string | string[] | undefined;
827
832
  entry?: string | string[] | undefined;
@@ -832,6 +837,11 @@ export declare class ConfigurationChief {
832
837
  entry?: string | string[] | undefined;
833
838
  project?: string | string[] | undefined;
834
839
  } | undefined;
840
+ 'typescript-content-mapper'?: string | boolean | string[] | {
841
+ config?: string | string[] | undefined;
842
+ entry?: string | string[] | undefined;
843
+ project?: string | string[] | undefined;
844
+ } | undefined;
835
845
  unbuild?: string | boolean | string[] | {
836
846
  config?: string | string[] | undefined;
837
847
  entry?: string | string[] | undefined;
@@ -1168,8 +1178,10 @@ export declare class ConfigurationChief {
1168
1178
  tsdown?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1169
1179
  tsup?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1170
1180
  tsx?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1181
+ turbo?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1171
1182
  typedoc?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1172
1183
  typescript?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1184
+ "typescript-content-mapper"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1173
1185
  unbuild?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1174
1186
  unocss?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
1175
1187
  "unplugin-auto-import"?: (boolean | import("./types/config.ts").EnsuredPluginConfiguration) | undefined;
@@ -5,7 +5,7 @@ export const styleExtractor = /<style\b((?:[^>"']|"[^"]*"|'[^']*')*)>([\s\S]*?)<
5
5
  const langAttrMatcher = /\blang\s*=\s*["']([^"']+)["']/i;
6
6
  export const blockCommentMatcher = /\/\*[\s\S]*?\*\//g;
7
7
  export const lineCommentMatcher = /^[ \t]*\/\/.*$/gm;
8
- export const importMatcher = /(?<![.\w$#])import\b(?:\s*\(\s*['"][^'"]+['"][^)]*\)|(?!\s*\()[^'"]+['"][^'"]+['"])/g;
8
+ export const importMatcher = /(?<![.\w$#])import\b(?!\s*\.)(?:\s*\(\s*['"][^'"]+['"][^)]*\)|(?!\s*\()[^'"]+['"][^'"]+['"])/g;
9
9
  export const collectImports = text => {
10
10
  if (!text.includes('import'))
11
11
  return '';
@@ -70,7 +70,7 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
70
70
  return;
71
71
  const issueType = isEnumMembers ? 'enumMembers' : 'namespaceMembers';
72
72
  const unusedMembers = [];
73
- const ignoredMemberIds = [];
73
+ const ignoredMembers = [];
74
74
  for (const member of exportedItem.members) {
75
75
  if (findMatch(workspace.ignoreMembers, member.identifier))
76
76
  continue;
@@ -78,8 +78,7 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
78
78
  continue;
79
79
  if (member.hasRefsInFile)
80
80
  continue;
81
- const id = `${identifier}.${member.identifier}`;
82
- const [isMemberReferenced] = explorer.isReferenced(filePath, id, {
81
+ const [isMemberReferenced] = explorer.isReferenced(filePath, `${identifier}.${member.identifier}`, {
83
82
  traverseEntries: true,
84
83
  treatStarAtEntryAsReferenced: true,
85
84
  });
@@ -89,10 +88,19 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
89
88
  unusedMembers.push(member);
90
89
  }
91
90
  else if (isMemberIgnored) {
92
- ignoredMemberIds.push(id);
91
+ ignoredMembers.push(member);
92
+ }
93
+ }
94
+ return { issueType, unusedMembers, ignoredMembers };
95
+ };
96
+ const addMemberTagHints = (members, filePath, identifier) => {
97
+ for (const member of members) {
98
+ for (const tagName of member.jsDocTags) {
99
+ if (options.tags[1].includes(tagName)) {
100
+ collector.addTagHint({ type: 'tag', filePath, identifier: `${identifier}.${member.identifier}`, tagName });
101
+ }
93
102
  }
94
103
  }
95
- return { issueType, unusedMembers, ignoredMemberIds };
96
104
  };
97
105
  const analyzeGraph = async () => {
98
106
  if (options.isReportValues || options.isReportTypes) {
@@ -124,6 +132,8 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
124
132
  const memberIssues = isReferenced
125
133
  ? getMemberIssues(exportedItem, filePath, identifier, workspace, importsForExport)
126
134
  : undefined;
135
+ if (memberIssues)
136
+ addMemberTagHints(memberIssues.ignoredMembers, filePath, identifier);
127
137
  if (!memberIssues || memberIssues.unusedMembers.length === 0) {
128
138
  for (const tagName of exportedItem.jsDocTags) {
129
139
  if (options.tags[1].includes(tagName) || (isInternalProd && tagName === INTERNAL_TAG)) {
@@ -160,13 +170,7 @@ export const analyze = async ({ analyzedFiles, counselor, chief, collector, depu
160
170
  fixes: member.fix ? [member.fix] : [],
161
171
  });
162
172
  }
163
- for (const id of memberIssues.ignoredMemberIds) {
164
- for (const tagName of exportedItem.jsDocTags) {
165
- if (options.tags[1].includes(tagName)) {
166
- collector.addTagHint({ type: 'tag', filePath, identifier: id, tagName });
167
- }
168
- }
169
- }
173
+ addMemberTagHints(memberIssues.ignoredMembers, filePath, identifier);
170
174
  }
171
175
  continue;
172
176
  }
@@ -4,5 +4,7 @@ import { type ConfigInput, type Input } from '../../util/input.ts';
4
4
  import type { ESLintConfig, ESLintConfigDeprecated, OverrideConfigDeprecated, Settings } from './types.ts';
5
5
  export declare const isFlatConfig: (fileName: string) => boolean;
6
6
  export declare const getInputs: (config: ESLintConfigDeprecated | OverrideConfigDeprecated | ESLintConfig, options: PluginOptions) => (Input | ConfigInput)[];
7
+ export type ImportSettingKind = 'resolver' | 'parsers';
8
+ export declare const importSettingKinds: Map<string, ImportSettingKind>;
7
9
  export declare const getInputsFromSettings: (settings?: Settings) => Input[];
8
10
  export declare const resolveFormatters: (formatters: string | string[], manifest: Manifest) => Set<Input>;
@@ -79,13 +79,24 @@ const getResolverNames = (value) => {
79
79
  return [value];
80
80
  if (Array.isArray(value))
81
81
  return value.flatMap(getResolverNames);
82
- if (value && typeof value === 'object')
82
+ if (value && typeof value === 'object') {
83
+ if ('name' in value && 'resolver' in value)
84
+ return [];
83
85
  return Object.keys(value);
86
+ }
84
87
  return [];
85
88
  };
89
+ export const importSettingKinds = new Map([
90
+ ['import/resolver', 'resolver'],
91
+ ['import-x/resolver', 'resolver'],
92
+ ['import-x/resolver-legacy', 'resolver'],
93
+ ['import/parsers', 'parsers'],
94
+ ['import-x/parsers', 'parsers'],
95
+ ]);
86
96
  const getDependenciesFromSettings = (settings = {}) => {
87
97
  return Object.entries(settings).flatMap(([settingKey, settings]) => {
88
- if (settingKey === 'import/resolver') {
98
+ const kind = importSettingKinds.get(settingKey);
99
+ if (kind === 'resolver') {
89
100
  return getResolverNames(settings)
90
101
  .filter(key => key !== 'node')
91
102
  .map(key => {
@@ -96,7 +107,7 @@ const getDependenciesFromSettings = (settings = {}) => {
96
107
  return `eslint-import-resolver-${key}`;
97
108
  });
98
109
  }
99
- if (settingKey === 'import/parsers') {
110
+ if (kind === 'parsers') {
100
111
  return (typeof settings === 'string' ? [settings] : Object.keys(settings)).map(key => {
101
112
  if (isAbsolute(key))
102
113
  return getPackageNameFromFilePath(key);
@@ -3,27 +3,30 @@ import { toDeferResolve } from '../../util/input.js';
3
3
  import { findProperty, getPropertyKey } from '../../typescript/ast-helpers.js';
4
4
  import { getStringValue } from '../../typescript/ast-nodes.js';
5
5
  import { isInternal } from '../../util/path.js';
6
+ import { importSettingKinds } from './helpers.js';
6
7
  export const getInputsFromSettingsAST = (program) => {
7
8
  const inputs = [];
8
- const addResolver = (key, resolver) => {
9
+ const addResolver = (kind, resolver) => {
9
10
  if (!resolver || resolver === 'node' || isInternal(resolver))
10
11
  return;
11
- const dep = key === 'import/resolver' ? `eslint-import-resolver-${resolver}` : resolver;
12
+ const dep = kind === 'resolver' ? `eslint-import-resolver-${resolver}` : resolver;
12
13
  inputs.push(toDeferResolve(dep, { optional: true }));
13
14
  };
14
- const addResolvers = (key, node) => {
15
+ const addResolvers = (kind, node) => {
15
16
  if (node?.type === 'ArrayExpression') {
16
17
  for (const element of node.elements)
17
- addResolvers(key, element);
18
+ addResolvers(kind, element);
18
19
  }
19
20
  else if (node?.type === 'ObjectExpression') {
21
+ if (kind === 'resolver' && findProperty(node, 'name') && findProperty(node, 'resolver'))
22
+ return;
20
23
  for (const prop of node.properties) {
21
24
  if (prop.type === 'Property')
22
- addResolver(key, getPropertyKey(prop));
25
+ addResolver(kind, getPropertyKey(prop));
23
26
  }
24
27
  }
25
28
  else {
26
- addResolver(key, getStringValue(node));
29
+ addResolver(kind, getStringValue(node));
27
30
  }
28
31
  };
29
32
  const visitor = new Visitor({
@@ -35,8 +38,9 @@ export const getInputsFromSettingsAST = (program) => {
35
38
  if (prop.type !== 'Property')
36
39
  continue;
37
40
  const key = getPropertyKey(prop);
38
- if (key === 'import/resolver' || key === 'import/parsers')
39
- addResolvers(key, prop.value);
41
+ const kind = key && importSettingKinds.get(key);
42
+ if (kind)
43
+ addResolvers(kind, prop.value);
40
44
  }
41
45
  },
42
46
  });
@@ -3,20 +3,38 @@ const title = 'eve';
3
3
  const enablers = ['eve'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
5
  const extensions = '{js,jsx,ts,tsx,mjs,cjs,mts,cts}';
6
- const rootAgentFileNames = '{agent,instructions,instrumentation,sandbox}';
7
- const subagentFileNames = '{agent,instructions,sandbox}';
6
+ const agentRoots = '{,agent/,agents/*/,agents/*/agent/}';
7
+ const subagentRoots = `${agentRoots}+(subagents/*/|extensions/*/subagents/*/)`;
8
+ const extensionMounts = `{${agentRoots},${subagentRoots}}extensions/*`;
9
+ const rootAgentFileNames = '{agent,instructions,instrumentation,memory,sandbox}';
10
+ const rootAgentDirectories = '{channels,connections,hooks,skills,tools,schedules}';
11
+ const subagentFileNames = '{agent,instructions,memory,sandbox}';
12
+ const subagentDirectories = '{connections,hooks,skills,tools}';
13
+ const entry = ['{evals,agents/*/evals}/evals.config.ts', '{evals,agents/*/evals}/**/*.eval.ts'];
8
14
  const production = [
9
- `{,agent/}${rootAgentFileNames}.${extensions}`,
10
- `{,agent/}sandbox/sandbox.${extensions}`,
11
- `{,agent/}{channels,connections,hooks,skills,tools,schedules}/**/*.${extensions}`,
12
- `{,agent/}subagents/**/${subagentFileNames}.${extensions}`,
13
- `{,agent/}subagents/**/sandbox/sandbox.${extensions}`,
14
- `{,agent/}subagents/**/{connections,hooks,skills,tools}/**/*.${extensions}`,
15
+ `${agentRoots}${rootAgentFileNames}.${extensions}`,
16
+ `${agentRoots}{instructions,instrumentation,memory}/*.${extensions}`,
17
+ `${agentRoots}sandbox/sandbox.${extensions}`,
18
+ `${agentRoots}sandbox/workspace/**/*.${extensions}`,
19
+ `${agentRoots}${rootAgentDirectories}/**/*.${extensions}`,
20
+ `${agentRoots}subagents/*.${extensions}`,
21
+ `${subagentRoots}subagents/*.${extensions}`,
22
+ `${subagentRoots}${subagentFileNames}.${extensions}`,
23
+ `${subagentRoots}{instructions,memory}/*.${extensions}`,
24
+ `${subagentRoots}sandbox/sandbox.${extensions}`,
25
+ `${subagentRoots}sandbox/workspace/**/*.${extensions}`,
26
+ `${subagentRoots}${subagentDirectories}/**/*.${extensions}`,
27
+ `${extensionMounts}.${extensions}`,
28
+ `${extensionMounts}/{extension,instructions}.${extensions}`,
29
+ `${extensionMounts}/instructions/*.${extensions}`,
30
+ `${extensionMounts}/${rootAgentDirectories}/**/*.${extensions}`,
31
+ `${extensionMounts}/subagents/*.${extensions}`,
15
32
  ];
16
33
  const plugin = {
17
34
  title,
18
35
  enablers,
19
36
  isEnabled,
37
+ entry,
20
38
  production,
21
39
  };
22
40
  export default plugin;
@@ -157,8 +157,10 @@ export declare const Plugins: {
157
157
  tsdown: import("../types/config.ts").Plugin;
158
158
  tsup: import("../types/config.ts").Plugin;
159
159
  tsx: import("../types/config.ts").Plugin;
160
+ turbo: import("../types/config.ts").Plugin;
160
161
  typedoc: import("../types/config.ts").Plugin;
161
162
  typescript: import("../types/config.ts").Plugin;
163
+ 'typescript-content-mapper': import("../types/config.ts").Plugin;
162
164
  unbuild: import("../types/config.ts").Plugin;
163
165
  unocss: import("../types/config.ts").Plugin;
164
166
  'unplugin-auto-import': import("../types/config.ts").Plugin;
@@ -151,8 +151,10 @@ import { default as tsd } from './tsd/index.js';
151
151
  import { default as tsdown } from './tsdown/index.js';
152
152
  import { default as tsup } from './tsup/index.js';
153
153
  import { default as tsx } from './tsx/index.js';
154
+ import { default as turbo } from './turbo/index.js';
154
155
  import { default as typedoc } from './typedoc/index.js';
155
156
  import { default as typescript } from './typescript/index.js';
157
+ import { default as typescriptContentMapper } from './typescript-content-mapper/index.js';
156
158
  import { default as unbuild } from './unbuild/index.js';
157
159
  import { default as unocss } from './unocss/index.js';
158
160
  import { default as unpluginAutoImport } from './unplugin-auto-import/index.js';
@@ -337,8 +339,10 @@ export const Plugins = {
337
339
  tsdown,
338
340
  tsup,
339
341
  tsx,
342
+ turbo,
340
343
  typedoc,
341
344
  typescript,
345
+ 'typescript-content-mapper': typescriptContentMapper,
342
346
  unbuild,
343
347
  unocss,
344
348
  'unplugin-auto-import': unpluginAutoImport,
@@ -1,3 +1,6 @@
1
1
  import type { Plugin } from '../../types/config.ts';
2
+ import { type Input } from '../../util/input.ts';
3
+ export declare const contentMappers: string[];
4
+ export declare const resolveContentMapperOptions: (options: Record<string, unknown>) => Input[];
2
5
  declare const plugin: Plugin;
3
6
  export default plugin;
@@ -1,25 +1,35 @@
1
- import { toDependency } from '../../util/input.js';
1
+ import { toDeferResolveProductionEntry, toDependency } from '../../util/input.js';
2
+ import { isInternal } from '../../util/path.js';
2
3
  import { hasDependency } from '../../util/plugin.js';
3
4
  const title = 'MDX';
4
5
  const enablers = ['astro', 'mdxlint'];
5
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
7
  const config = ['tsconfig.json'];
7
- const takeDependencies = (config) => {
8
+ const takeDependencies = (plugins) => {
8
9
  const inputs = [];
9
- if (Array.isArray(config.plugins)) {
10
- for (const plugin of config.plugins) {
10
+ if (Array.isArray(plugins)) {
11
+ for (const plugin of plugins) {
11
12
  if (typeof plugin === 'string')
12
13
  inputs.push(toDependency(plugin));
13
- else if (typeof plugin[0] === 'string')
14
+ else if (Array.isArray(plugin) && typeof plugin[0] === 'string')
14
15
  inputs.push(toDependency(plugin[0]));
15
16
  }
16
17
  }
17
18
  return inputs;
18
19
  };
20
+ export const contentMappers = ['mdx-content-mapper', '@mdx-js/content-mapper'];
21
+ const bundledPlugins = ['remark-mdx-frontmatter'];
22
+ export const resolveContentMapperOptions = (options) => {
23
+ const inputs = takeDependencies(options.remarkPlugins).filter(input => !bundledPlugins.includes(input.specifier));
24
+ const provider = options.providerImportSource;
25
+ if (typeof provider === 'string' && isInternal(provider))
26
+ inputs.push(toDeferResolveProductionEntry(provider));
27
+ return inputs;
28
+ };
19
29
  const resolveConfig = async (config, options) => {
20
30
  const { configFileName } = options;
21
31
  if (configFileName === 'tsconfig.json' && 'mdx' in config)
22
- return takeDependencies(config.mdx);
32
+ return takeDependencies(config.mdx.plugins);
23
33
  return [];
24
34
  };
25
35
  const plugin = {
@@ -1,4 +1,4 @@
1
- import { toDeferResolve, toEntry } from '../../util/input.js';
1
+ import { toDeferResolve, toDeferResolveEntry, toEntry } from '../../util/input.js';
2
2
  import { isDirectory } from '../../util/fs.js';
3
3
  import { hasDependency } from '../../util/plugin.js';
4
4
  const title = 'Mocha';
@@ -9,9 +9,11 @@ const entry = ['**/test/*.{js,cjs,mjs}'];
9
9
  const defaultExtensions = ['js', 'cjs', 'mjs'];
10
10
  const resolveConfig = localConfig => {
11
11
  const entryPatterns = localConfig.spec ? [localConfig.spec].flat() : entry;
12
+ const files = localConfig.file ? [localConfig.file].flat() : [];
12
13
  const require = localConfig.require ? [localConfig.require].flat() : [];
13
14
  const inputs = [];
14
15
  inputs.push(...entryPatterns.map(id => toEntry(id)));
16
+ inputs.push(...files.map(id => toDeferResolveEntry(id)));
15
17
  inputs.push(...require.map(id => toDeferResolve(id)));
16
18
  return inputs;
17
19
  };
@@ -1,4 +1,5 @@
1
1
  export interface MochaConfig {
2
+ file?: string | string[];
2
3
  require?: string | string[];
3
4
  spec?: string | string[];
4
5
  }
@@ -1,7 +1,7 @@
1
1
  import { Visitor } from 'oxc-parser';
2
2
  import { findProperty, getPropertyValues } from '../../typescript/ast-helpers.js';
3
- import { toDependency, toEntry } from '../../util/input.js';
4
- import { isInternal } from '../../util/path.js';
3
+ import { toConfig, toDependency, toEntry } from '../../util/input.js';
4
+ import { dirname, isInternal, toAbsolute } from '../../util/path.js';
5
5
  import { hasDependency } from '../../util/plugin.js';
6
6
  import { getInputsFromSettings } from '../eslint/helpers.js';
7
7
  import { getInputsFromSettingsAST } from '../eslint/resolveFromAST.js';
@@ -13,28 +13,42 @@ const isViteConfig = (configFileName) => configFileName.startsWith('vite.config.
13
13
  const args = {
14
14
  config: true,
15
15
  };
16
- const resolveJsPlugins = (jsPlugins) => {
16
+ const resolveJsPlugins = (jsPlugins, configFilePath) => {
17
17
  const inputs = [];
18
+ const dir = dirname(configFilePath);
18
19
  for (const plugin of jsPlugins ?? []) {
19
20
  const specifier = typeof plugin === 'string' ? plugin : plugin.specifier;
20
21
  if (!isInternal(specifier))
21
22
  inputs.push(toDependency(specifier));
22
23
  else
23
- inputs.push(toEntry(specifier));
24
+ inputs.push(toEntry(toAbsolute(specifier, dir)));
24
25
  }
25
26
  return inputs;
26
27
  };
27
28
  const isLoadConfig = ({ configFileName }) => !isViteConfig(configFileName);
28
- const resolveConfig = config => {
29
- const inputs = resolveJsPlugins(config.jsPlugins);
29
+ const resolveExtendedConfig = (config, configFilePath) => {
30
+ const inputs = [];
31
+ for (const entry of config.extends ?? []) {
32
+ if (typeof entry === 'string') {
33
+ const filePath = toAbsolute(entry, dirname(configFilePath));
34
+ inputs.push(toConfig('oxlint', filePath, { containingFilePath: configFilePath }));
35
+ }
36
+ else {
37
+ for (const input of resolveExtendedConfig(entry, configFilePath))
38
+ inputs.push(input);
39
+ }
40
+ }
41
+ for (const input of resolveJsPlugins(config.jsPlugins, configFilePath))
42
+ inputs.push(input);
30
43
  for (const override of config.overrides ?? []) {
31
- for (const input of resolveJsPlugins(override.jsPlugins))
44
+ for (const input of resolveJsPlugins(override.jsPlugins, configFilePath))
32
45
  inputs.push(input);
33
46
  }
34
47
  for (const input of getInputsFromSettings(config.settings))
35
48
  inputs.push(input);
36
49
  return inputs;
37
50
  };
51
+ const resolveConfig = (config, options) => resolveExtendedConfig(config, options.configFilePath);
38
52
  const resolveFromAST = (program, options) => {
39
53
  if (!isViteConfig(options.configFileName))
40
54
  return [];
@@ -55,8 +69,9 @@ const resolveFromAST = (program, options) => {
55
69
  },
56
70
  });
57
71
  visitor.visit(program);
58
- return [...resolveJsPlugins([...jsPlugins]), ...getInputsFromSettingsAST(program)];
72
+ return [...resolveJsPlugins([...jsPlugins], options.configFilePath), ...getInputsFromSettingsAST(program)];
59
73
  };
74
+ const isFilterTransitiveDependencies = true;
60
75
  const plugin = {
61
76
  title,
62
77
  enablers,
@@ -65,6 +80,7 @@ const plugin = {
65
80
  isLoadConfig,
66
81
  resolveConfig,
67
82
  resolveFromAST,
83
+ isFilterTransitiveDependencies,
68
84
  args,
69
85
  };
70
86
  export default plugin;
@@ -7,6 +7,7 @@ type Override = {
7
7
  jsPlugins?: JsPlugin[];
8
8
  };
9
9
  export type OxlintConfig = {
10
+ extends?: (string | OxlintConfig)[];
10
11
  jsPlugins?: JsPlugin[];
11
12
  overrides?: Override[];
12
13
  settings?: Settings;
@@ -2,11 +2,11 @@ import { hasDependency } from '../../util/plugin.js';
2
2
  const title = 'Plop';
3
3
  const enablers = ['plop'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['plopfile.{cjs,mjs,js,ts}'];
5
+ const entry = ['plopfile.{cjs,mjs,js,ts}'];
6
6
  const plugin = {
7
7
  title,
8
8
  enablers,
9
9
  isEnabled,
10
- config,
10
+ entry,
11
11
  };
12
12
  export default plugin;
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,23 @@
1
+ import { toEntry } from '../../util/input.js';
2
+ import { hasDependency } from '../../util/plugin.js';
3
+ const title = 'Turborepo';
4
+ const enablers = ['turbo', '@turbo/gen'];
5
+ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
+ const extensions = '{ts,js,cjs,mts,mjs}';
7
+ const entry = [`turbo/generators/config.${extensions}`];
8
+ const resolve = ({ cwd, rootCwd }) => (cwd === rootCwd ? [toEntry(`plopfile.${extensions}`)] : []);
9
+ const args = {
10
+ string: ['config'],
11
+ resolveInputs: parsed => (parsed._[0] === 'gen' || parsed._[0] === 'generate') && typeof parsed.config === 'string'
12
+ ? [toEntry(parsed.config)]
13
+ : [],
14
+ };
15
+ const plugin = {
16
+ title,
17
+ enablers,
18
+ isEnabled,
19
+ entry,
20
+ resolve,
21
+ args,
22
+ };
23
+ export default plugin;
@@ -0,0 +1,4 @@
1
+ import type { Input } from '../../util/input.ts';
2
+ type ResolveContentMapperOptions = (options: Record<string, unknown>) => Input[];
3
+ export declare const contentMapperResolvers: Map<string, ResolveContentMapperOptions>;
4
+ export {};
@@ -0,0 +1,4 @@
1
+ import { contentMappers as mdxContentMappers, resolveContentMapperOptions as resolveMdxOptions } from '../mdx/index.js';
2
+ export const contentMapperResolvers = new Map();
3
+ for (const name of mdxContentMappers)
4
+ contentMapperResolvers.set(name, resolveMdxOptions);
@@ -2,20 +2,22 @@ import { compact } from '../../util/array.js';
2
2
  import { toConfig, toDeferResolve, toDependency, toProductionDependency } from '../../util/input.js';
3
3
  import { join } from '../../util/path.js';
4
4
  import { hasDependency } from '../../util/plugin.js';
5
- import { toShellCommand } from '../../util/scripts.js';
5
+ import { contentMapperResolvers } from './content-mappers.js';
6
6
  const title = 'TypeScript';
7
7
  const enablers = ['typescript', '@typescript/native', '@typescript/native-preview'];
8
8
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
9
- const config = ['tsconfig.json', 'package.json'];
10
- const packageJsonPath = 'typescript.contentMapper';
11
- const resolveContentMapper = ({ exec }, options) => {
12
- if (!Array.isArray(exec) || exec.some(arg => typeof arg !== 'string'))
13
- return [];
14
- return options
15
- .getInputsFromScripts(toShellCommand(exec))
16
- .map(input => input.type === 'entry' || input.type === 'deferResolveEntry' ? { ...input, production: true } : input);
9
+ const config = ['tsconfig.json'];
10
+ const resolveContentMappers = (localConfig) => {
11
+ const inputs = [];
12
+ for (const { package: name, options } of localConfig.contentMappers ?? []) {
13
+ inputs.push(toDependency(name));
14
+ const resolveOptions = contentMapperResolvers.get(name);
15
+ if (resolveOptions && options)
16
+ inputs.push(...resolveOptions(options));
17
+ }
18
+ return inputs;
17
19
  };
18
- const resolveTsConfig = (localConfig, options) => {
20
+ const resolveConfig = (localConfig, options) => {
19
21
  const { compilerOptions } = localConfig;
20
22
  const extend = localConfig.extends
21
23
  ? [localConfig.extends]
@@ -25,7 +27,7 @@ const resolveTsConfig = (localConfig, options) => {
25
27
  const references = localConfig.references
26
28
  ?.filter(reference => reference.path.endsWith('.json'))
27
29
  .map(reference => toConfig('typescript', reference.path, { containingFilePath: options.configFilePath })) ?? [];
28
- const contentMappers = localConfig.contentMappers?.map(contentMapper => toDependency(contentMapper.package)) ?? [];
30
+ const contentMappers = resolveContentMappers(localConfig);
29
31
  if (!(compilerOptions && localConfig))
30
32
  return compact([...contentMappers, ...extend, ...references]);
31
33
  const jsx = (compilerOptions?.jsxImportSource ? [compilerOptions.jsxImportSource] : []).map(toProductionDependency);
@@ -43,25 +45,19 @@ const resolveTsConfig = (localConfig, options) => {
43
45
  ...jsx,
44
46
  ]);
45
47
  };
46
- const resolveConfig = (localConfig, options) => options.configFileName === 'package.json'
47
- ? resolveContentMapper(localConfig, options)
48
- : resolveTsConfig(localConfig, options);
49
48
  const args = {
50
49
  binaries: ['tsc', 'tsgo'],
51
50
  string: ['project'],
52
51
  alias: { project: ['p'] },
53
52
  config: [['project', (p) => (p.endsWith('.json') ? p : join(p, 'tsconfig.json'))]],
54
53
  };
55
- const note = `[What's up with that configurable tsconfig.json location?](/reference/faq#whats-up-with-that-configurable-tsconfigjson-location)
56
-
57
- In a content mapper package, the command in \`package.json#typescript.contentMapper.exec\` is resolved to a production entry.`;
54
+ const note = `[What's up with that configurable tsconfig.json location?](/reference/faq#whats-up-with-that-configurable-tsconfigjson-location)`;
58
55
  export const docs = { note };
59
56
  const plugin = {
60
57
  title,
61
58
  enablers,
62
59
  isEnabled,
63
60
  config,
64
- packageJsonPath,
65
61
  resolveConfig,
66
62
  args,
67
63
  };
@@ -0,0 +1,3 @@
1
+ import type { Plugin } from '../../types/config.ts';
2
+ declare const plugin: Plugin;
3
+ export default plugin;
@@ -0,0 +1,23 @@
1
+ import { get } from '../../util/object.js';
2
+ import { toShellCommand } from '../../util/scripts.js';
3
+ const title = 'TypeScript Content Mapper';
4
+ const enablers = 'This plugin is enabled when `package.json#typescript.contentMapper` is present.';
5
+ const isEnabled = ({ manifest }) => Boolean(get(manifest, 'typescript.contentMapper'));
6
+ const packageJsonPath = 'typescript.contentMapper';
7
+ const config = ['package.json'];
8
+ const resolveConfig = ({ exec }, options) => {
9
+ if (!Array.isArray(exec) || exec.some(arg => typeof arg !== 'string'))
10
+ return [];
11
+ return options
12
+ .getInputsFromScripts(toShellCommand(exec))
13
+ .map(input => input.type === 'entry' || input.type === 'deferResolveEntry' ? { ...input, production: true } : input);
14
+ };
15
+ const plugin = {
16
+ title,
17
+ enablers,
18
+ isEnabled,
19
+ packageJsonPath,
20
+ config,
21
+ resolveConfig,
22
+ };
23
+ export default plugin;
@@ -0,0 +1,3 @@
1
+ export interface ContentMapperManifest {
2
+ exec?: string[];
3
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -766,6 +766,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
766
766
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
767
767
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
768
768
  }, z.core.$strip>]>>;
769
+ turbo: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
770
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
771
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
772
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
773
+ }, z.core.$strip>]>>;
769
774
  typedoc: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
770
775
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
771
776
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -776,6 +781,11 @@ export declare const workspaceConfigurationSchema: z.ZodMiniObject<{
776
781
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
777
782
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
778
783
  }, z.core.$strip>]>>;
784
+ 'typescript-content-mapper': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
785
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
786
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
787
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
788
+ }, z.core.$strip>]>>;
779
789
  unbuild: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
780
790
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
781
791
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1708,6 +1718,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1708
1718
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1709
1719
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1710
1720
  }, z.core.$strip>]>>;
1721
+ turbo: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1722
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1723
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1724
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1725
+ }, z.core.$strip>]>>;
1711
1726
  typedoc: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1712
1727
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1713
1728
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -1718,6 +1733,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
1718
1733
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1719
1734
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1720
1735
  }, z.core.$strip>]>>;
1736
+ 'typescript-content-mapper': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1737
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1738
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1739
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1740
+ }, z.core.$strip>]>>;
1721
1741
  unbuild: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
1722
1742
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
1723
1743
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -2669,6 +2689,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
2669
2689
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2670
2690
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2671
2691
  }, z.core.$strip>]>>;
2692
+ turbo: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2693
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2694
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2695
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2696
+ }, z.core.$strip>]>>;
2672
2697
  typedoc: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2673
2698
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2674
2699
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -2679,6 +2704,11 @@ export declare const knipConfigurationSchema: z.ZodMiniObject<{
2679
2704
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2680
2705
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2681
2706
  }, z.core.$strip>]>>;
2707
+ 'typescript-content-mapper': z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2708
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2709
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2710
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2711
+ }, z.core.$strip>]>>;
2682
2712
  unbuild: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
2683
2713
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
2684
2714
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -771,6 +771,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
771
771
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
772
772
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
773
773
  }, z.core.$strip>]>;
774
+ turbo: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
775
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
776
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
777
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
778
+ }, z.core.$strip>]>;
774
779
  typedoc: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
775
780
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
776
781
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -781,6 +786,11 @@ export declare const pluginsSchema: z.ZodMiniObject<{
781
786
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
782
787
  project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
783
788
  }, z.core.$strip>]>;
789
+ 'typescript-content-mapper': z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
790
+ config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
791
+ entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
792
+ project: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
793
+ }, z.core.$strip>]>;
784
794
  unbuild: z.ZodMiniUnion<readonly [z.ZodMiniBoolean<boolean>, z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>, z.ZodMiniObject<{
785
795
  config: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
786
796
  entry: z.ZodMiniOptional<z.ZodMiniUnion<readonly [z.ZodMiniString<string>, z.ZodMiniArray<z.ZodMiniString<string>>]>>;
@@ -163,8 +163,10 @@ export const pluginsSchema = z.object({
163
163
  tsdown: pluginSchema,
164
164
  tsup: pluginSchema,
165
165
  tsx: pluginSchema,
166
+ turbo: pluginSchema,
166
167
  typedoc: pluginSchema,
167
168
  typescript: pluginSchema,
169
+ 'typescript-content-mapper': pluginSchema,
168
170
  unbuild: pluginSchema,
169
171
  unocss: pluginSchema,
170
172
  'unplugin-auto-import': pluginSchema,
@@ -1,2 +1,2 @@
1
- export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'babel' | 'biome' | 'borp' | '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' | 'mise' | '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' | 'pre-commit' | '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' | 'textlint' | 'travis' | 'ts-node' | 'tsd' | 'tsdown' | 'tsup' | 'tsx' | 'typedoc' | 'typescript' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'varlock' | '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', 'borp', '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', 'mise', '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', 'pre-commit', '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', 'textlint', 'travis', 'ts-node', 'tsd', 'tsdown', 'tsup', 'tsx', 'typedoc', 'typescript', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'varlock', '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' | 'borp' | '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' | 'mise' | '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' | 'pre-commit' | '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' | 'textlint' | 'travis' | 'ts-node' | 'tsd' | 'tsdown' | 'tsup' | 'tsx' | 'turbo' | 'typedoc' | 'typescript' | 'typescript-content-mapper' | 'unbuild' | 'unocss' | 'unplugin-auto-import' | 'unplugin-icons' | 'unplugin-vue-components' | 'unplugin-vue-i18n' | 'unplugin-vue-markdown' | 'unplugin-vue-router' | 'varlock' | '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', 'borp', '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', 'mise', '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', 'pre-commit', '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', 'textlint', 'travis', 'ts-node', 'tsd', 'tsdown', 'tsup', 'tsx', 'turbo', 'typedoc', 'typescript', 'typescript-content-mapper', 'unbuild', 'unocss', 'unplugin-auto-import', 'unplugin-icons', 'unplugin-vue-components', 'unplugin-vue-i18n', 'unplugin-vue-markdown', 'unplugin-vue-router', 'varlock', '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'];
@@ -152,8 +152,10 @@ export const pluginNames = [
152
152
  'tsdown',
153
153
  'tsup',
154
154
  'tsx',
155
+ 'turbo',
155
156
  'typedoc',
156
157
  'typescript',
158
+ 'typescript-content-mapper',
157
159
  'unbuild',
158
160
  'unocss',
159
161
  'unplugin-auto-import',
@@ -10,11 +10,9 @@ export interface TsConfigJson {
10
10
  };
11
11
  contentMappers?: {
12
12
  package: string;
13
+ options?: Record<string, unknown>;
13
14
  }[];
14
15
  references?: Array<{
15
16
  path: string;
16
17
  }>;
17
18
  }
18
- export interface ContentMapperManifest {
19
- exec?: string[];
20
- }
@@ -811,6 +811,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
811
811
  entry?: string | string[] | undefined;
812
812
  project?: string | string[] | undefined;
813
813
  } | undefined;
814
+ turbo?: string | boolean | string[] | {
815
+ config?: string | string[] | undefined;
816
+ entry?: string | string[] | undefined;
817
+ project?: string | string[] | undefined;
818
+ } | undefined;
814
819
  typedoc?: string | boolean | string[] | {
815
820
  config?: string | string[] | undefined;
816
821
  entry?: string | string[] | undefined;
@@ -821,6 +826,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
821
826
  entry?: string | string[] | undefined;
822
827
  project?: string | string[] | undefined;
823
828
  } | undefined;
829
+ 'typescript-content-mapper'?: string | boolean | string[] | {
830
+ config?: string | string[] | undefined;
831
+ entry?: string | string[] | undefined;
832
+ project?: string | string[] | undefined;
833
+ } | undefined;
824
834
  unbuild?: string | boolean | string[] | {
825
835
  config?: string | string[] | undefined;
826
836
  entry?: string | string[] | undefined;
@@ -1768,6 +1778,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1768
1778
  entry?: string | string[] | undefined;
1769
1779
  project?: string | string[] | undefined;
1770
1780
  } | undefined;
1781
+ turbo?: string | boolean | string[] | {
1782
+ config?: string | string[] | undefined;
1783
+ entry?: string | string[] | undefined;
1784
+ project?: string | string[] | undefined;
1785
+ } | undefined;
1771
1786
  typedoc?: string | boolean | string[] | {
1772
1787
  config?: string | string[] | undefined;
1773
1788
  entry?: string | string[] | undefined;
@@ -1778,6 +1793,11 @@ export declare const createOptions: (options: CreateOptions) => Promise<{
1778
1793
  entry?: string | string[] | undefined;
1779
1794
  project?: string | string[] | undefined;
1780
1795
  } | undefined;
1796
+ 'typescript-content-mapper'?: string | boolean | string[] | {
1797
+ config?: string | string[] | undefined;
1798
+ entry?: string | string[] | undefined;
1799
+ project?: string | string[] | undefined;
1800
+ } | undefined;
1781
1801
  unbuild?: string | boolean | string[] | {
1782
1802
  config?: string | string[] | undefined;
1783
1803
  entry?: string | string[] | undefined;
@@ -319,8 +319,10 @@ export declare const getPublishedTypeManifest: (manifest: PackageJson) => {
319
319
  tsdown?: unknown;
320
320
  tsup?: unknown;
321
321
  tsx?: unknown;
322
+ turbo?: unknown;
322
323
  typedoc?: unknown;
323
324
  typescript?: unknown;
325
+ "typescript-content-mapper"?: unknown;
324
326
  unbuild?: unknown;
325
327
  unocss?: unknown;
326
328
  "unplugin-auto-import"?: unknown;
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "6.37.0";
1
+ export declare const version = "6.38.0";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '6.37.0';
1
+ export const version = '6.38.0';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "6.37.0",
3
+ "version": "6.38.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
@@ -1018,6 +1018,10 @@
1018
1018
  "title": "tsx plugin configuration (https://knip.dev/reference/plugins/tsx)",
1019
1019
  "$ref": "#/definitions/plugin"
1020
1020
  },
1021
+ "turbo": {
1022
+ "title": "turbo plugin configuration (https://knip.dev/reference/plugins/turbo)",
1023
+ "$ref": "#/definitions/plugin"
1024
+ },
1021
1025
  "typedoc": {
1022
1026
  "title": "typedoc plugin configuration (https://knip.dev/reference/plugins/typedoc)",
1023
1027
  "$ref": "#/definitions/plugin"
@@ -1026,6 +1030,10 @@
1026
1030
  "title": "TypeScript plugin configuration (https://knip.dev/reference/plugins/typescript)",
1027
1031
  "$ref": "#/definitions/plugin"
1028
1032
  },
1033
+ "typescript-content-mapper": {
1034
+ "title": "typescript-content-mapper plugin configuration (https://knip.dev/reference/plugins/typescript-content-mapper)",
1035
+ "$ref": "#/definitions/plugin"
1036
+ },
1029
1037
  "unbuild": {
1030
1038
  "title": "unbuild plugin configuration (https://knip.dev/reference/plugins/unbuild)",
1031
1039
  "$ref": "#/definitions/plugin"