knip 6.46.0 → 6.47.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.
- package/dist/ConfigurationChief.d.ts +2 -0
- package/dist/IssueFixer.js +2 -6
- package/dist/WorkspaceWorker.d.ts +1 -0
- package/dist/WorkspaceWorker.js +10 -6
- package/dist/compilers/mdx.js +7 -1
- package/dist/plugins/angular/helpers.d.ts +7 -0
- package/dist/plugins/angular/helpers.js +58 -0
- package/dist/plugins/angular/index.js +5 -50
- package/dist/plugins/angular/types.d.ts +2 -2
- package/dist/plugins/astro/index.js +6 -1
- package/dist/plugins/astro-og-canvas/index.js +1 -1
- package/dist/plugins/capacitor/index.js +1 -1
- package/dist/plugins/cucumber/index.js +19 -7
- package/dist/plugins/cucumber/types.d.ts +1 -0
- package/dist/plugins/cypress/index.js +5 -0
- package/dist/plugins/docusaurus/helpers.js +2 -2
- package/dist/plugins/drizzle/index.js +5 -0
- package/dist/plugins/github-action/index.js +13 -3
- package/dist/plugins/github-actions/index.d.ts +2 -1
- package/dist/plugins/github-actions/index.js +4 -2
- package/dist/plugins/github-actions/types.d.ts +5 -0
- package/dist/plugins/index.d.ts +2 -0
- package/dist/plugins/index.js +4 -0
- package/dist/plugins/mocha/index.js +6 -0
- package/dist/plugins/mocha/types.d.ts +3 -0
- package/dist/plugins/netlify/index.js +1 -1
- package/dist/plugins/node/index.d.ts +2 -2
- package/dist/plugins/node/index.js +14 -3
- package/dist/plugins/nx/index.js +14 -1
- package/dist/plugins/oclif/index.js +3 -1
- package/dist/plugins/plop/index.js +4 -0
- package/dist/plugins/prisma/index.js +2 -0
- package/dist/plugins/quasar/resolveFromAST.js +2 -2
- package/dist/plugins/react-native/index.js +1 -1
- package/dist/plugins/rollup/index.js +1 -1
- package/dist/plugins/sst/resolveFromAST.js +24 -15
- package/dist/plugins/start-server-and-test/index.d.ts +3 -0
- package/dist/plugins/start-server-and-test/index.js +10 -0
- package/dist/plugins/swc/index.js +7 -4
- package/dist/plugins/trigger-dev/index.d.ts +3 -0
- package/dist/plugins/trigger-dev/index.js +28 -0
- package/dist/plugins/tsx/index.js +1 -1
- package/dist/plugins/typedoc/index.js +5 -2
- package/dist/plugins/typescript/index.d.ts +12 -1
- package/dist/plugins/typescript/index.js +6 -3
- package/dist/plugins/vite-plus/index.d.ts +4 -1
- package/dist/plugins/vite-plus/index.js +19 -4
- package/dist/plugins/vite-plus/types.d.ts +12 -0
- package/dist/plugins/vite-plus/types.js +1 -0
- package/dist/plugins/vitepress/index.js +14 -0
- package/dist/plugins/vitest/index.js +5 -0
- package/dist/plugins/vitest/types.d.ts +2 -1
- package/dist/plugins/web-test-runner/index.js +8 -2
- package/dist/plugins/webpack/index.js +5 -7
- package/dist/plugins/wrangler/index.js +4 -0
- package/dist/session/index.d.ts +1 -0
- package/dist/session/index.js +1 -0
- package/dist/types/PluginNames.d.ts +2 -2
- package/dist/types/PluginNames.js +2 -0
- package/dist/util/create-input-handler.js +3 -1
- package/dist/util/remove-export.d.ts +1 -0
- package/dist/util/remove-export.js +2 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/schema.json +8 -0
- package/dist/plugins/vite-plus/resolveFromAST.d.ts +0 -2
- package/dist/plugins/vite-plus/resolveFromAST.js +0 -37
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'aws-cdk' | 'babel' | 'biome' | 'borp' | 'buf' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-builder' | 'electron-forge' | 'electron-vite' | 'eleventy' | 'ember' | 'ember-template-lint' | 'env-cmd' | 'esbuild' | 'eslint' | 'evalite' | 'eve' | 'execa' | 'expo' | 'expo-router' | 'expressive-code' | 'fast' | 'filesystem-routing' | 'flue' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jasmine' | 'jest' | 'karma' | 'knex' | 'kysely-codegen' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lingui' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'maestro' | 'markdownlint' | 'marko' | 'mastra' | 'mcp' | 'mdx' | 'mdxlint' | 'metro' | 'mikro-orm' | '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' | 'osls' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'pre-commit' | 'preconstruct' | 'prettier' | 'prisma' | 'purgecss' | 'quasar' | 'qwik' | 'railway' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'retry-cli' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rslint' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'solidjs-vite-plugin' | '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' | 'tsrs' | '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' | 'web-test-runner' | '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', 'aws-cdk', 'babel', 'biome', 'borp', 'buf', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-builder', 'electron-forge', 'electron-vite', 'eleventy', 'ember', 'ember-template-lint', 'env-cmd', 'esbuild', 'eslint', 'evalite', 'eve', 'execa', 'expo', 'expo-router', 'expressive-code', 'fast', 'filesystem-routing', 'flue', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jasmine', 'jest', 'karma', 'knex', 'kysely-codegen', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lingui', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'maestro', 'markdownlint', 'marko', 'mastra', 'mcp', 'mdx', 'mdxlint', 'metro', 'mikro-orm', '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', 'osls', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'pre-commit', 'preconstruct', 'prettier', 'prisma', 'purgecss', 'quasar', 'qwik', 'railway', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'retry-cli', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rslint', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'solidjs-vite-plugin', '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', 'tsrs', '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', 'web-test-runner', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
|
|
1
|
+
export type PluginName = 'angular' | 'astro' | 'astro-db' | 'astro-markdoc' | 'astro-og-canvas' | 'ava' | 'aws-cdk' | 'babel' | 'biome' | 'borp' | 'buf' | 'bumpp' | 'bun' | 'c8' | 'capacitor' | 'catalyst' | 'changelogen' | 'changelogithub' | 'changesets' | 'commitizen' | 'commitlint' | 'convex' | 'create-typescript-app' | 'cspell' | 'cucumber' | 'cypress' | 'danger' | 'dependency-cruiser' | 'docusaurus' | 'dotenv' | 'drizzle' | 'electron-builder' | 'electron-forge' | 'electron-vite' | 'eleventy' | 'ember' | 'ember-template-lint' | 'env-cmd' | 'esbuild' | 'eslint' | 'evalite' | 'eve' | 'execa' | 'expo' | 'expo-router' | 'expressive-code' | 'fast' | 'filesystem-routing' | 'flue' | 'fumadocs' | 'gatsby' | 'github-action' | 'github-actions' | 'glob' | 'graphql-codegen' | 'hardhat' | 'husky' | 'i18next-parser' | 'jasmine' | 'jest' | 'karma' | 'knex' | 'kysely-codegen' | 'ladle' | 'laravel-vite-plugin' | 'lefthook' | 'lingui' | 'lint-staged' | 'linthtml' | 'lit' | 'lockfile-lint' | 'lost-pixel' | 'lunaria' | 'maestro' | 'markdownlint' | 'marko' | 'mastra' | 'mcp' | 'mdx' | 'mdxlint' | 'metro' | 'mikro-orm' | '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' | 'osls' | 'oxfmt' | 'oxlint' | 'panda-css' | 'parcel' | 'payload' | 'pino' | 'playwright' | 'playwright-ct' | 'playwright-test' | 'plop' | 'pm2' | 'pnpm' | 'postcss' | 'pre-commit' | 'preconstruct' | 'prettier' | 'prisma' | 'purgecss' | 'quasar' | 'qwik' | 'railway' | 'raycast' | 'react-cosmos' | 'react-email' | 'react-native' | 'react-router' | 'relay' | 'release-it' | 'remark' | 'remix' | 'retry-cli' | 'rolldown' | 'rollup' | 'rsbuild' | 'rslib' | 'rslint' | 'rspack' | 'rstest' | 'sanity' | 'semantic-release' | 'sentry' | 'serverless-framework' | 'simple-git-hooks' | 'size-limit' | 'solidjs-vite-plugin' | 'sst' | 'starlight' | 'start-server-and-test' | 'stencil' | 'storybook' | 'stryker' | 'stylelint' | 'svelte' | 'sveltejs-package' | 'sveltekit' | 'svgo' | 'svgr' | 'swc' | 'syncpack' | 'tailwind' | 'tanstack-router' | 'taskfile' | 'tauri' | 'temporal' | 'textlint' | 'travis' | 'trigger-dev' | 'ts-node' | 'tsd' | 'tsdown' | 'tsrs' | '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' | 'web-test-runner' | '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', 'aws-cdk', 'babel', 'biome', 'borp', 'buf', 'bumpp', 'bun', 'c8', 'capacitor', 'catalyst', 'changelogen', 'changelogithub', 'changesets', 'commitizen', 'commitlint', 'convex', 'create-typescript-app', 'cspell', 'cucumber', 'cypress', 'danger', 'dependency-cruiser', 'docusaurus', 'dotenv', 'drizzle', 'electron-builder', 'electron-forge', 'electron-vite', 'eleventy', 'ember', 'ember-template-lint', 'env-cmd', 'esbuild', 'eslint', 'evalite', 'eve', 'execa', 'expo', 'expo-router', 'expressive-code', 'fast', 'filesystem-routing', 'flue', 'fumadocs', 'gatsby', 'github-action', 'github-actions', 'glob', 'graphql-codegen', 'hardhat', 'husky', 'i18next-parser', 'jasmine', 'jest', 'karma', 'knex', 'kysely-codegen', 'ladle', 'laravel-vite-plugin', 'lefthook', 'lingui', 'lint-staged', 'linthtml', 'lit', 'lockfile-lint', 'lost-pixel', 'lunaria', 'maestro', 'markdownlint', 'marko', 'mastra', 'mcp', 'mdx', 'mdxlint', 'metro', 'mikro-orm', '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', 'osls', 'oxfmt', 'oxlint', 'panda-css', 'parcel', 'payload', 'pino', 'playwright', 'playwright-ct', 'playwright-test', 'plop', 'pm2', 'pnpm', 'postcss', 'pre-commit', 'preconstruct', 'prettier', 'prisma', 'purgecss', 'quasar', 'qwik', 'railway', 'raycast', 'react-cosmos', 'react-email', 'react-native', 'react-router', 'relay', 'release-it', 'remark', 'remix', 'retry-cli', 'rolldown', 'rollup', 'rsbuild', 'rslib', 'rslint', 'rspack', 'rstest', 'sanity', 'semantic-release', 'sentry', 'serverless-framework', 'simple-git-hooks', 'size-limit', 'solidjs-vite-plugin', 'sst', 'starlight', 'start-server-and-test', 'stencil', 'storybook', 'stryker', 'stylelint', 'svelte', 'sveltejs-package', 'sveltekit', 'svgo', 'svgr', 'swc', 'syncpack', 'tailwind', 'tanstack-router', 'taskfile', 'tauri', 'temporal', 'textlint', 'travis', 'trigger-dev', 'ts-node', 'tsd', 'tsdown', 'tsrs', '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', 'web-test-runner', 'webdriver-io', 'webpack', 'wireit', 'wrangler', 'wxt', 'xo', 'yarn', 'yorkie', 'zx'];
|
|
@@ -153,6 +153,7 @@ export const pluginNames = [
|
|
|
153
153
|
'solidjs-vite-plugin',
|
|
154
154
|
'sst',
|
|
155
155
|
'starlight',
|
|
156
|
+
'start-server-and-test',
|
|
156
157
|
'stencil',
|
|
157
158
|
'storybook',
|
|
158
159
|
'stryker',
|
|
@@ -171,6 +172,7 @@ export const pluginNames = [
|
|
|
171
172
|
'temporal',
|
|
172
173
|
'textlint',
|
|
173
174
|
'travis',
|
|
175
|
+
'trigger-dev',
|
|
174
176
|
'ts-node',
|
|
175
177
|
'tsd',
|
|
176
178
|
'tsdown',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { IGNORED_GLOBAL_BINARIES } from '../constants.js';
|
|
2
2
|
import { debugLog } from './debug.js';
|
|
3
|
+
import { isFile } from './fs.js';
|
|
3
4
|
import { fromBinary, isConfig, isDeferResolveEntry, toDebugString } from './input.js';
|
|
4
5
|
import { getPackageNameFromFilePath, getPackageNameFromSpecifier } from './modules.js';
|
|
5
6
|
import { dirname, isAbsolute, isInNodeModules, isInternal, join } from './path.js';
|
|
@@ -113,8 +114,9 @@ export const createInputHandler = (deputy, chief, isGitIgnored, addIssue, extern
|
|
|
113
114
|
};
|
|
114
115
|
const handlePackageOrFile = (input, containingFilePath, workspace) => {
|
|
115
116
|
const packageName = getPackageNameFromSpecifier(input.specifier);
|
|
116
|
-
if (!packageName)
|
|
117
|
+
if (!packageName || (isConfig(input) && isFile(input.dir ?? dirname(containingFilePath), input.specifier))) {
|
|
117
118
|
return handleFile(input, containingFilePath, workspace);
|
|
119
|
+
}
|
|
118
120
|
const inputWorkspace = getWorkspaceFor(input, containingFilePath, workspace);
|
|
119
121
|
const isWorkspace = chief.findWorkspaceByPackageName(packageName, containingFilePath) !== undefined;
|
|
120
122
|
if (!isWorkspace)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { FIX_FLAGS } from '../constants.js';
|
|
2
2
|
const importAttributesMatcher = /^(?:\s*with|[^\S\r\n\u2028\u2029]*assert)\s*\{[^}]*\}/;
|
|
3
|
+
const MODULE_MARKER = /^[ \t]*(import|export)\b/m;
|
|
4
|
+
export const keepModuleMarker = (source, text) => MODULE_MARKER.test(source) && !MODULE_MARKER.test(text) ? `${text.trimEnd()}\n\nexport {};\n` : text;
|
|
3
5
|
const getOpeningBracketIndex = (text) => {
|
|
4
6
|
let bracketOpenIndex = -1;
|
|
5
7
|
let j = text.length - 1;
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "6.
|
|
1
|
+
export declare const version = "6.47.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '6.
|
|
1
|
+
export const version = '6.47.0';
|
package/package.json
CHANGED
package/schema.json
CHANGED
|
@@ -1043,6 +1043,10 @@
|
|
|
1043
1043
|
"title": "starlight plugin configuration (https://knip.dev/reference/plugins/starlight)",
|
|
1044
1044
|
"$ref": "#/definitions/plugin"
|
|
1045
1045
|
},
|
|
1046
|
+
"start-server-and-test": {
|
|
1047
|
+
"title": "start-server-and-test plugin configuration (https://knip.dev/reference/plugins/start-server-and-test)",
|
|
1048
|
+
"$ref": "#/definitions/plugin"
|
|
1049
|
+
},
|
|
1046
1050
|
"stencil": {
|
|
1047
1051
|
"title": "stencil plugin configuration (https://knip.dev/reference/plugins/stencil)",
|
|
1048
1052
|
"$ref": "#/definitions/plugin"
|
|
@@ -1115,6 +1119,10 @@
|
|
|
1115
1119
|
"title": "travis plugin configuration (https://knip.dev/reference/plugins/travis)",
|
|
1116
1120
|
"$ref": "#/definitions/plugin"
|
|
1117
1121
|
},
|
|
1122
|
+
"trigger-dev": {
|
|
1123
|
+
"title": "trigger-dev plugin configuration (https://knip.dev/reference/plugins/trigger-dev)",
|
|
1124
|
+
"$ref": "#/definitions/plugin"
|
|
1125
|
+
},
|
|
1118
1126
|
"ts-node": {
|
|
1119
1127
|
"title": "ts-node plugin configuration (https://knip.dev/reference/plugins/ts-node)",
|
|
1120
1128
|
"$ref": "#/definitions/plugin"
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { Visitor } from 'oxc-parser';
|
|
2
|
-
import { findProperty, getPropertyValues } from '../../typescript/ast-helpers.js';
|
|
3
|
-
import { getStringValue } from '../../typescript/ast-nodes.js';
|
|
4
|
-
export const resolveFromAST = (program, options) => {
|
|
5
|
-
const commands = [];
|
|
6
|
-
const visitor = new Visitor({
|
|
7
|
-
ObjectExpression(node) {
|
|
8
|
-
const run = findProperty(node, 'run');
|
|
9
|
-
const tasks = run?.type === 'ObjectExpression' ? findProperty(run, 'tasks') : undefined;
|
|
10
|
-
if (tasks?.type === 'ObjectExpression') {
|
|
11
|
-
for (const task of tasks.properties ?? []) {
|
|
12
|
-
if (task.type === 'Property' && task.value?.type === 'ObjectExpression') {
|
|
13
|
-
for (const command of getPropertyValues(task.value, 'command'))
|
|
14
|
-
commands.push(command);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
const staged = findProperty(node, 'staged');
|
|
19
|
-
if (staged?.type === 'ObjectExpression') {
|
|
20
|
-
for (const prop of staged.properties ?? []) {
|
|
21
|
-
if (prop.type === 'Property') {
|
|
22
|
-
const command = getStringValue(prop.value);
|
|
23
|
-
if (command)
|
|
24
|
-
commands.push(command);
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
});
|
|
30
|
-
visitor.visit(program);
|
|
31
|
-
const inputs = [];
|
|
32
|
-
for (const command of commands) {
|
|
33
|
-
for (const input of options.getInputsFromScripts(command, { optionalBinaries: true }))
|
|
34
|
-
inputs.push(input);
|
|
35
|
-
}
|
|
36
|
-
return inputs;
|
|
37
|
-
};
|