knip 5.1.3 → 5.1.5

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 (39) hide show
  1. package/dist/plugins/astro/index.d.ts +6 -6
  2. package/dist/plugins/ava/index.d.ts +7 -7
  3. package/dist/plugins/capacitor/index.d.ts +5 -5
  4. package/dist/plugins/changesets/index.d.ts +5 -5
  5. package/dist/plugins/commitizen/index.d.ts +6 -6
  6. package/dist/plugins/commitlint/index.d.ts +5 -5
  7. package/dist/plugins/cspell/index.d.ts +5 -5
  8. package/dist/plugins/drizzle/index.d.ts +5 -5
  9. package/dist/plugins/eslint/index.d.ts +7 -7
  10. package/dist/plugins/graphql-codegen/index.d.ts +6 -6
  11. package/dist/plugins/lint-staged/index.d.ts +6 -6
  12. package/dist/plugins/linthtml/index.d.ts +6 -6
  13. package/dist/plugins/markdownlint/index.d.ts +5 -5
  14. package/dist/plugins/mocha/index.d.ts +7 -7
  15. package/dist/plugins/msw/index.d.ts +1 -1
  16. package/dist/plugins/msw/index.js +3 -3
  17. package/dist/plugins/npm-package-json-lint/index.d.ts +6 -6
  18. package/dist/plugins/nyc/index.d.ts +5 -5
  19. package/dist/plugins/postcss/index.d.ts +5 -5
  20. package/dist/plugins/prettier/index.d.ts +5 -5
  21. package/dist/plugins/release-it/index.d.ts +6 -6
  22. package/dist/plugins/remark/index.d.ts +6 -6
  23. package/dist/plugins/rollup/index.d.ts +4 -4
  24. package/dist/plugins/semantic-release/index.d.ts +6 -6
  25. package/dist/plugins/storybook/index.d.ts +8 -8
  26. package/dist/plugins/stryker/index.d.ts +5 -5
  27. package/dist/plugins/stylelint/index.d.ts +5 -5
  28. package/dist/plugins/tsup/index.d.ts +5 -5
  29. package/dist/plugins/typedoc/index.d.ts +6 -6
  30. package/dist/plugins/unbuild/index.d.ts +5 -5
  31. package/dist/plugins/vue/index.d.ts +5 -5
  32. package/dist/plugins/wireit/index.d.ts +6 -6
  33. package/dist/plugins/yorkie/index.d.ts +6 -6
  34. package/dist/typescript/SourceFileManager.js +10 -6
  35. package/dist/typescript/createHosts.js +2 -2
  36. package/dist/typescript/getImportsAndExports.js +6 -4
  37. package/dist/version.d.ts +1 -1
  38. package/dist/version.js +1 -1
  39. package/package.json +1 -1
@@ -1,10 +1,10 @@
1
1
  import type { IsPluginEnabled, Resolve } from '#p/types/plugins.js';
2
2
  declare const _default: {
3
- readonly title: "Astro";
4
- readonly enablers: string[];
5
- readonly isEnabled: IsPluginEnabled;
6
- readonly entry: string[];
7
- readonly production: string[];
8
- readonly resolve: Resolve;
3
+ title: string;
4
+ enablers: string[];
5
+ isEnabled: IsPluginEnabled;
6
+ entry: string[];
7
+ production: string[];
8
+ resolve: Resolve;
9
9
  };
10
10
  export default _default;
@@ -1,12 +1,12 @@
1
1
  import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
2
2
  import type { AvaConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Ava";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly entry: string[];
9
- readonly resolveEntryPaths: ResolveEntryPaths<AvaConfig>;
10
- readonly resolveConfig: ResolveConfig<AvaConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ entry: string[];
9
+ resolveEntryPaths: ResolveEntryPaths<AvaConfig>;
10
+ resolveConfig: ResolveConfig<AvaConfig>;
11
11
  };
12
12
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
2
  import type { CapacitorConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Capacitor";
5
- readonly enablers: RegExp[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<CapacitorConfig>;
4
+ title: string;
5
+ enablers: RegExp[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<CapacitorConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
2
  import type { ChangesetsConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Changesets";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<ChangesetsConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<ChangesetsConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
2
  import type { CommitizenConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Commitizen";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "config.commitizen";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<CommitizenConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<CommitizenConfig>;
10
10
  };
11
11
  export default _default;
@@ -3,10 +3,10 @@ type CommitLintConfig = {
3
3
  extends: string[];
4
4
  };
5
5
  declare const _default: {
6
- readonly title: "commitlint";
7
- readonly enablers: string[];
8
- readonly isEnabled: IsPluginEnabled;
9
- readonly config: string[];
10
- readonly resolveConfig: ResolveConfig<CommitLintConfig>;
6
+ title: string;
7
+ enablers: string[];
8
+ isEnabled: IsPluginEnabled;
9
+ config: string[];
10
+ resolveConfig: ResolveConfig<CommitLintConfig>;
11
11
  };
12
12
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { CSpellConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "CSpell";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<CSpellConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<CSpellConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { DrizzleConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Drizzle";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<DrizzleConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<DrizzleConfig>;
9
9
  };
10
10
  export default _default;
@@ -2,12 +2,12 @@ import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
2
  import type { ESLintConfig } from './types.js';
3
3
  export declare const packageJsonPath = "eslintConfig";
4
4
  declare const _default: {
5
- readonly title: "ESLint";
6
- readonly enablers: string[];
7
- readonly isEnabled: IsPluginEnabled;
8
- readonly packageJsonPath: "eslintConfig";
9
- readonly entry: string[];
10
- readonly config: string[];
11
- readonly resolveConfig: ResolveConfig<ESLintConfig>;
5
+ title: string;
6
+ enablers: string[];
7
+ isEnabled: IsPluginEnabled;
8
+ packageJsonPath: string;
9
+ entry: string[];
10
+ config: string[];
11
+ resolveConfig: ResolveConfig<ESLintConfig>;
12
12
  };
13
13
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { GraphqlCodegenTypes } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "GraphQL Codegen";
5
- readonly enablers: RegExp[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "codegen";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<GraphqlCodegenTypes>;
4
+ title: string;
5
+ enablers: RegExp[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<GraphqlCodegenTypes>;
10
10
  };
11
11
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { LintStagedConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "lint-staged";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "lint-staged";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<LintStagedConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<LintStagedConfig>;
10
10
  };
11
11
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { PluginConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "LintHTML";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "linthtmlConfig";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<PluginConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<PluginConfig>;
10
10
  };
11
11
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { MarkdownlintConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "markdownlint";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<MarkdownlintConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<MarkdownlintConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,12 +1,12 @@
1
1
  import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
2
2
  import type { MochaConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Mocha";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly entry: string[];
9
- readonly resolveConfig: ResolveConfig<MochaConfig>;
10
- readonly resolveEntryPaths: ResolveEntryPaths<MochaConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ entry: string[];
9
+ resolveConfig: ResolveConfig<MochaConfig>;
10
+ resolveEntryPaths: ResolveEntryPaths<MochaConfig>;
11
11
  };
12
12
  export default _default;
@@ -1,5 +1,5 @@
1
+ import type { IsPluginEnabled, ResolveEntryPaths } from '#p/types/plugins.js';
1
2
  import type { MSWConfig } from './types.js';
2
- import type { IsPluginEnabled, ResolveEntryPaths } from '../../types/plugins.js';
3
3
  declare const _default: {
4
4
  title: string;
5
5
  enablers: string[];
@@ -1,6 +1,6 @@
1
- import { join } from '../../util/path.js';
2
- import { hasDependency } from '../../util/plugin.js';
3
- import { toEntryPattern } from '../../util/protocols.js';
1
+ import { join } from '#p/util/path.js';
2
+ import { hasDependency } from '#p/util/plugin.js';
3
+ import { toEntryPattern } from '#p/util/protocols.js';
4
4
  const title = 'Mock Service Worker';
5
5
  const enablers = ['msw'];
6
6
  const isEnabled = ({ dependencies }) => hasDependency(dependencies, enablers);
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { NpmPkgJsonLintConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "npm-package-json-lint";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "npmpackagejsonlint";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<NpmPkgJsonLintConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<NpmPkgJsonLintConfig>;
10
10
  };
11
11
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { NycConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "nyc";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<NycConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<NycConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { PostCSSConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "PostCSS";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<PostCSSConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<PostCSSConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { PrettierConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Prettier";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<PrettierConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<PrettierConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { ReleaseItConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Release It";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "release-it";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<ReleaseItConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<ReleaseItConfig>;
10
10
  };
11
11
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { RemarkConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Remark";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "remarkConfig";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<RemarkConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<RemarkConfig>;
10
10
  };
11
11
  export default _default;
@@ -1,8 +1,8 @@
1
1
  import type { IsPluginEnabled } from '#p/types/plugins.js';
2
2
  declare const _default: {
3
- readonly title: "Rollup";
4
- readonly enablers: string[];
5
- readonly isEnabled: IsPluginEnabled;
6
- readonly entry: string[];
3
+ title: string;
4
+ enablers: string[];
5
+ isEnabled: IsPluginEnabled;
6
+ entry: string[];
7
7
  };
8
8
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { SemanticReleaseConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Semantic Release";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "release";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<SemanticReleaseConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<SemanticReleaseConfig>;
10
10
  };
11
11
  export default _default;
@@ -1,13 +1,13 @@
1
1
  import type { IsPluginEnabled, ResolveConfig, ResolveEntryPaths } from '#p/types/plugins.js';
2
2
  import type { StorybookConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Storybook";
5
- readonly enablers: (string | RegExp)[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly entry: string[];
9
- readonly project: string[];
10
- readonly resolveEntryPaths: ResolveEntryPaths<StorybookConfig>;
11
- readonly resolveConfig: ResolveConfig<StorybookConfig>;
4
+ title: string;
5
+ enablers: (string | RegExp)[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ entry: string[];
9
+ project: string[];
10
+ resolveEntryPaths: ResolveEntryPaths<StorybookConfig>;
11
+ resolveConfig: ResolveConfig<StorybookConfig>;
12
12
  };
13
13
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { StrykerConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Stryker";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<StrykerConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<StrykerConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { StyleLintConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Stylelint";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<StyleLintConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<StyleLintConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { TsupConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "tsup";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<TsupConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<TsupConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,12 +1,12 @@
1
1
  import type { IsPluginEnabled, ResolveConfig } from '#p/types/plugins.js';
2
2
  import type { TypeDocConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "TypeDoc";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "typedocOptions";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<TypeDocConfig | {
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<TypeDocConfig | {
10
10
  typedocOptions: TypeDocConfig;
11
11
  }>;
12
12
  };
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { UnbuildConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "unbuild";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<UnbuildConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<UnbuildConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,10 +1,10 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { VueConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Vue";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly config: string[];
8
- readonly resolveConfig: ResolveConfig<VueConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ config: string[];
8
+ resolveConfig: ResolveConfig<VueConfig>;
9
9
  };
10
10
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { WireitConfig } from './types.js';
3
3
  declare const _default: {
4
- readonly title: "Wireit";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "wireit";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<WireitConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<WireitConfig>;
10
10
  };
11
11
  export default _default;
@@ -1,11 +1,11 @@
1
1
  import type { ResolveConfig, IsPluginEnabled } from '#p/types/plugins.js';
2
2
  import type { LintStagedConfig } from '../lint-staged/types.js';
3
3
  declare const _default: {
4
- readonly title: "yorkie";
5
- readonly enablers: string[];
6
- readonly isEnabled: IsPluginEnabled;
7
- readonly packageJsonPath: "gitHooks";
8
- readonly config: string[];
9
- readonly resolveConfig: ResolveConfig<LintStagedConfig>;
4
+ title: string;
5
+ enablers: string[];
6
+ isEnabled: IsPluginEnabled;
7
+ packageJsonPath: string;
8
+ config: string[];
9
+ resolveConfig: ResolveConfig<LintStagedConfig>;
10
10
  };
11
11
  export default _default;
@@ -2,6 +2,7 @@ import ts from 'typescript';
2
2
  import { FOREIGN_FILE_EXTENSIONS } from '../constants.js';
3
3
  import { debugLog } from '../util/debug.js';
4
4
  import { extname, isInNodeModules, isInternal } from '../util/path.js';
5
+ import { isDeclarationFileExtension } from './ast-helpers.js';
5
6
  export class SourceFileManager {
6
7
  isSkipLibs;
7
8
  sourceFileCache = new Map();
@@ -20,10 +21,15 @@ export class SourceFileManager {
20
21
  return sourceFile;
21
22
  }
22
23
  getSourceFile(filePath) {
23
- if (FOREIGN_FILE_EXTENSIONS.has(extname(filePath)))
24
- return undefined;
25
- if (this.isSkipLibs && isInNodeModules(filePath))
24
+ const ext = extname(filePath);
25
+ const compiler = this.syncCompilers.get(ext);
26
+ if (FOREIGN_FILE_EXTENSIONS.has(ext) && !compiler)
26
27
  return undefined;
28
+ if (this.isSkipLibs && isInNodeModules(filePath)) {
29
+ if (isDeclarationFileExtension(ext))
30
+ return undefined;
31
+ return this.createSourceFile(filePath, '');
32
+ }
27
33
  if (this.sourceFileCache.has(filePath))
28
34
  return this.sourceFileCache.get(filePath);
29
35
  const contents = ts.sys.readFile(filePath);
@@ -32,8 +38,6 @@ export class SourceFileManager {
32
38
  debugLog('*', `Unable to read ${filePath}`);
33
39
  return this.createSourceFile(filePath, '');
34
40
  }
35
- const ext = extname(filePath);
36
- const compiler = this.syncCompilers?.get(ext);
37
41
  const compiled = compiler ? compiler(contents, filePath) : contents;
38
42
  if (compiler)
39
43
  debugLog('*', `Compiled ${filePath}`);
@@ -54,7 +58,7 @@ export class SourceFileManager {
54
58
  if (typeof contents !== 'string')
55
59
  throw new Error(`Unable to read ${filePath}`);
56
60
  const ext = extname(filePath);
57
- const compiler = this.asyncCompilers?.get(ext);
61
+ const compiler = this.asyncCompilers.get(ext);
58
62
  if (compiler) {
59
63
  const compiled = await compiler(contents, filePath);
60
64
  debugLog('*', `Compiled ${filePath}`);
@@ -9,8 +9,8 @@ import { createCustomSys } from './sys.js';
9
9
  const libLocation = path.dirname(ts.getDefaultLibFilePath({}));
10
10
  export const createHosts = ({ cwd, compilerOptions, entryPaths, compilers, isSkipLibs }) => {
11
11
  const fileManager = new SourceFileManager({ compilers, isSkipLibs });
12
- const compilerExtensions = [...getCompilerExtensions(compilers), ...FOREIGN_FILE_EXTENSIONS];
13
- const sys = createCustomSys(cwd, compilerExtensions);
12
+ const compilerExtensions = getCompilerExtensions(compilers);
13
+ const sys = createCustomSys(cwd, [...compilerExtensions, ...FOREIGN_FILE_EXTENSIONS]);
14
14
  const resolveModuleNames = createCustomModuleResolver(sys, compilerOptions, compilerExtensions);
15
15
  const languageServiceHost = {
16
16
  getCompilationSettings: () => compilerOptions,
@@ -290,10 +290,12 @@ const getImportsAndExports = (sourceFile, getResolvedModule, typeChecker, option
290
290
  return;
291
291
  for (const match of sourceFile.text.matchAll(new RegExp(item.identifier.replace(/\$/g, '\\$'), 'g'))) {
292
292
  const isDeclaration = match.index === item.pos || match.index === item.pos + 1;
293
- if (!isDeclaration &&
294
- typeChecker.getSymbolAtLocation(ts.getTokenAtPosition(sourceFile, match.index)) === item.symbol) {
295
- item.refs = 1;
296
- break;
293
+ if (!isDeclaration) {
294
+ const smbl = typeChecker.getSymbolAtLocation(ts.getTokenAtPosition(sourceFile, match.index));
295
+ if (smbl && (item.symbol === smbl || item.symbol === smbl.declarations?.[0]?.name?.flowNode?.node?.symbol)) {
296
+ item.refs = 1;
297
+ break;
298
+ }
297
299
  }
298
300
  }
299
301
  };
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const version = "5.1.3";
1
+ export declare const version = "5.1.5";
package/dist/version.js CHANGED
@@ -1 +1 @@
1
- export const version = '5.1.3';
1
+ export const version = '5.1.5';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "knip",
3
- "version": "5.1.3",
3
+ "version": "5.1.5",
4
4
  "description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
5
5
  "homepage": "https://knip.dev",
6
6
  "repository": {