knip 5.23.1 → 5.23.3

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 (104) hide show
  1. package/dist/ConfigurationChief.d.ts +89 -15
  2. package/dist/ConfigurationValidator.d.ts +2897 -1141
  3. package/dist/DependencyDeputy.d.ts +21 -6
  4. package/dist/IssueCollector.d.ts +4 -4
  5. package/dist/IssueFixer.d.ts +1 -1
  6. package/dist/PrincipalFactory.d.ts +3 -3
  7. package/dist/ProjectPrincipal.d.ts +9 -9
  8. package/dist/WorkspaceWorker.d.ts +14 -9
  9. package/dist/binaries/util.d.ts +5 -5
  10. package/dist/compilers/astro.d.ts +1 -1
  11. package/dist/compilers/compilers.d.ts +2 -2
  12. package/dist/compilers/index.d.ts +695 -83
  13. package/dist/compilers/mdx.d.ts +1 -1
  14. package/dist/constants.d.ts +4 -4
  15. package/dist/index.d.ts +8 -1
  16. package/dist/manifest/helpers.d.ts +1 -1
  17. package/dist/manifest/index.d.ts +4 -6
  18. package/dist/plugins/babel/helpers.d.ts +1 -1
  19. package/dist/plugins/babel/index.d.ts +1 -1
  20. package/dist/plugins/capacitor/index.d.ts +1 -1
  21. package/dist/plugins/commitlint/index.js +2 -7
  22. package/dist/plugins/cypress/index.d.ts +1 -1
  23. package/dist/plugins/eleventy/helpers.d.ts +5 -5
  24. package/dist/plugins/eleventy/index.d.ts +5 -2
  25. package/dist/plugins/graphql-codegen/index.d.ts +1 -1
  26. package/dist/plugins/graphql-codegen/index.js +1 -1
  27. package/dist/plugins/husky/index.d.ts +1 -1
  28. package/dist/plugins/jest/index.d.ts +3 -2
  29. package/dist/plugins/lefthook/index.d.ts +1 -1
  30. package/dist/plugins/lint-staged/index.d.ts +2 -1
  31. package/dist/plugins/lint-staged/index.js +5 -6
  32. package/dist/plugins/linthtml/index.js +2 -9
  33. package/dist/plugins/lockfile-lint/index.js +2 -2
  34. package/dist/plugins/markdownlint/helpers.d.ts +1 -1
  35. package/dist/plugins/netlify/helpers.d.ts +1 -1
  36. package/dist/plugins/netlify/index.d.ts +1 -1
  37. package/dist/plugins/next/index.d.ts +1 -1
  38. package/dist/plugins/npm-package-json-lint/index.js +2 -2
  39. package/dist/plugins/nx/index.d.ts +1 -1
  40. package/dist/plugins/playwright-ct/index.d.ts +1 -1
  41. package/dist/plugins/postcss/index.js +6 -2
  42. package/dist/plugins/prettier/index.js +2 -2
  43. package/dist/plugins/release-it/index.js +1 -1
  44. package/dist/plugins/remix/index.d.ts +1 -1
  45. package/dist/plugins/semantic-release/index.js +2 -2
  46. package/dist/plugins/sentry/index.d.ts +1 -1
  47. package/dist/plugins/simple-git-hooks/index.d.ts +2 -1
  48. package/dist/plugins/size-limit/index.js +5 -2
  49. package/dist/plugins/storybook/index.d.ts +2 -2
  50. package/dist/plugins/stylelint/index.js +2 -2
  51. package/dist/plugins/svelte/index.d.ts +1 -1
  52. package/dist/plugins/syncpack/index.d.ts +1 -0
  53. package/dist/plugins/syncpack/index.js +5 -2
  54. package/dist/plugins/tsup/index.js +1 -1
  55. package/dist/plugins/typedoc/index.js +4 -4
  56. package/dist/plugins/unbuild/index.d.ts +2 -1
  57. package/dist/plugins/unocss/index.js +2 -2
  58. package/dist/plugins/vitest/helpers.d.ts +2 -2
  59. package/dist/plugins/webpack/index.d.ts +4 -1
  60. package/dist/plugins/wireit/index.d.ts +2 -3
  61. package/dist/plugins/xo/index.js +2 -2
  62. package/dist/plugins/yorkie/index.d.ts +2 -1
  63. package/dist/reporters/index.d.ts +1 -1
  64. package/dist/reporters/json.d.ts +1 -1
  65. package/dist/reporters/util.d.ts +1 -1
  66. package/dist/typescript/SourceFileManager.d.ts +5 -5
  67. package/dist/typescript/ast-helpers.d.ts +7 -7
  68. package/dist/typescript/getImportsAndExports.d.ts +11 -10
  69. package/dist/typescript/visitors/dynamic-imports/index.d.ts +1 -1
  70. package/dist/typescript/visitors/exports/exportKeyword.js +1 -1
  71. package/dist/typescript/visitors/exports/index.d.ts +1 -1
  72. package/dist/typescript/visitors/imports/index.d.ts +1 -1
  73. package/dist/typescript/visitors/scripts/index.d.ts +1 -1
  74. package/dist/util/Performance.d.ts +2 -2
  75. package/dist/util/array.d.ts +2 -2
  76. package/dist/util/errors.d.ts +1 -1
  77. package/dist/util/file-entry-cache.d.ts +6 -3
  78. package/dist/util/fs.d.ts +6 -6
  79. package/dist/util/get-included-issue-types.d.ts +2 -1
  80. package/dist/util/get-included-issue-types.js +1 -1
  81. package/dist/util/git.d.ts +1 -1
  82. package/dist/util/glob.d.ts +6 -6
  83. package/dist/util/handle-dependency.d.ts +1 -1
  84. package/dist/util/is-identifier-referenced.d.ts +1 -1
  85. package/dist/util/loader.d.ts +1 -1
  86. package/dist/util/map-workspaces.d.ts +2 -1
  87. package/dist/util/modules.d.ts +7 -7
  88. package/dist/util/package-json.d.ts +6 -2
  89. package/dist/util/path.d.ts +6 -6
  90. package/dist/util/pkgs-graph.d.ts +1 -1
  91. package/dist/util/plugin.d.ts +33 -9
  92. package/dist/util/plugin.js +34 -2
  93. package/dist/util/protocols.d.ts +9 -9
  94. package/dist/util/regex.d.ts +3 -3
  95. package/dist/util/reporter.d.ts +1 -1
  96. package/dist/util/require.d.ts +3 -3
  97. package/dist/util/resolve.d.ts +1 -1
  98. package/dist/util/tag.d.ts +2 -2
  99. package/dist/util/trace.d.ts +2 -2
  100. package/dist/util/tsconfig-loader.d.ts +6 -1
  101. package/dist/util/unwrap-function.d.ts +1 -1
  102. package/dist/version.d.ts +1 -1
  103. package/dist/version.js +1 -1
  104. package/package.json +12 -8
@@ -1,6 +1,6 @@
1
1
  import type { HasDependency } from './types.js';
2
2
  declare const _default: {
3
3
  condition: (hasDependency: HasDependency) => boolean;
4
- compiler: (text: string) => any;
4
+ compiler: (text: string) => string;
5
5
  };
6
6
  export default _default;
@@ -5,10 +5,10 @@ export declare const ANONYMOUS = "__anonymous";
5
5
  export declare const KNIP_CONFIG_LOCATIONS: string[];
6
6
  export declare const DEFAULT_EXTENSIONS: string[];
7
7
  export declare const GLOBAL_IGNORE_PATTERNS: string[];
8
- export declare const IGNORED_GLOBAL_BINARIES: any;
9
- export declare const IGNORED_DEPENDENCIES: any;
10
- export declare const IGNORED_RUNTIME_DEPENDENCIES: any;
11
- export declare const FOREIGN_FILE_EXTENSIONS: any;
8
+ export declare const IGNORED_GLOBAL_BINARIES: Set<string>;
9
+ export declare const IGNORED_DEPENDENCIES: Set<string>;
10
+ export declare const IGNORED_RUNTIME_DEPENDENCIES: Set<string>;
11
+ export declare const FOREIGN_FILE_EXTENSIONS: Set<string>;
12
12
  export declare const IGNORE_DEFINITELY_TYPED: string[];
13
13
  export declare const ISSUE_TYPES: IssueType[];
14
14
  export declare const ISSUE_TYPE_TITLE: Record<IssueType, string>;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,11 @@
1
1
  import type { CommandLineOptions } from './types/cli.js';
2
2
  export type { RawConfiguration as KnipConfig } from './types/config.js';
3
3
  export type { Preprocessor, Reporter, ReporterOptions } from './types/issues.js';
4
- export declare const main: (unresolvedConfiguration: CommandLineOptions) => unknown;
4
+ export declare const main: (unresolvedConfiguration: CommandLineOptions) => Promise<{
5
+ report: import("./types/issues.js").Report;
6
+ issues: import("./types/issues.js").Issues;
7
+ counters: import("./types/issues.js").Counters;
8
+ rules: import("./types/issues.js").Rules;
9
+ tagHints: Set<import("./types/issues.js").TagHint>;
10
+ configurationHints: Set<import("./types/issues.js").ConfigurationHint>;
11
+ }>;
@@ -9,5 +9,5 @@ type GetFilteredScriptsOptions = {
9
9
  isProduction: boolean;
10
10
  scripts?: Scripts;
11
11
  };
12
- export declare const getFilteredScripts: ({ isProduction, scripts }: GetFilteredScriptsOptions) => any;
12
+ export declare const getFilteredScripts: ({ isProduction, scripts }: GetFilteredScriptsOptions) => Scripts;
13
13
  export {};
@@ -1,14 +1,12 @@
1
+ import type { HostDependencies, InstalledBinaries } from '../types/workspace.js';
1
2
  type Options = {
2
3
  packageNames: string[];
3
4
  dir: string;
4
5
  cwd: string;
5
6
  };
6
7
  export declare const getDependencyMetaData: ({ cwd, dir, packageNames }: Options) => {
7
- hostDependencies: Map<string, {
8
- name: string;
9
- isPeerOptional: boolean;
10
- }[]>;
11
- installedBinaries: Map<string, Set<string>>;
12
- hasTypesIncluded: any;
8
+ hostDependencies: HostDependencies;
9
+ installedBinaries: InstalledBinaries;
10
+ hasTypesIncluded: Set<string>;
13
11
  };
14
12
  export {};
@@ -1,4 +1,4 @@
1
- export declare const resolveName: (identifier: string, namespace: "preset" | "plugin") => any;
1
+ export declare const resolveName: (identifier: string, namespace: "preset" | "plugin") => string;
2
2
  export declare const api: {
3
3
  assertVersion: () => boolean;
4
4
  cache: {
@@ -3,7 +3,7 @@ import type { BabelConfig, BabelConfigObj } from './types.js';
3
3
  export declare const getDependenciesFromConfig: (config: BabelConfigObj) => string[];
4
4
  declare const _default: {
5
5
  title: string;
6
- enablers: {}[];
6
+ enablers: RegExp[];
7
7
  isEnabled: IsPluginEnabled;
8
8
  config: string[];
9
9
  resolveConfig: ResolveConfig<BabelConfig>;
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
2
  import type { CapacitorConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
5
- enablers: {}[];
5
+ enablers: RegExp[];
6
6
  isEnabled: IsPluginEnabled;
7
7
  config: string[];
8
8
  resolveConfig: ResolveConfig<CapacitorConfig>;
@@ -1,13 +1,8 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
2
2
  const title = 'commitlint';
3
3
  const enablers = ['@commitlint/cli'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = [
6
- '.commitlintrc',
7
- '.commitlintrc.{json,yaml,yml,js,cjs,ts,cts}',
8
- 'commitlint.config.{js,cjs,ts,cts}',
9
- 'package.json',
10
- ];
5
+ const config = ['package.json', 'package.yaml', ...toCosmiconfig('commitlint', { additionalExtensions: ['cts'] })];
11
6
  const resolveConfig = async (config) => {
12
7
  const extendsConfigs = config.extends
13
8
  ? [config.extends]
@@ -4,7 +4,7 @@ declare const _default: {
4
4
  enablers: string[];
5
5
  isEnabled: IsPluginEnabled;
6
6
  config: string[];
7
- entry: any[];
7
+ entry: string[];
8
8
  resolveEntryPaths: ResolveEntryPaths;
9
9
  };
10
10
  export default _default;
@@ -109,22 +109,22 @@ export declare class DummyEleventyConfig {
109
109
  DateTime: {};
110
110
  dynamicPermalinks: boolean;
111
111
  useGitIgnore: boolean;
112
- ignores: any;
113
- watchIgnores: any;
112
+ ignores: Set<unknown>;
113
+ watchIgnores: Set<unknown>;
114
114
  dataDeepMerge: boolean;
115
- extensionMap: any;
115
+ extensionMap: Set<unknown>;
116
116
  watchJavaScriptDependencies: boolean;
117
117
  additionalWatchTargets: never[];
118
118
  serverOptions: {};
119
119
  globalData: {};
120
120
  chokidarConfig: {};
121
121
  watchThrottleWaitTime: number;
122
- dataExtensions: any;
122
+ dataExtensions: Map<any, any>;
123
123
  quietMode: boolean;
124
124
  plugins: never[];
125
125
  _pluginExecution: boolean;
126
126
  useTemplateCache: boolean;
127
- dataFilterSelectors: any;
127
+ dataFilterSelectors: Set<unknown>;
128
128
  libraryAmendments: {};
129
129
  serverPassthroughCopyBehavior: string;
130
130
  urlTransforms: never[];
@@ -1,11 +1,14 @@
1
1
  import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
2
+ import { DummyEleventyConfig } from './helpers.js';
3
+ import type { EleventyConfig } from './types.js';
4
+ type T = Partial<EleventyConfig> | ((arg: DummyEleventyConfig) => Promise<Partial<EleventyConfig>>);
2
5
  declare const _default: {
3
6
  title: string;
4
7
  enablers: string[];
5
8
  isEnabled: IsPluginEnabled;
6
9
  config: string[];
7
10
  production: string[];
8
- resolveEntryPaths: ResolveEntryPaths<any>;
9
- resolveConfig: ResolveConfig<any>;
11
+ resolveEntryPaths: ResolveEntryPaths<T>;
12
+ resolveConfig: ResolveConfig<T>;
10
13
  };
11
14
  export default _default;
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
2
  import type { GraphqlCodegenTypes, GraphqlConfigTypes, GraphqlProjectsConfigTypes } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
5
- enablers: {}[];
5
+ enablers: (string | RegExp)[];
6
6
  isEnabled: IsPluginEnabled;
7
7
  packageJsonPath: (manifest: import("../../types/package-json.js").PackageJson) => string;
8
8
  config: string[];
@@ -9,7 +9,7 @@ const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
9
9
  const packageJsonPath = manifest => get(manifest, 'codegen') ?? get(manifest, 'graphql');
10
10
  const config = [
11
11
  'package.json',
12
- 'codegen.{json,yml,yaml,js,ts,mjs,cts}',
12
+ 'codegen.{json,yml,yaml,js,ts}',
13
13
  '.codegenrc.{json,yml,yaml,js,ts}',
14
14
  'codegen.config.js',
15
15
  '.graphqlrc',
@@ -3,7 +3,7 @@ declare const _default: {
3
3
  title: string;
4
4
  enablers: string[];
5
5
  isEnabled: IsPluginEnabled;
6
- config: any[];
6
+ config: string[];
7
7
  resolveConfig: ResolveConfig<string>;
8
8
  };
9
9
  export default _default;
@@ -1,11 +1,12 @@
1
1
  import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
2
+ import type { JestConfig } from './types.js';
2
3
  declare const _default: {
3
4
  title: string;
4
5
  enablers: string[];
5
6
  isEnabled: IsPluginEnabled;
6
7
  config: string[];
7
8
  entry: string[];
8
- resolveEntryPaths: ResolveEntryPaths<any>;
9
- resolveConfig: ResolveConfig<any>;
9
+ resolveEntryPaths: ResolveEntryPaths<JestConfig>;
10
+ resolveConfig: ResolveConfig<JestConfig>;
10
11
  };
11
12
  export default _default;
@@ -3,7 +3,7 @@ declare const _default: {
3
3
  title: string;
4
4
  enablers: string[];
5
5
  isEnabled: IsPluginEnabled;
6
- config: any[];
6
+ config: string[];
7
7
  resolveConfig: ResolveConfig;
8
8
  };
9
9
  export default _default;
@@ -1,10 +1,11 @@
1
1
  import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
+ import type { LintStagedConfig } from './types.js';
2
3
  declare const _default: {
3
4
  title: string;
4
5
  enablers: string[];
5
6
  isEnabled: IsPluginEnabled;
6
7
  packageJsonPath: string;
7
8
  config: string[];
8
- resolveConfig: ResolveConfig<any>;
9
+ resolveConfig: ResolveConfig<LintStagedConfig>;
9
10
  };
10
11
  export default _default;
@@ -1,15 +1,14 @@
1
- import { getDependenciesFromScripts, hasDependency } from '#p/util/plugin.js';
1
+ import { getDependenciesFromScripts, hasDependency, toLilconfig } from '#p/util/plugin.js';
2
2
  const title = 'lint-staged';
3
3
  const enablers = ['lint-staged'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
5
  const packageJsonPath = 'lint-staged';
6
6
  const config = [
7
- '.lintstagedrc',
8
- '.lintstagedrc.json',
9
- '.lintstagedrc.{yml,yaml}',
10
- '.lintstagedrc.{js,mjs,cjs}',
11
- 'lint-staged.config.{js,mjs,cjs}',
12
7
  'package.json',
8
+ 'package.yaml',
9
+ 'package.yml',
10
+ ...toLilconfig('lint-staged'),
11
+ ...toLilconfig('lintstaged'),
13
12
  ];
14
13
  const resolveConfig = async (config, options) => {
15
14
  if (typeof config === 'function')
@@ -1,18 +1,11 @@
1
1
  import { isInternal } from '#p/util/path.js';
2
- import { hasDependency } from '#p/util/plugin.js';
2
+ import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
3
3
  import { toEntryPattern } from '#p/util/protocols.js';
4
4
  const title = 'LintHTML';
5
5
  const packageJsonPath = 'linthtmlConfig';
6
6
  const enablers = ['@linthtml/linthtml'];
7
7
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
8
- const config = [
9
- '.linthtmlrc',
10
- '.linthtmlrc.json',
11
- '.linthtmlrc.yml',
12
- '.linthtmlrc.{js,cjs}',
13
- 'linthtml.config.js',
14
- 'package.json',
15
- ];
8
+ const config = ['package.json', ...toCosmiconfig('linthtml')];
16
9
  const resolveConfig = config => {
17
10
  const extensions = [config.extends ?? []]
18
11
  .flat()
@@ -1,8 +1,8 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
2
2
  const title = 'lockfile-lint';
3
3
  const enablers = ['lockfile-lint'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['.lockfile-lintrc', '.lockfile-lint.{js,toml}', 'lockfile-lint.config.js', 'package.json'];
5
+ const config = ['package.json', ...toCosmiconfig('lockfile-lint', { additionalExtensions: ['toml'] })];
6
6
  export default {
7
7
  title,
8
8
  enablers,
@@ -1 +1 @@
1
- export declare const getArgumentValues: (value: string, matcher: RegExp) => any;
1
+ export declare const getArgumentValues: (value: string, matcher: RegExp) => string[];
@@ -1,2 +1,2 @@
1
1
  import type { FunctionsConfig } from './types.js';
2
- export declare const extractFunctionsConfigProperty: (config: FunctionsConfig, property: keyof FunctionsConfig) => any[];
2
+ export declare const extractFunctionsConfigProperty: (config: FunctionsConfig, property: keyof FunctionsConfig) => string[];
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types
2
2
  import type { NetlifyConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
5
- enablers: {}[];
5
+ enablers: (string | RegExp)[];
6
6
  isEnabled: IsPluginEnabled;
7
7
  config: string[];
8
8
  production: string[];
@@ -4,6 +4,6 @@ declare const _default: {
4
4
  enablers: string[];
5
5
  isEnabled: IsPluginEnabled;
6
6
  entry: string[];
7
- production: any[];
7
+ production: string[];
8
8
  };
9
9
  export default _default;
@@ -1,9 +1,9 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
2
2
  const title = 'npm-package-json-lint';
3
3
  const enablers = ['npm-package-json-lint'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
5
  const packageJsonPath = 'npmpackagejsonlint';
6
- const config = ['.npmpackagejsonlintrc.json', 'npmpackagejsonlint.config.js', 'package.json'];
6
+ const config = ['package.json', ...toCosmiconfig('npmpackagejsonlint')];
7
7
  const resolveConfig = localConfig => {
8
8
  return localConfig?.extends ? [localConfig.extends] : [];
9
9
  };
@@ -2,7 +2,7 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
2
  import type { NxConfigRoot, NxProjectConfiguration } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
5
- enablers: {}[];
5
+ enablers: (string | RegExp)[];
6
6
  isEnabled: IsPluginEnabled;
7
7
  config: string[];
8
8
  resolveConfig: ResolveConfig<NxProjectConfiguration | NxConfigRoot>;
@@ -1,7 +1,7 @@
1
1
  import type { IsPluginEnabled } from '#p/types/plugins.js';
2
2
  declare const _default: {
3
3
  title: string;
4
- enablers: {}[];
4
+ enablers: RegExp[];
5
5
  isEnabled: IsPluginEnabled;
6
6
  config: string[];
7
7
  entry: string[];
@@ -1,8 +1,12 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency, toLilconfig } from '#p/util/plugin.js';
2
2
  const title = 'PostCSS';
3
3
  const enablers = ['postcss', 'postcss-cli', 'next'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['postcss.config.{cjs,js}', 'postcss.config.json', 'package.json'];
5
+ const config = [
6
+ 'package.json',
7
+ 'postcss.config.json',
8
+ ...toLilconfig('postcss', { configDir: false, additionalExtensions: ['ts', 'mts', 'cts', 'yaml', 'yml'] }),
9
+ ];
6
10
  const resolveConfig = config => {
7
11
  return config.plugins
8
12
  ? (Array.isArray(config.plugins) ? config.plugins : Object.keys(config.plugins)).flatMap(plugin => {
@@ -4,9 +4,9 @@ const enablers = ['prettier'];
4
4
  const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, enablers) || 'prettier' in config;
5
5
  const config = [
6
6
  '.prettierrc',
7
- '.prettierrc.{json,js,cjs,mjs,yml,yaml}',
7
+ '.prettierrc.{json,js,cjs,mjs,yml,yaml,toml,json5}',
8
8
  'prettier.config.{js,cjs,mjs}',
9
- 'package.json',
9
+ 'package.{json,yaml}',
10
10
  ];
11
11
  const resolveConfig = config => {
12
12
  if (typeof config === 'string') {
@@ -3,7 +3,7 @@ const title = 'Release It';
3
3
  const enablers = ['release-it'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
5
  const packageJsonPath = 'release-it';
6
- const config = ['.release-it.json', '.release-it.{js,cjs}', '.release-it.{yml,yaml}', 'package.json'];
6
+ const config = ['.release-it.{json,js,cjs,ts,yml,yaml,toml}', 'package.json'];
7
7
  const resolveConfig = (config, options) => {
8
8
  const plugins = config.plugins ? Object.keys(config.plugins) : [];
9
9
  const scripts = config.hooks ? Object.values(config.hooks).flat() : [];
@@ -1,7 +1,7 @@
1
1
  import type { IsPluginEnabled } from '#p/types/plugins.js';
2
2
  declare const _default: {
3
3
  title: string;
4
- enablers: {}[];
4
+ enablers: RegExp[];
5
5
  isEnabled: IsPluginEnabled;
6
6
  entry: string[];
7
7
  production: string[];
@@ -1,9 +1,9 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
2
2
  const title = 'Semantic Release';
3
3
  const enablers = ['semantic-release'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
5
  const packageJsonPath = 'release';
6
- const config = ['.releaserc', '.releaserc.{yaml,yml,json,js,cjs}', 'release.config.{js,cjs}', 'package.json'];
6
+ const config = ['package.json', ...toCosmiconfig('release')];
7
7
  const resolveConfig = config => {
8
8
  const plugins = (config?.plugins ?? []).map(plugin => (Array.isArray(plugin) ? plugin[0] : plugin));
9
9
  return plugins;
@@ -1,7 +1,7 @@
1
1
  import type { IsPluginEnabled } from '#p/types/plugins.js';
2
2
  declare const _default: {
3
3
  title: string;
4
- enablers: {}[];
4
+ enablers: RegExp[];
5
5
  isEnabled: IsPluginEnabled;
6
6
  entry: string[];
7
7
  };
@@ -1,10 +1,11 @@
1
1
  import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
+ import type { PluginConfig } from './types.js';
2
3
  declare const _default: {
3
4
  title: string;
4
5
  enablers: import("#p/types/config.js").IgnorePatterns;
5
6
  isEnabled: IsPluginEnabled;
6
7
  packageJsonPath: string;
7
8
  config: string[];
8
- resolveConfig: ResolveConfig<any>;
9
+ resolveConfig: ResolveConfig<PluginConfig>;
9
10
  };
10
11
  export default _default;
@@ -1,8 +1,11 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency, toLilconfig } from '#p/util/plugin.js';
2
2
  const title = 'size-limit';
3
3
  const enablers = ['size-limit'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['.size-limit.{json,js,cjs,ts}', 'package.json'];
5
+ const config = [
6
+ 'package.json',
7
+ ...toLilconfig('size-limit', { configDir: false, additionalExtensions: ['ts', 'mts', 'cts'], rcSuffix: '' }),
8
+ ];
6
9
  export default {
7
10
  title,
8
11
  enablers,
@@ -2,10 +2,10 @@ import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types
2
2
  import type { StorybookConfig } from './types.js';
3
3
  declare const _default: {
4
4
  title: string;
5
- enablers: {}[];
5
+ enablers: (string | RegExp)[];
6
6
  isEnabled: IsPluginEnabled;
7
7
  config: string[];
8
- entry: any[];
8
+ entry: string[];
9
9
  project: string[];
10
10
  resolveEntryPaths: ResolveEntryPaths<StorybookConfig>;
11
11
  resolveConfig: ResolveConfig<StorybookConfig>;
@@ -1,9 +1,9 @@
1
1
  import { isInternal } from '#p/util/path.js';
2
- import { hasDependency } from '#p/util/plugin.js';
2
+ import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
3
3
  const title = 'Stylelint';
4
4
  const enablers = ['stylelint'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
- const config = ['.stylelintrc', '.stylelintrc.{cjs,js,json,yaml,yml}', 'stylelint.config.{cjs,mjs,js}'];
6
+ const config = ['package.json', ...toCosmiconfig('stylelint')];
7
7
  const resolve = (config) => {
8
8
  const extend = config.extends ? [config.extends].flat().filter(id => !isInternal(id)) : [];
9
9
  const plugins = config.plugins ? [config.plugins].flat().filter(id => !isInternal(id)) : [];
@@ -3,7 +3,7 @@ declare const _default: {
3
3
  title: string;
4
4
  enablers: string[];
5
5
  isEnabled: IsPluginEnabled;
6
- entry: any[];
6
+ entry: string[];
7
7
  production: string[];
8
8
  project: string[];
9
9
  };
@@ -4,5 +4,6 @@ declare const _default: {
4
4
  enablers: import("#p/types/config.js").IgnorePatterns;
5
5
  isEnabled: IsPluginEnabled;
6
6
  config: string[];
7
+ packageJsonPath: (manifest: import("../../types/package-json.js").PackageJson) => string;
7
8
  };
8
9
  export default _default;
@@ -1,11 +1,14 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { get } from '#p/util/object.js';
2
+ import { hasDependency, toCosmiconfig } from '#p/util/plugin.js';
2
3
  const title = 'Syncpack';
3
4
  const enablers = ['syncpack'];
4
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['.syncpackrc', '.syncpackrc.{json,yaml,yml,js,cjs}', '.syncpack.config.{js,cjs}'];
6
+ const config = ['package.json', ...toCosmiconfig('syncpack')];
7
+ const packageJsonPath = manifest => get(manifest, 'syncpack');
6
8
  export default {
7
9
  title,
8
10
  enablers,
9
11
  isEnabled,
10
12
  config,
13
+ packageJsonPath,
11
14
  };
@@ -3,7 +3,7 @@ import { toProductionEntryPattern } from '#p/util/protocols.js';
3
3
  const title = 'tsup';
4
4
  const enablers = ['tsup'];
5
5
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
6
- const config = ['tsup.config.{js,ts,cjs,json}', 'package.json'];
6
+ const config = ['tsup.config.{js,ts,cjs,mjs,json}', 'package.json'];
7
7
  const resolveConfig = async (config) => {
8
8
  if (typeof config === 'function')
9
9
  config = await config({});
@@ -4,10 +4,10 @@ const enablers = ['typedoc'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
5
  const packageJsonPath = 'typedocOptions';
6
6
  const config = [
7
- 'typedoc.{js,cjs,json,jsonc}',
8
- 'typedoc.config.{js,cjs}',
9
- '.config/typedoc.{js,cjs,json,jsonc}',
10
- '.config/typedoc.config.{js,cjs}',
7
+ 'typedoc.{js,cjs,mjs,json,jsonc}',
8
+ 'typedoc.config.{js,cjs,mjs}',
9
+ '.config/typedoc.{js,cjs,mjs,json,jsonc}',
10
+ '.config/typedoc.config.{js,cjs,mjs}',
11
11
  'package.json',
12
12
  'tsconfig.json',
13
13
  ];
@@ -1,9 +1,10 @@
1
1
  import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
+ import type { UnbuildConfig } from './types.js';
2
3
  declare const _default: {
3
4
  title: string;
4
5
  enablers: string[];
5
6
  isEnabled: IsPluginEnabled;
6
7
  config: string[];
7
- resolveConfig: ResolveConfig<any>;
8
+ resolveConfig: ResolveConfig<UnbuildConfig>;
8
9
  };
9
10
  export default _default;
@@ -1,8 +1,8 @@
1
- import { hasDependency } from '#p/util/plugin.js';
1
+ import { hasDependency, toUnconfig } from '#p/util/plugin.js';
2
2
  const title = 'UnoCSS';
3
3
  const enablers = ['unocss'];
4
4
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
5
- const config = ['uno.config.{js,ts,mjs,mts}', 'unocss.config.{js,ts,mjs,mts}'];
5
+ const config = [...toUnconfig('uno.config'), ...toUnconfig('unocss.config')];
6
6
  export default {
7
7
  title,
8
8
  enablers,
@@ -1,3 +1,3 @@
1
1
  import type { ViteConfig } from './types.js';
2
- export declare const getEnvPackageName: (env: string) => any;
3
- export declare const getExternalReporters: (reporters?: ViteConfig["test"]["reporters"]) => any;
2
+ export declare const getEnvPackageName: (env: string) => string;
3
+ export declare const getExternalReporters: (reporters?: ViteConfig["test"]["reporters"]) => string[];
@@ -3,7 +3,10 @@ import type { WebpackConfig } from './types.js';
3
3
  export declare const findWebpackDependenciesFromConfig: ({ config, cwd }: {
4
4
  config: WebpackConfig;
5
5
  cwd: string;
6
- }) => unknown;
6
+ }) => Promise<{
7
+ dependencies: Set<string>;
8
+ entryPatterns: Set<string>;
9
+ }>;
7
10
  declare const _default: {
8
11
  title: string;
9
12
  enablers: string[];
@@ -1,12 +1,11 @@
1
1
  import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
+ import type { WireitConfig } from './types.js';
2
3
  declare const _default: {
3
4
  title: string;
4
5
  enablers: string[];
5
6
  isEnabled: IsPluginEnabled;
6
7
  packageJsonPath: string;
7
8
  config: string[];
8
- resolveConfig: ResolveConfig<Record<string, {
9
- command?: string;
10
- }>>;
9
+ resolveConfig: ResolveConfig<WireitConfig>;
11
10
  };
12
11
  export default _default;
@@ -4,8 +4,8 @@ const title = 'xo';
4
4
  const enablers = ['xo'];
5
5
  const isEnabled = ({ dependencies, config }) => hasDependency(dependencies, enablers) || 'xo' in config;
6
6
  const packageJsonPath = 'xo';
7
- const config = ['{.,}xo-config.{js,cjs,json,}', 'package.json'];
8
- const entry = ['{.,}xo-config.{js,cjs}'];
7
+ const config = ['package.json', '.xo-config', '.xo-config.{js,cjs,json}', 'xo.config.{js,cjs}'];
8
+ const entry = ['.xo-config.{js,cjs}', 'xo.config.{js,cjs}'];
9
9
  const resolveConfig = async (config, options) => {
10
10
  const dependencies = await getDependenciesDeep(config, options);
11
11
  return [...dependencies];