knip 2.0.0-beta.1 → 2.0.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/README.md +114 -64
- package/dist/binaries/resolvers/fallback.js +6 -5
- package/dist/binaries/resolvers/index.d.ts +1 -0
- package/dist/binaries/resolvers/index.js +1 -0
- package/dist/binaries/resolvers/node.d.ts +0 -1
- package/dist/binaries/resolvers/node.js +1 -15
- package/dist/binaries/resolvers/rollup.js +10 -0
- package/dist/binaries/resolvers/util.d.ts +2 -0
- package/dist/binaries/resolvers/util.js +15 -0
- package/dist/cli.js +0 -0
- package/dist/configuration-chief.js +3 -5
- package/dist/configuration-validator.d.ts +400 -8
- package/dist/configuration-validator.js +7 -0
- package/dist/plugins/eslint/helpers.js +9 -9
- package/dist/plugins/index.d.ts +1 -0
- package/dist/plugins/index.js +1 -0
- package/dist/plugins/tailwind/index.d.ts +5 -0
- package/dist/plugins/tailwind/index.js +5 -0
- package/dist/project-principal.js +0 -2
- package/dist/types/ast.d.ts +1 -1
- package/dist/types/issues.d.ts +9 -1
- package/dist/types/issues.js +10 -1
- package/dist/typescript/ast-walker.js +17 -16
- package/dist/typescript/resolveModuleNames.js +0 -4
- package/dist/util/cli-arguments.d.ts +1 -2
- package/dist/util/cli-arguments.js +1 -3
- package/dist/util/compilers.d.ts +72 -2
- package/dist/util/performance.js +1 -1
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/workspace-worker.d.ts +1 -1
- package/package.json +12 -10
- package/schema.json +4 -0
- package/dist/commonjs.test.d.ts +0 -1
- package/dist/commonjs.test.js +0 -29
- package/dist/compilers.test.d.ts +0 -1
- package/dist/compilers.test.js +0 -18
- package/dist/definitely-typed.test.d.ts +0 -1
- package/dist/definitely-typed.test.js +0 -35
- package/dist/dependencies.test.d.ts +0 -1
- package/dist/dependencies.test.js +0 -76
- package/dist/entry-js.test.d.ts +0 -1
- package/dist/entry-js.test.js +0 -38
- package/dist/exports.test.d.ts +0 -1
- package/dist/exports.test.js +0 -48
- package/dist/fixtures/binaries/dir/index.d.ts +0 -1
- package/dist/fixtures/binaries/dir/index.js +0 -1
- package/dist/fixtures/binaries/main.d.ts +0 -1
- package/dist/fixtures/binaries/main.js +0 -1
- package/dist/fixtures/binaries/require.d.ts +0 -1
- package/dist/fixtures/binaries/require.js +0 -1
- package/dist/fixtures/binaries/script.d.ts +0 -1
- package/dist/fixtures/binaries/script.js +0 -1
- package/dist/fixtures/commonjs/dir/mod.d.ts +0 -1
- package/dist/fixtures/commonjs/dir/mod.js +0 -5
- package/dist/fixtures/commonjs/dir/mod1.d.ts +0 -7
- package/dist/fixtures/commonjs/dir/mod1.js +0 -5
- package/dist/fixtures/commonjs/dir/mod2.d.ts +0 -4
- package/dist/fixtures/commonjs/dir/mod2.js +0 -4
- package/dist/fixtures/commonjs/dir/mod3.d.ts +0 -2
- package/dist/fixtures/commonjs/dir/mod3.js +0 -4
- package/dist/fixtures/commonjs/export-is.d.ts +0 -2
- package/dist/fixtures/commonjs/export-is.js +0 -2
- package/dist/fixtures/commonjs/index.d.ts +0 -1
- package/dist/fixtures/commonjs/index.js +0 -31
- package/dist/fixtures/commonjs/odd.d.ts +0 -1
- package/dist/fixtures/commonjs/odd.js +0 -7
- package/dist/fixtures/compilers/component.d.ts +0 -2
- package/dist/fixtures/compilers/component.jsx +0 -1
- package/dist/fixtures/compilers/index.d.ts +0 -1
- package/dist/fixtures/compilers/index.js +0 -1
- package/dist/fixtures/compilers/knip.d.ts +0 -0
- package/dist/fixtures/compilers/knip.js +0 -7
- package/dist/fixtures/definitely-typed/index.d.ts +0 -1
- package/dist/fixtures/definitely-typed/index.js +0 -1
- package/dist/fixtures/dependencies/entry.d.ts +0 -1
- package/dist/fixtures/dependencies/entry.js +0 -6
- package/dist/fixtures/dependencies/my-module.d.ts +0 -3
- package/dist/fixtures/dependencies/my-module.js +0 -6
- package/dist/fixtures/dependencies/unused-module.d.ts +0 -1
- package/dist/fixtures/dependencies/unused-module.js +0 -6
- package/dist/fixtures/entry-js/dangling.d.ts +0 -1
- package/dist/fixtures/entry-js/dangling.js +0 -1
- package/dist/fixtures/entry-js/index.d.ts +0 -1
- package/dist/fixtures/entry-js/index.js +0 -2
- package/dist/fixtures/entry-js/my-module.d.ts +0 -4
- package/dist/fixtures/entry-js/my-module.js +0 -6
- package/dist/fixtures/entry-js/my-namespace.d.ts +0 -5
- package/dist/fixtures/entry-js/my-namespace.js +0 -3
- package/dist/fixtures/exports/dangling.d.ts +0 -1
- package/dist/fixtures/exports/dangling.js +0 -1
- package/dist/fixtures/exports/default-arrow-function.d.ts +0 -2
- package/dist/fixtures/exports/default-arrow-function.js +0 -1
- package/dist/fixtures/exports/default-class.d.ts +0 -2
- package/dist/fixtures/exports/default-class.js +0 -2
- package/dist/fixtures/exports/default-function.d.ts +0 -1
- package/dist/fixtures/exports/default-function.js +0 -1
- package/dist/fixtures/exports/default-generator-function.d.ts +0 -1
- package/dist/fixtures/exports/default-generator-function.js +0 -1
- package/dist/fixtures/exports/default-named-class.d.ts +0 -2
- package/dist/fixtures/exports/default-named-class.js +0 -2
- package/dist/fixtures/exports/default-named-function.d.ts +0 -1
- package/dist/fixtures/exports/default-named-function.js +0 -1
- package/dist/fixtures/exports/default-named-generator-function.d.ts +0 -1
- package/dist/fixtures/exports/default-named-generator-function.js +0 -1
- package/dist/fixtures/exports/default.d.ts +0 -3
- package/dist/fixtures/exports/default.js +0 -2
- package/dist/fixtures/exports/dynamic-import.d.ts +0 -4
- package/dist/fixtures/exports/dynamic-import.js +0 -3
- package/dist/fixtures/exports/index.d.ts +0 -2
- package/dist/fixtures/exports/index.js +0 -6
- package/dist/fixtures/exports/my-module.d.ts +0 -5
- package/dist/fixtures/exports/my-module.js +0 -7
- package/dist/fixtures/exports/my-namespace.d.ts +0 -5
- package/dist/fixtures/exports/my-namespace.js +0 -3
- package/dist/fixtures/exports/named.d.ts +0 -11
- package/dist/fixtures/exports/named.js +0 -11
- package/dist/fixtures/exports/types.d.ts +0 -9
- package/dist/fixtures/exports/types.js +0 -3
- package/dist/fixtures/gitignore/packages/a/build/dist.d.ts +0 -2
- package/dist/fixtures/gitignore/packages/a/build/dist.js +0 -1
- package/dist/fixtures/gitignore/packages/a/dist.d.ts +0 -1
- package/dist/fixtures/gitignore/packages/a/dist.js +0 -1
- package/dist/fixtures/gitignore/packages/a/index.d.ts +0 -1
- package/dist/fixtures/gitignore/packages/a/index.js +0 -1
- package/dist/fixtures/imports/dir/import-b.d.ts +0 -2
- package/dist/fixtures/imports/dir/import-b.js +0 -1
- package/dist/fixtures/imports/dir/mod.d.ts +0 -1
- package/dist/fixtures/imports/dir/mod.js +0 -1
- package/dist/fixtures/imports/index.d.ts +0 -1
- package/dist/fixtures/imports/index.js +0 -35
- package/dist/fixtures/js-only/dangling.d.ts +0 -1
- package/dist/fixtures/js-only/dangling.js +0 -1
- package/dist/fixtures/js-only/index.d.ts +0 -1
- package/dist/fixtures/js-only/index.js +0 -2
- package/dist/fixtures/js-only/my-namespace.d.ts +0 -3
- package/dist/fixtures/js-only/my-namespace.js +0 -3
- package/dist/fixtures/jsdoc/index.d.ts +0 -4
- package/dist/fixtures/jsdoc/index.js +0 -8
- package/dist/fixtures/members/index.d.ts +0 -1
- package/dist/fixtures/members/index.js +0 -16
- package/dist/fixtures/members/members.d.ts +0 -23
- package/dist/fixtures/members/members.js +0 -38
- package/dist/fixtures/namespace/index.d.ts +0 -1
- package/dist/fixtures/namespace/index.js +0 -5
- package/dist/fixtures/namespace/namespace.d.ts +0 -3
- package/dist/fixtures/namespace/namespace.js +0 -3
- package/dist/fixtures/namespace/re-exported-module.d.ts +0 -2
- package/dist/fixtures/namespace/re-exported-module.js +0 -2
- package/dist/fixtures/pathless/src/dir/module-a.d.ts +0 -2
- package/dist/fixtures/pathless/src/dir/module-a.js +0 -1
- package/dist/fixtures/pathless/src/index.d.ts +0 -2
- package/dist/fixtures/pathless/src/index.js +0 -2
- package/dist/fixtures/pathless/src/same.d.ts +0 -2
- package/dist/fixtures/pathless/src/same.js +0 -1
- package/dist/fixtures/paths-knip-config/abc/main.d.ts +0 -0
- package/dist/fixtures/paths-knip-config/abc/main.js +0 -1
- package/dist/fixtures/paths-knip-config/index.d.ts +0 -1
- package/dist/fixtures/paths-knip-config/index.js +0 -1
- package/dist/fixtures/paths-knip-config/knip.d.ts +0 -3
- package/dist/fixtures/paths-knip-config/knip.js +0 -9
- package/dist/fixtures/paths-knip-config/lib/fn.d.ts +0 -2
- package/dist/fixtures/paths-knip-config/lib/fn.js +0 -1
- package/dist/fixtures/paths-knip-config/lib/index.d.ts +0 -2
- package/dist/fixtures/paths-knip-config/lib/index.js +0 -1
- package/dist/fixtures/paths-knip-config/my-module.d.ts +0 -2
- package/dist/fixtures/paths-knip-config/my-module.js +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/index.d.ts +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/index.js +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/lib/fn.d.ts +0 -2
- package/dist/fixtures/paths-knip-config-workspaces/lib/fn.js +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/lib/index.d.ts +0 -2
- package/dist/fixtures/paths-knip-config-workspaces/lib/index.js +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/my-module.d.ts +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/my-module.js +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/ws/index.d.ts +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/ws/index.js +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/ws/lib/main.d.ts +0 -0
- package/dist/fixtures/paths-knip-config-workspaces/ws/lib/main.js +0 -1
- package/dist/fixtures/paths-knip-config-workspaces/ws/util/lang.d.ts +0 -2
- package/dist/fixtures/paths-knip-config-workspaces/ws/util/lang.js +0 -1
- package/dist/fixtures/peer-dependencies/index.d.ts +0 -1
- package/dist/fixtures/peer-dependencies/index.js +0 -1
- package/dist/fixtures/plugins/ava/ava.config.d.mts +0 -13
- package/dist/fixtures/plugins/ava/ava.config.mjs +0 -13
- package/dist/fixtures/plugins/babel/babel.config.d.ts +0 -14
- package/dist/fixtures/plugins/babel/babel.config.js +0 -47
- package/dist/fixtures/plugins/capacitor/capacitor.config.d.ts +0 -3
- package/dist/fixtures/plugins/capacitor/capacitor.config.js +0 -15
- package/dist/fixtures/plugins/commitlint/commitlint.config.d.ts +0 -2
- package/dist/fixtures/plugins/commitlint/commitlint.config.js +0 -2
- package/dist/fixtures/plugins/cypress/cypress/support/commands.d.ts +0 -1
- package/dist/fixtures/plugins/cypress/cypress/support/commands.js +0 -5
- package/dist/fixtures/plugins/cypress/cypress/support/e2e.d.ts +0 -2
- package/dist/fixtures/plugins/cypress/cypress/support/e2e.js +0 -2
- package/dist/fixtures/plugins/cypress/cypress.config.d.ts +0 -2
- package/dist/fixtures/plugins/cypress/cypress.config.js +0 -9
- package/dist/fixtures/plugins/eslint/eslint.config.d.ts +0 -7
- package/dist/fixtures/plugins/eslint/eslint.config.js +0 -11
- package/dist/fixtures/plugins/eslint/index.d.ts +0 -1
- package/dist/fixtures/plugins/eslint/index.js +0 -1
- package/dist/fixtures/plugins/gatsby/gatsby-config.d.ts +0 -17
- package/dist/fixtures/plugins/gatsby/gatsby-config.js +0 -40
- package/dist/fixtures/plugins/gatsby/gatsby-node.d.ts +0 -3
- package/dist/fixtures/plugins/gatsby/gatsby-node.js +0 -15
- package/dist/fixtures/plugins/github-actions/comment.d.ts +0 -0
- package/dist/fixtures/plugins/github-actions/comment.js +0 -1
- package/dist/fixtures/plugins/github-actions/scripts/check-dependencies.d.ts +0 -0
- package/dist/fixtures/plugins/github-actions/scripts/check-dependencies.js +0 -1
- package/dist/fixtures/plugins/jest/jest.config.d.ts +0 -2
- package/dist/fixtures/plugins/jest/jest.config.js +0 -7
- package/dist/fixtures/plugins/jest/jest.config.shared.d.ts +0 -2
- package/dist/fixtures/plugins/jest/jest.config.shared.js +0 -15
- package/dist/fixtures/plugins/jest/jest.setup.d.ts +0 -1
- package/dist/fixtures/plugins/jest/jest.setup.js +0 -1
- package/dist/fixtures/plugins/jest/jest.transform.d.ts +0 -1
- package/dist/fixtures/plugins/jest/jest.transform.js +0 -2
- package/dist/fixtures/plugins/lefthook/example.d.mts +0 -2
- package/dist/fixtures/plugins/lefthook/example.mjs +0 -1
- package/dist/fixtures/plugins/next/next.config.d.ts +0 -2
- package/dist/fixtures/plugins/next/next.config.js +0 -9
- package/dist/fixtures/plugins/next/pages/[[...route]].d.ts +0 -3
- package/dist/fixtures/plugins/next/pages/[[...route]].jsx +0 -3
- package/dist/fixtures/plugins/next/pages/page.d.ts +0 -3
- package/dist/fixtures/plugins/next/pages/page.jsx +0 -3
- package/dist/fixtures/plugins/playwright/playwright.config.d.ts +0 -3
- package/dist/fixtures/plugins/playwright/playwright.config.js +0 -10
- package/dist/fixtures/plugins/playwright/test/some.spec.d.ts +0 -1
- package/dist/fixtures/plugins/playwright/test/some.spec.js +0 -6
- package/dist/fixtures/plugins/postcss/postcss.config.d.ts +0 -1
- package/dist/fixtures/plugins/postcss/postcss.config.js +0 -4
- package/dist/fixtures/plugins/remix/app/entry.client.d.ts +0 -1
- package/dist/fixtures/plugins/remix/app/entry.client.jsx +0 -11
- package/dist/fixtures/plugins/remix/app/entry.server.jsx +0 -3
- package/dist/fixtures/plugins/remix/app/root.d.ts +0 -5
- package/dist/fixtures/plugins/remix/app/root.jsx +0 -31
- package/dist/fixtures/plugins/remix/app/routes/index.d.ts +0 -1
- package/dist/fixtures/plugins/remix/app/routes/index.jsx +0 -8
- package/dist/fixtures/plugins/remix/app/utils.d.ts +0 -1
- package/dist/fixtures/plugins/remix/app/utils.js +0 -1
- package/dist/fixtures/plugins/remix/remix.config.d.ts +0 -2
- package/dist/fixtures/plugins/remix/remix.config.js +0 -5
- package/dist/fixtures/plugins/remix/remix.init/index.d.ts +0 -4
- package/dist/fixtures/plugins/remix/remix.init/index.js +0 -4
- package/dist/fixtures/plugins/remix/server.d.ts +0 -0
- package/dist/fixtures/plugins/remix/server.js +0 -1
- package/dist/fixtures/plugins/rollup/rollup.config.d.ts +0 -16
- package/dist/fixtures/plugins/rollup/rollup.config.js +0 -26
- package/dist/fixtures/plugins/sentry/sentry.client.config.d.ts +0 -1
- package/dist/fixtures/plugins/sentry/sentry.client.config.js +0 -6
- package/dist/fixtures/plugins/sentry/sentry.server.config.d.ts +0 -1
- package/dist/fixtures/plugins/sentry/sentry.server.config.js +0 -1
- package/dist/fixtures/plugins/storybook/addon/register.d.ts +0 -0
- package/dist/fixtures/plugins/storybook/addon/register.js +0 -1
- package/dist/fixtures/plugins/storybook/main.d.ts +0 -10
- package/dist/fixtures/plugins/storybook/main.js +0 -38
- package/dist/fixtures/plugins/storybook/preview.d.ts +0 -13
- package/dist/fixtures/plugins/storybook/preview.js +0 -14
- package/dist/fixtures/plugins/stryker/stryker.conf.cjs +0 -6
- package/dist/fixtures/plugins/stryker/stryker.conf.d.cts +0 -3
- package/dist/fixtures/plugins/stryker/stryker.conf.d.mts +0 -6
- package/dist/fixtures/plugins/stryker/stryker.conf.mjs +0 -6
- package/dist/fixtures/plugins/svelte/knip.d.ts +0 -11
- package/dist/fixtures/plugins/svelte/knip.js +0 -10
- package/dist/fixtures/plugins/svelte/src/routes/+page.d.ts +0 -1
- package/dist/fixtures/plugins/svelte/src/routes/+page.js +0 -1
- package/dist/fixtures/plugins/svelte/svelte.config.d.ts +0 -2
- package/dist/fixtures/plugins/svelte/svelte.config.js +0 -9
- package/dist/fixtures/plugins/svelte/vite.config.d.ts +0 -2
- package/dist/fixtures/plugins/svelte/vite.config.js +0 -5
- package/dist/fixtures/plugins/vitest/test/basic.spec.d.ts +0 -1
- package/dist/fixtures/plugins/vitest/test/basic.spec.js +0 -8
- package/dist/fixtures/plugins/vitest/vite.config.d.ts +0 -2
- package/dist/fixtures/plugins/vitest/vite.config.js +0 -10
- package/dist/fixtures/plugins/vitest/vitest.config.d.ts +0 -2
- package/dist/fixtures/plugins/vitest/vitest.config.js +0 -10
- package/dist/fixtures/plugins/webpack/merge.d.ts +0 -2
- package/dist/fixtures/plugins/webpack/merge.js +0 -9
- package/dist/fixtures/plugins/webpack/src/app-dep.d.ts +0 -2
- package/dist/fixtures/plugins/webpack/src/app-dep.js +0 -1
- package/dist/fixtures/plugins/webpack/src/app.d.ts +0 -1
- package/dist/fixtures/plugins/webpack/src/app.js +0 -1
- package/dist/fixtures/plugins/webpack/src/entry.d.ts +0 -0
- package/dist/fixtures/plugins/webpack/src/entry.js +0 -1
- package/dist/fixtures/plugins/webpack/src/unused.d.ts +0 -0
- package/dist/fixtures/plugins/webpack/src/unused.js +0 -1
- package/dist/fixtures/plugins/webpack/src/vendor.d.ts +0 -0
- package/dist/fixtures/plugins/webpack/src/vendor.js +0 -1
- package/dist/fixtures/plugins/webpack/webpack.common.d.ts +0 -65
- package/dist/fixtures/plugins/webpack/webpack.common.js +0 -81
- package/dist/fixtures/plugins/webpack/webpack.config.d.ts +0 -2
- package/dist/fixtures/plugins/webpack/webpack.config.js +0 -4
- package/dist/fixtures/plugins/webpack/webpack.dev.d.ts +0 -2
- package/dist/fixtures/plugins/webpack/webpack.dev.js +0 -19
- package/dist/fixtures/plugins/webpack/webpack.prod.d.ts +0 -2
- package/dist/fixtures/plugins/webpack/webpack.prod.js +0 -16
- package/dist/fixtures/re-exports/barrel.d.ts +0 -1
- package/dist/fixtures/re-exports/barrel.js +0 -1
- package/dist/fixtures/re-exports/entry.d.ts +0 -1
- package/dist/fixtures/re-exports/entry.js +0 -2
- package/dist/fixtures/re-exports/my-module.d.ts +0 -4
- package/dist/fixtures/re-exports/my-module.js +0 -6
- package/dist/fixtures/react/App.d.ts +0 -1
- package/dist/fixtures/react/App.jsx +0 -7
- package/dist/fixtures/react/Component.d.ts +0 -1
- package/dist/fixtures/react/Component.jsx +0 -4
- package/dist/fixtures/self-reference/entry.d.ts +0 -1
- package/dist/fixtures/self-reference/entry.js +0 -8
- package/dist/fixtures/self-reference/lib/module.d.ts +0 -2
- package/dist/fixtures/self-reference/lib/module.js +0 -1
- package/dist/fixtures/self-reference/out/entry.d.ts +0 -1
- package/dist/fixtures/self-reference/out/entry.js +0 -11
- package/dist/fixtures/self-reference/out/lib/module.d.mts +0 -3
- package/dist/fixtures/self-reference/out/lib/module.mjs +0 -4
- package/dist/fixtures/self-reference-from-plugin/entry.d.ts +0 -0
- package/dist/fixtures/self-reference-from-plugin/entry.js +0 -2
- package/dist/fixtures/self-reference-from-plugin/file.d.ts +0 -2
- package/dist/fixtures/self-reference-from-plugin/file.js +0 -1
- package/dist/fixtures/tsconfig-paths/aliased-dir/a.d.ts +0 -1
- package/dist/fixtures/tsconfig-paths/aliased-dir/a.js +0 -1
- package/dist/fixtures/tsconfig-paths/index.d.ts +0 -1
- package/dist/fixtures/tsconfig-paths/index.js +0 -6
- package/dist/fixtures/tsconfig-paths/internal-package/index.d.ts +0 -2
- package/dist/fixtures/tsconfig-paths/internal-package/index.js +0 -2
- package/dist/fixtures/tsconfig-paths/unprefixed/module.d.ts +0 -2
- package/dist/fixtures/tsconfig-paths/unprefixed/module.js +0 -2
- package/dist/fixtures/tsconfig-paths-extends/src/cli.d.ts +0 -1
- package/dist/fixtures/tsconfig-paths-extends/src/cli.js +0 -3
- package/dist/fixtures/tsconfig-paths-extends/src/index.d.ts +0 -3
- package/dist/fixtures/tsconfig-paths-extends/src/index.js +0 -3
- package/dist/fixtures/tsconfig-paths-extends/src/lib/main.d.ts +0 -2
- package/dist/fixtures/tsconfig-paths-extends/src/lib/main.js +0 -1
- package/dist/fixtures/tsconfig-paths-extends/src/util/index.d.ts +0 -2
- package/dist/fixtures/tsconfig-paths-extends/src/util/index.js +0 -1
- package/dist/fixtures/tsconfig-paths-implicit/src/hello/world.d.ts +0 -1
- package/dist/fixtures/tsconfig-paths-implicit/src/hello/world.js +0 -1
- package/dist/fixtures/tsconfig-paths-implicit/src/index.d.ts +0 -1
- package/dist/fixtures/tsconfig-paths-implicit/src/index.js +0 -2
- package/dist/fixtures/workspaces/apps/a/index.d.ts +0 -1
- package/dist/fixtures/workspaces/apps/a/index.js +0 -6
- package/dist/fixtures/workspaces/apps/b/index.d.ts +0 -1
- package/dist/fixtures/workspaces/apps/b/index.js +0 -4
- package/dist/fixtures/workspaces/docs/dangling.d.ts +0 -1
- package/dist/fixtures/workspaces/docs/dangling.js +0 -1
- package/dist/fixtures/workspaces/packages/lib-a/index.d.ts +0 -4
- package/dist/fixtures/workspaces/packages/lib-a/index.js +0 -3
- package/dist/fixtures/workspaces/packages/lib-b/ignored/index.d.ts +0 -0
- package/dist/fixtures/workspaces/packages/lib-b/ignored/index.js +0 -1
- package/dist/fixtures/workspaces/packages/lib-b/index.d.ts +0 -3
- package/dist/fixtures/workspaces/packages/lib-b/index.js +0 -2
- package/dist/fixtures/workspaces-nested/level-1-1/index.d.ts +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/index.js +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/index.spec.d.ts +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/index.spec.js +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/level-1-2/index.d.ts +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/level-1-2/index.js +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/level-1-2/index.spec.d.ts +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/level-1-2/index.spec.js +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/level-1-2/level-1-3/index.d.ts +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/level-1-2/level-1-3/index.js +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/level-1-2/level-1-3/index.spec.d.ts +0 -1
- package/dist/fixtures/workspaces-nested/level-1-1/level-1-2/level-1-3/index.spec.js +0 -1
- package/dist/fixtures/workspaces-paths/packages/lib-a/src/dir/module-a.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-a/src/dir/module-a.js +0 -1
- package/dist/fixtures/workspaces-paths/packages/lib-a/src/index.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-a/src/index.js +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-a/src/same.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-a/src/same.js +0 -1
- package/dist/fixtures/workspaces-paths/packages/lib-b/src/dir/module-b.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-b/src/dir/module-b.js +0 -1
- package/dist/fixtures/workspaces-paths/packages/lib-b/src/index.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-b/src/index.js +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-c/src/dir/module.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-c/src/dir/module.js +0 -1
- package/dist/fixtures/workspaces-paths/packages/lib-c/src/index.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-c/src/index.js +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-d/src/dir/module.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-d/src/dir/module.js +0 -1
- package/dist/fixtures/workspaces-paths/packages/lib-d/src/index.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-d/src/index.js +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-e/src/dir/module-e.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-e/src/dir/module-e.js +0 -1
- package/dist/fixtures/workspaces-paths/packages/lib-e/src/index.d.ts +0 -2
- package/dist/fixtures/workspaces-paths/packages/lib-e/src/index.js +0 -2
- package/dist/fixtures/workspaces-pnpm/apps/a/index.d.ts +0 -1
- package/dist/fixtures/workspaces-pnpm/apps/a/index.js +0 -6
- package/dist/fixtures/workspaces-pnpm/apps/b/index.d.ts +0 -1
- package/dist/fixtures/workspaces-pnpm/apps/b/index.js +0 -4
- package/dist/fixtures/workspaces-pnpm/docs/dangling.d.ts +0 -1
- package/dist/fixtures/workspaces-pnpm/docs/dangling.js +0 -1
- package/dist/fixtures/workspaces-pnpm/packages/lib-a/index.d.ts +0 -4
- package/dist/fixtures/workspaces-pnpm/packages/lib-a/index.js +0 -3
- package/dist/fixtures/workspaces-pnpm/packages/lib-b/index.d.ts +0 -3
- package/dist/fixtures/workspaces-pnpm/packages/lib-b/index.js +0 -2
- package/dist/fixtures/workspaces-self-reference/packages/self-reference/entry.d.ts +0 -1
- package/dist/fixtures/workspaces-self-reference/packages/self-reference/entry.js +0 -4
- package/dist/fixtures/workspaces-self-reference/packages/self-reference-from-plugin/entry.d.ts +0 -0
- package/dist/fixtures/workspaces-self-reference/packages/self-reference-from-plugin/entry.js +0 -2
- package/dist/fixtures/workspaces-self-reference/packages/self-reference-from-plugin/file.d.ts +0 -2
- package/dist/fixtures/workspaces-self-reference/packages/self-reference-from-plugin/file.js +0 -1
- package/dist/fixtures/zero-config/exclude.d.ts +0 -1
- package/dist/fixtures/zero-config/exclude.js +0 -1
- package/dist/fixtures/zero-config/index.d.ts +0 -1
- package/dist/fixtures/zero-config/index.js +0 -2
- package/dist/fixtures/zero-config/my-module.d.ts +0 -4
- package/dist/fixtures/zero-config/my-module.js +0 -6
- package/dist/fixtures/zero-config/my-namespace.d.ts +0 -5
- package/dist/fixtures/zero-config/my-namespace.js +0 -3
- package/dist/gitignore.test.d.ts +0 -1
- package/dist/gitignore.test.js +0 -22
- package/dist/helpers/baseArguments.d.ts +0 -8
- package/dist/helpers/baseArguments.js +0 -8
- package/dist/helpers/baseCounters.d.ts +0 -17
- package/dist/helpers/baseCounters.js +0 -7
- package/dist/helpers/index.d.ts +0 -2
- package/dist/helpers/index.js +0 -4
- package/dist/imports.test.d.ts +0 -1
- package/dist/imports.test.js +0 -39
- package/dist/js-only.test.d.ts +0 -1
- package/dist/js-only.test.js +0 -26
- package/dist/jsdoc.test.d.ts +0 -1
- package/dist/jsdoc.test.js +0 -21
- package/dist/members.test.d.ts +0 -1
- package/dist/members.test.js +0 -28
- package/dist/namespace.test.d.ts +0 -1
- package/dist/namespace.test.js +0 -18
- package/dist/npm-scripts.test.d.ts +0 -1
- package/dist/npm-scripts.test.js +0 -78
- package/dist/pathless.test.d.ts +0 -1
- package/dist/pathless.test.js +0 -14
- package/dist/paths-knip-config-workspaces.test.d.ts +0 -1
- package/dist/paths-knip-config-workspaces.test.js +0 -18
- package/dist/paths-knip-config.test.d.ts +0 -1
- package/dist/paths-knip-config.test.js +0 -18
- package/dist/peer-dependencies.test.d.ts +0 -1
- package/dist/peer-dependencies.test.js +0 -20
- package/dist/plugins/_template.test.d.ts +0 -1
- package/dist/plugins/_template.test.js +0 -12
- package/dist/plugins/ava.test.d.ts +0 -1
- package/dist/plugins/ava.test.js +0 -18
- package/dist/plugins/babel.test.d.ts +0 -1
- package/dist/plugins/babel.test.js +0 -62
- package/dist/plugins/capacitor.test.d.ts +0 -1
- package/dist/plugins/capacitor.test.js +0 -31
- package/dist/plugins/changesets.test.d.ts +0 -1
- package/dist/plugins/changesets.test.js +0 -12
- package/dist/plugins/commitlint.test.d.ts +0 -1
- package/dist/plugins/commitlint.test.js +0 -22
- package/dist/plugins/cspell.test.d.ts +0 -1
- package/dist/plugins/cspell.test.js +0 -10
- package/dist/plugins/cypress.test.d.ts +0 -1
- package/dist/plugins/cypress.test.js +0 -23
- package/dist/plugins/eslint.test.d.ts +0 -1
- package/dist/plugins/eslint.test.js +0 -43
- package/dist/plugins/gatsby.test.d.ts +0 -1
- package/dist/plugins/gatsby.test.js +0 -31
- package/dist/plugins/github-actions.test.d.ts +0 -1
- package/dist/plugins/github-actions.test.js +0 -25
- package/dist/plugins/husky.test.d.ts +0 -1
- package/dist/plugins/husky.test.js +0 -32
- package/dist/plugins/jest.test.d.ts +0 -1
- package/dist/plugins/jest.test.js +0 -18
- package/dist/plugins/lefthook.test.d.ts +0 -1
- package/dist/plugins/lefthook.test.js +0 -16
- package/dist/plugins/lint-staged.test.d.ts +0 -1
- package/dist/plugins/lint-staged.test.js +0 -18
- package/dist/plugins/markdownlint.test.d.ts +0 -1
- package/dist/plugins/markdownlint.test.js +0 -12
- package/dist/plugins/mocha.test.d.ts +0 -1
- package/dist/plugins/mocha.test.js +0 -22
- package/dist/plugins/next.test.d.ts +0 -1
- package/dist/plugins/next.test.js +0 -24
- package/dist/plugins/npm-package-json-lint.test.d.ts +0 -1
- package/dist/plugins/npm-package-json-lint.test.js +0 -12
- package/dist/plugins/nx.test.d.ts +0 -1
- package/dist/plugins/nx.test.js +0 -15
- package/dist/plugins/nyc.test.d.ts +0 -1
- package/dist/plugins/nyc.test.js +0 -10
- package/dist/plugins/playwright.test.d.ts +0 -1
- package/dist/plugins/playwright.test.js +0 -20
- package/dist/plugins/postcss.test.d.ts +0 -1
- package/dist/plugins/postcss.test.js +0 -33
- package/dist/plugins/prettier.test.d.ts +0 -1
- package/dist/plugins/prettier.test.js +0 -10
- package/dist/plugins/release-it.test.d.ts +0 -1
- package/dist/plugins/release-it.test.js +0 -10
- package/dist/plugins/remark.test.d.ts +0 -1
- package/dist/plugins/remark.test.js +0 -12
- package/dist/plugins/remix.test.d.ts +0 -1
- package/dist/plugins/remix.test.js +0 -39
- package/dist/plugins/rollup.test.d.ts +0 -1
- package/dist/plugins/rollup.test.js +0 -24
- package/dist/plugins/semantic-release.test.d.ts +0 -1
- package/dist/plugins/semantic-release.test.js +0 -31
- package/dist/plugins/sentry.test.d.ts +0 -1
- package/dist/plugins/sentry.test.js +0 -14
- package/dist/plugins/storybook.test.d.ts +0 -1
- package/dist/plugins/storybook.test.js +0 -18
- package/dist/plugins/stryker.test.d.ts +0 -1
- package/dist/plugins/stryker.test.js +0 -44
- package/dist/plugins/svelte.test.d.ts +0 -1
- package/dist/plugins/svelte.test.js +0 -21
- package/dist/plugins/typedoc.test.d.ts +0 -1
- package/dist/plugins/typedoc.test.js +0 -14
- package/dist/plugins/vitest.test.d.ts +0 -1
- package/dist/plugins/vitest.test.js +0 -17
- package/dist/plugins/webpack.test.d.ts +0 -1
- package/dist/plugins/webpack.test.js +0 -56
- package/dist/re-exports.test.d.ts +0 -1
- package/dist/re-exports.test.js +0 -18
- package/dist/react.test.d.ts +0 -1
- package/dist/react.test.js +0 -19
- package/dist/self-reference-from-plugin.test.d.ts +0 -1
- package/dist/self-reference-from-plugin.test.js +0 -47
- package/dist/self-reference.test.d.ts +0 -1
- package/dist/self-reference.test.js +0 -46
- package/dist/source-lab.d.ts +0 -21
- package/dist/source-lab.js +0 -135
- package/dist/tsconfig-paths-extends.test.d.ts +0 -1
- package/dist/tsconfig-paths-extends.test.js +0 -18
- package/dist/tsconfig-paths-implicit.test.d.ts +0 -1
- package/dist/tsconfig-paths-implicit.test.js +0 -18
- package/dist/tsconfig-paths.test.d.ts +0 -1
- package/dist/tsconfig-paths.test.js +0 -26
- package/dist/util/binaries/bash-parser.d.ts +0 -6
- package/dist/util/binaries/bash-parser.js +0 -57
- package/dist/util/binaries/index.d.ts +0 -2
- package/dist/util/binaries/index.js +0 -27
- package/dist/util/binaries/resolvers/fallback.js +0 -14
- package/dist/util/binaries/resolvers/index.d.ts +0 -4
- package/dist/util/binaries/resolvers/index.js +0 -4
- package/dist/util/binaries/resolvers/node.d.ts +0 -3
- package/dist/util/binaries/resolvers/node.js +0 -20
- package/dist/util/binaries/resolvers/npx.d.ts +0 -2
- package/dist/util/binaries/resolvers/npx.js +0 -5
- package/dist/util/binaries/resolvers/pnpm.d.ts +0 -2
- package/dist/util/binaries/resolvers/pnpm.js +0 -45
- package/dist/util/binaries/resolvers/yarn.d.ts +0 -2
- package/dist/util/binaries/resolvers/yarn.js +0 -46
- package/dist/util/binaries/types.d.ts +0 -18
- package/dist/util/binaries/types.js +0 -1
- package/dist/util/find-import-specifiers.d.ts +0 -5
- package/dist/util/find-import-specifiers.js +0 -48
- package/dist/util/get-included-issue-types.test.d.ts +0 -1
- package/dist/util/get-included-issue-types.test.js +0 -70
- package/dist/util/getReferencesFromScripts.test.d.ts +0 -1
- package/dist/util/getReferencesFromScripts.test.js +0 -126
- package/dist/util/log.d.ts +0 -7
- package/dist/util/log.js +0 -21
- package/dist/util/members.d.ts +0 -3
- package/dist/util/members.js +0 -25
- package/dist/util/module.test.d.ts +0 -1
- package/dist/util/module.test.js +0 -12
- package/dist/util/os.d.ts +0 -1
- package/dist/util/os.js +0 -1
- package/dist/util/project.d.ts +0 -13
- package/dist/util/project.js +0 -48
- package/dist/util/resolve-included-issue-types.d.ts +0 -16
- package/dist/util/resolve-included-issue-types.js +0 -30
- package/dist/util/type.d.ts +0 -2
- package/dist/util/type.js +0 -9
- package/dist/util/workspace.test.d.ts +0 -1
- package/dist/util/workspace.test.js +0 -13
- package/dist/workspaces-nested.test.d.ts +0 -1
- package/dist/workspaces-nested.test.js +0 -44
- package/dist/workspaces-paths.test.d.ts +0 -1
- package/dist/workspaces-paths.test.js +0 -21
- package/dist/workspaces-pnpm.test.d.ts +0 -1
- package/dist/workspaces-pnpm.test.js +0 -21
- package/dist/workspaces.test.d.ts +0 -1
- package/dist/workspaces.test.js +0 -56
- package/dist/zero-config.test.d.ts +0 -1
- package/dist/zero-config.test.js +0 -37
- /package/dist/{util/binaries/resolvers/fallback.d.ts → binaries/resolvers/rollup.d.ts} +0 -0
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import test from 'node:test';
|
|
4
|
-
import * as semanticRelease from '../../src/plugins/semantic-release/index.js';
|
|
5
|
-
import { getManifest } from '../helpers/index.js';
|
|
6
|
-
const cwd = path.resolve('tests/fixtures/plugins/semantic-release');
|
|
7
|
-
const manifest = getManifest(cwd);
|
|
8
|
-
test('Find dependencies in semantic-release package.json configuration (json)', async () => {
|
|
9
|
-
const configFilePath = path.join(cwd, 'package.json');
|
|
10
|
-
const dependencies = await semanticRelease.findDependencies(configFilePath, { manifest });
|
|
11
|
-
assert.deepEqual(dependencies, [
|
|
12
|
-
'@semantic-release/commit-analyzer',
|
|
13
|
-
'@semantic-release/release-notes-generator',
|
|
14
|
-
'@semantic-release/changelog',
|
|
15
|
-
'@semantic-release/git',
|
|
16
|
-
'@semantic-release/npm',
|
|
17
|
-
'@semantic-release/github',
|
|
18
|
-
]);
|
|
19
|
-
});
|
|
20
|
-
test('Find dependencies in semantic-release .releaserc configuration (yaml)', async () => {
|
|
21
|
-
const configFilePath = path.join(cwd, '.releaserc');
|
|
22
|
-
const dependencies = await semanticRelease.findDependencies(configFilePath, {});
|
|
23
|
-
assert.deepEqual(dependencies, [
|
|
24
|
-
'@semantic-release/commit-analyzer',
|
|
25
|
-
'@semantic-release/release-notes-generator',
|
|
26
|
-
'@semantic-release/changelog',
|
|
27
|
-
'@semantic-release/git',
|
|
28
|
-
'@semantic-release/npm',
|
|
29
|
-
'@semantic-release/github',
|
|
30
|
-
]);
|
|
31
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../../src/index.js';
|
|
4
|
-
import { resolve } from '../../src/util/path.js';
|
|
5
|
-
import baseArguments from '../helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from '../helpers/baseCounters.js';
|
|
7
|
-
const cwd = resolve('tests/fixtures/plugins/sentry');
|
|
8
|
-
test('Find dependencies in Sentry configuration', async () => {
|
|
9
|
-
const { counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert.deepEqual(counters, { ...baseCounters, processed: 2, total: 2 });
|
|
14
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import * as storybook from '../../src/plugins/storybook/index.js';
|
|
4
|
-
import { resolve, join } from '../../src/util/path.js';
|
|
5
|
-
const cwd = resolve('tests/fixtures/plugins/storybook');
|
|
6
|
-
test('Find dependencies in Storybook configuration (main.js)', async () => {
|
|
7
|
-
const configFilePath = join(cwd, 'main.js');
|
|
8
|
-
const dependencies = await storybook.findDependencies(configFilePath);
|
|
9
|
-
assert.deepEqual(dependencies, [
|
|
10
|
-
'@storybook/addon-essentials',
|
|
11
|
-
'@storybook/addon-a11y',
|
|
12
|
-
'@storybook/addon-knobs/preset',
|
|
13
|
-
'storybook-addon-export-to-codesandbox',
|
|
14
|
-
'./addon/register',
|
|
15
|
-
'@storybook/builder-webpack5',
|
|
16
|
-
'@storybook/manager-webpack5',
|
|
17
|
-
]);
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import * as stryker from '../../src/plugins/stryker/index.js';
|
|
4
|
-
import { resolve, join } from '../../src/util/path.js';
|
|
5
|
-
const cwd = resolve('tests/fixtures/plugins/stryker');
|
|
6
|
-
test('Find dependencies in Stryker configuration (js)', async () => {
|
|
7
|
-
const configFilePath = join(cwd, '.stryker.conf.js');
|
|
8
|
-
const dependencies = await stryker.findDependencies(configFilePath);
|
|
9
|
-
assert.deepEqual(dependencies, [
|
|
10
|
-
'@stryker-mutator/mocha-runner',
|
|
11
|
-
'@stryker-mutator/typescript-checker',
|
|
12
|
-
'@stryker-mutator/jasmine-framework',
|
|
13
|
-
'@stryker-mutator/karma-runner',
|
|
14
|
-
]);
|
|
15
|
-
});
|
|
16
|
-
test('Find dependencies in Stryker configuration (mjs)', async () => {
|
|
17
|
-
const configFilePath = join(cwd, 'stryker.conf.mjs');
|
|
18
|
-
const dependencies = await stryker.findDependencies(configFilePath);
|
|
19
|
-
assert.deepEqual(dependencies, [
|
|
20
|
-
'@stryker-mutator/mocha-runner',
|
|
21
|
-
'@stryker-mutator/typescript-checker',
|
|
22
|
-
'@stryker-mutator/jasmine-framework',
|
|
23
|
-
'@stryker-mutator/karma-runner',
|
|
24
|
-
]);
|
|
25
|
-
});
|
|
26
|
-
test('Find dependencies in Stryker configuration (cjs)', async () => {
|
|
27
|
-
const configFilePath = join(cwd, 'stryker.conf.cjs');
|
|
28
|
-
const dependencies = await stryker.findDependencies(configFilePath);
|
|
29
|
-
assert.deepEqual(dependencies, [
|
|
30
|
-
'@stryker-mutator/mocha-runner',
|
|
31
|
-
'@stryker-mutator/typescript-checker',
|
|
32
|
-
'@stryker-mutator/jasmine-framework',
|
|
33
|
-
'@stryker-mutator/karma-runner',
|
|
34
|
-
]);
|
|
35
|
-
});
|
|
36
|
-
test('Find dependencies in Stryker configuration (json)', async () => {
|
|
37
|
-
const configFilePath = join(cwd, 'stryker.conf.json');
|
|
38
|
-
const dependencies = await stryker.findDependencies(configFilePath);
|
|
39
|
-
assert.deepEqual(dependencies, [
|
|
40
|
-
'@stryker-mutator/karma-runner',
|
|
41
|
-
'@stryker-mutator/typescript-checker',
|
|
42
|
-
'@stryker-mutator/karma-runner',
|
|
43
|
-
]);
|
|
44
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../../src/index.js';
|
|
4
|
-
import { resolve } from '../../src/util/path.js';
|
|
5
|
-
import baseArguments from '../helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from '../helpers/baseCounters.js';
|
|
7
|
-
const cwd = resolve('tests/fixtures/plugins/svelte');
|
|
8
|
-
test('Use compilers', async () => {
|
|
9
|
-
const { issues, counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert(issues.devDependencies['package.json']['@types/cookie']);
|
|
14
|
-
assert(issues.devDependencies['package.json']['tslib']);
|
|
15
|
-
assert.deepEqual(counters, {
|
|
16
|
-
...baseCounters,
|
|
17
|
-
devDependencies: 2,
|
|
18
|
-
processed: 9,
|
|
19
|
-
total: 9,
|
|
20
|
-
});
|
|
21
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import * as typedoc from '../../src/plugins/typedoc/index.js';
|
|
4
|
-
import { resolve, join } from '../../src/util/path.js';
|
|
5
|
-
const cwd = resolve('tests/fixtures/plugins/typedoc');
|
|
6
|
-
test('Find dependencies in typedoc configuration (json)', async () => {
|
|
7
|
-
const configFilePath = join(cwd, 'typedoc.json');
|
|
8
|
-
const dependencies = await typedoc.findDependencies(configFilePath);
|
|
9
|
-
assert.deepEqual(dependencies, [
|
|
10
|
-
'@appium/typedoc-plugin-appium',
|
|
11
|
-
'typedoc-plugin-expand-object-like-types',
|
|
12
|
-
'./dist/index.cjs',
|
|
13
|
-
]);
|
|
14
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import * as vitest from '../../src/plugins/vitest/index.js';
|
|
4
|
-
import { resolve, join } from '../../src/util/path.js';
|
|
5
|
-
import { getManifest } from '../helpers/index.js';
|
|
6
|
-
const cwd = resolve('tests/fixtures/plugins/vitest');
|
|
7
|
-
const manifest = getManifest(cwd);
|
|
8
|
-
test('Find dependencies in vitest configuration (vitest)', async () => {
|
|
9
|
-
const configFilePath = join(cwd, 'vitest.config.ts');
|
|
10
|
-
const dependencies = await vitest.findDependencies(configFilePath, { manifest });
|
|
11
|
-
assert.deepEqual(dependencies, ['happy-dom', '@vitest/coverage-istanbul']);
|
|
12
|
-
});
|
|
13
|
-
test('Find dependencies in vitest configuration (vite)', async () => {
|
|
14
|
-
const configFilePath = join(cwd, 'vite.config.ts');
|
|
15
|
-
const dependencies = await vitest.findDependencies(configFilePath, { manifest });
|
|
16
|
-
assert.deepEqual(dependencies, ['@edge-runtime/vm', '@vitest/coverage-c8']);
|
|
17
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import path from 'node:path';
|
|
3
|
-
import test from 'node:test';
|
|
4
|
-
import { main } from '../../src/index.js';
|
|
5
|
-
import * as webpack from '../../src/plugins/webpack/index.js';
|
|
6
|
-
import { resolve, join } from '../../src/util/path.js';
|
|
7
|
-
import baseArguments from '../helpers/baseArguments.js';
|
|
8
|
-
import baseCounters from '../helpers/baseCounters.js';
|
|
9
|
-
import { getManifest } from '../helpers/index.js';
|
|
10
|
-
const cwd = resolve('tests/fixtures/plugins/webpack');
|
|
11
|
-
const manifest = getManifest(cwd);
|
|
12
|
-
test('Find dependencies in Webpack configuration (webpack.config.js)', async () => {
|
|
13
|
-
const configFilePath = join(cwd, 'webpack.config.js');
|
|
14
|
-
const dependencies = await webpack.findDependencies(configFilePath, { cwd, manifest });
|
|
15
|
-
assert.deepEqual(dependencies, [
|
|
16
|
-
'svg-url-loader',
|
|
17
|
-
'babel-loader',
|
|
18
|
-
'@babel/preset-env',
|
|
19
|
-
'@babel/preset-typescript',
|
|
20
|
-
'@babel/plugin-proposal-class-properties',
|
|
21
|
-
'@babel/plugin-transform-react-jsx',
|
|
22
|
-
'babel-plugin-macros',
|
|
23
|
-
'babel-plugin-styled-components',
|
|
24
|
-
'ts-loader',
|
|
25
|
-
'esbuild-loader',
|
|
26
|
-
path.join(cwd, 'node_modules/mini-css-extract-plugin/loader.js'),
|
|
27
|
-
'css-loader',
|
|
28
|
-
'less-loader',
|
|
29
|
-
'svgo-loader',
|
|
30
|
-
'base64-inline-loader',
|
|
31
|
-
'./src/app.ts',
|
|
32
|
-
'./src/vendor.ts',
|
|
33
|
-
'./src/entry.js',
|
|
34
|
-
'webpack-cli',
|
|
35
|
-
'webpack-dev-server',
|
|
36
|
-
]);
|
|
37
|
-
});
|
|
38
|
-
test('Find dependencies in Webpack configuration', async () => {
|
|
39
|
-
const { issues, counters } = await main({
|
|
40
|
-
...baseArguments,
|
|
41
|
-
cwd,
|
|
42
|
-
});
|
|
43
|
-
assert(issues.files.has(join(cwd, 'src/unused.ts')));
|
|
44
|
-
assert(issues.devDependencies['package.json']['@babel/plugin-proposal-object-rest-spread']);
|
|
45
|
-
assert(issues.unlisted['webpack.config.js']['svgo-loader']);
|
|
46
|
-
assert(issues.unlisted['webpack.dev.js']['eslint-webpack-plugin']);
|
|
47
|
-
assert(issues.unlisted['webpack.prod.js']['terser-webpack-plugin']);
|
|
48
|
-
assert.deepEqual(counters, {
|
|
49
|
-
...baseCounters,
|
|
50
|
-
files: 1,
|
|
51
|
-
devDependencies: 1,
|
|
52
|
-
unlisted: 3,
|
|
53
|
-
processed: 10,
|
|
54
|
-
total: 10,
|
|
55
|
-
});
|
|
56
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/re-exports.test.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../src/index.js';
|
|
4
|
-
import { resolve } from '../src/util/path.js';
|
|
5
|
-
import baseArguments from './helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from './helpers/baseCounters.js';
|
|
7
|
-
const cwd = resolve('tests/fixtures/re-exports');
|
|
8
|
-
test('Find unused files and exports', async () => {
|
|
9
|
-
const { counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert.deepEqual(counters, {
|
|
14
|
-
...baseCounters,
|
|
15
|
-
processed: 3,
|
|
16
|
-
total: 3,
|
|
17
|
-
});
|
|
18
|
-
});
|
package/dist/react.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/react.test.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../src/index.js';
|
|
4
|
-
import { resolve } from '../src/util/path.js';
|
|
5
|
-
import baseArguments from './helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from './helpers/baseCounters.js';
|
|
7
|
-
test('Support JSX/TSX files', async () => {
|
|
8
|
-
const cwd = resolve('tests/fixtures/react');
|
|
9
|
-
const { counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert.deepEqual(counters, {
|
|
14
|
-
...baseCounters,
|
|
15
|
-
dependencies: 0,
|
|
16
|
-
processed: 2,
|
|
17
|
-
total: 2,
|
|
18
|
-
});
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../src/index.js';
|
|
4
|
-
import { resolve } from '../src/util/path.js';
|
|
5
|
-
import baseArguments from './helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from './helpers/baseCounters.js';
|
|
7
|
-
const cwd = resolve('tests/fixtures/self-reference-from-plugin');
|
|
8
|
-
test('Allows self-references', async () => {
|
|
9
|
-
const { issues, counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert.equal(Object.keys(issues.unlisted).length, 0);
|
|
14
|
-
assert.deepEqual(counters, {
|
|
15
|
-
...baseCounters,
|
|
16
|
-
devDependencies: 1,
|
|
17
|
-
processed: 2,
|
|
18
|
-
total: 2,
|
|
19
|
-
});
|
|
20
|
-
});
|
|
21
|
-
test('Allows self-references (production)', async () => {
|
|
22
|
-
const { issues, counters } = await main({
|
|
23
|
-
...baseArguments,
|
|
24
|
-
cwd,
|
|
25
|
-
isProduction: true,
|
|
26
|
-
});
|
|
27
|
-
assert.equal(Object.keys(issues.unlisted).length, 0);
|
|
28
|
-
assert.deepEqual(counters, {
|
|
29
|
-
...baseCounters,
|
|
30
|
-
processed: 1,
|
|
31
|
-
total: 1,
|
|
32
|
-
});
|
|
33
|
-
});
|
|
34
|
-
test('Allows self-references (strict)', async () => {
|
|
35
|
-
const { issues, counters } = await main({
|
|
36
|
-
...baseArguments,
|
|
37
|
-
cwd,
|
|
38
|
-
isProduction: true,
|
|
39
|
-
isStrict: true,
|
|
40
|
-
});
|
|
41
|
-
assert.equal(Object.keys(issues.unlisted).length, 0);
|
|
42
|
-
assert.deepEqual(counters, {
|
|
43
|
-
...baseCounters,
|
|
44
|
-
processed: 1,
|
|
45
|
-
total: 1,
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../src/index.js';
|
|
4
|
-
import { resolve } from '../src/util/path.js';
|
|
5
|
-
import baseArguments from './helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from './helpers/baseCounters.js';
|
|
7
|
-
const cwd = resolve('tests/fixtures/self-reference');
|
|
8
|
-
test('Allows self-references', async () => {
|
|
9
|
-
const { issues, counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert.equal(Object.keys(issues.unlisted).length, 0);
|
|
14
|
-
assert.deepEqual(counters, {
|
|
15
|
-
...baseCounters,
|
|
16
|
-
processed: 1,
|
|
17
|
-
total: 1,
|
|
18
|
-
});
|
|
19
|
-
});
|
|
20
|
-
test('Allows self-references (production)', async () => {
|
|
21
|
-
const { issues, counters } = await main({
|
|
22
|
-
...baseArguments,
|
|
23
|
-
cwd,
|
|
24
|
-
isProduction: true,
|
|
25
|
-
});
|
|
26
|
-
assert.equal(Object.keys(issues.unlisted).length, 0);
|
|
27
|
-
assert.deepEqual(counters, {
|
|
28
|
-
...baseCounters,
|
|
29
|
-
processed: 1,
|
|
30
|
-
total: 1,
|
|
31
|
-
});
|
|
32
|
-
});
|
|
33
|
-
test('Allows self-references (strict)', async () => {
|
|
34
|
-
const { issues, counters } = await main({
|
|
35
|
-
...baseArguments,
|
|
36
|
-
cwd,
|
|
37
|
-
isProduction: true,
|
|
38
|
-
isStrict: true,
|
|
39
|
-
});
|
|
40
|
-
assert.equal(Object.keys(issues.unlisted).length, 0);
|
|
41
|
-
assert.deepEqual(counters, {
|
|
42
|
-
...baseCounters,
|
|
43
|
-
processed: 1,
|
|
44
|
-
total: 1,
|
|
45
|
-
});
|
|
46
|
-
});
|
package/dist/source-lab.d.ts
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import type { Report, Issue } from './types/issues.js';
|
|
2
|
-
import type { SourceFile } from 'ts-morph';
|
|
3
|
-
type FileLabOptions = {
|
|
4
|
-
report: Report;
|
|
5
|
-
workspaceDirs: string[];
|
|
6
|
-
isIncludeEntryExports: boolean;
|
|
7
|
-
};
|
|
8
|
-
export default class SourceLab {
|
|
9
|
-
report: Report;
|
|
10
|
-
workspaceDirs: string[];
|
|
11
|
-
isIncludeEntryExports: boolean;
|
|
12
|
-
skipExportsAnalysis: Set<unknown>;
|
|
13
|
-
isReportExports: boolean;
|
|
14
|
-
isReportValues: boolean;
|
|
15
|
-
isReportTypes: boolean;
|
|
16
|
-
constructor({ report, workspaceDirs, isIncludeEntryExports }: FileLabOptions);
|
|
17
|
-
skipExportsAnalysisFor(filePath: string | string[]): void;
|
|
18
|
-
analyzeSourceFile(sourceFile: SourceFile): Set<Issue>;
|
|
19
|
-
private analyzeExports;
|
|
20
|
-
}
|
|
21
|
-
export {};
|
package/dist/source-lab.js
DELETED
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import { ts, Node } from 'ts-morph';
|
|
2
|
-
import { findUnusedClassMembers, findUnusedEnumMembers } from './util/members.js';
|
|
3
|
-
import { _hasReferencingDefaultImport, _findReferencingNamespaceNodes, _getExportedDeclarations, _findReferences, hasExternalReferences, } from './util/project.js';
|
|
4
|
-
import { getType } from './util/type.js';
|
|
5
|
-
export default class SourceLab {
|
|
6
|
-
report;
|
|
7
|
-
workspaceDirs;
|
|
8
|
-
isIncludeEntryExports;
|
|
9
|
-
skipExportsAnalysis;
|
|
10
|
-
isReportExports;
|
|
11
|
-
isReportValues;
|
|
12
|
-
isReportTypes;
|
|
13
|
-
constructor({ report, workspaceDirs, isIncludeEntryExports }) {
|
|
14
|
-
this.report = report;
|
|
15
|
-
this.workspaceDirs = workspaceDirs;
|
|
16
|
-
this.isIncludeEntryExports = isIncludeEntryExports;
|
|
17
|
-
this.skipExportsAnalysis = new Set();
|
|
18
|
-
this.isReportValues = report.exports || report.nsExports || report.classMembers;
|
|
19
|
-
this.isReportTypes = report.types || report.nsTypes || report.enumMembers;
|
|
20
|
-
this.isReportExports = this.isReportValues || this.isReportTypes;
|
|
21
|
-
}
|
|
22
|
-
skipExportsAnalysisFor(filePath) {
|
|
23
|
-
[filePath].flat().forEach(filePath => this.skipExportsAnalysis.add(filePath));
|
|
24
|
-
}
|
|
25
|
-
analyzeSourceFile(sourceFile) {
|
|
26
|
-
const issues = new Set();
|
|
27
|
-
const filePath = sourceFile.getFilePath();
|
|
28
|
-
if (this.skipExportsAnalysis.has(filePath))
|
|
29
|
-
return issues;
|
|
30
|
-
if (this.isReportExports) {
|
|
31
|
-
const exportsIssues = this.analyzeExports(sourceFile);
|
|
32
|
-
exportsIssues.forEach(issue => issues.add(issue));
|
|
33
|
-
}
|
|
34
|
-
return issues;
|
|
35
|
-
}
|
|
36
|
-
analyzeExports(sourceFile) {
|
|
37
|
-
const issues = new Set();
|
|
38
|
-
const report = this.report;
|
|
39
|
-
const filePath = sourceFile.getFilePath();
|
|
40
|
-
const exportDeclarations = _getExportedDeclarations(sourceFile);
|
|
41
|
-
exportDeclarations.forEach(declarations => {
|
|
42
|
-
declarations.forEach(declaration => {
|
|
43
|
-
const type = getType(declaration);
|
|
44
|
-
if (type && !this.isReportTypes)
|
|
45
|
-
return;
|
|
46
|
-
if (!type && !this.isReportValues)
|
|
47
|
-
return;
|
|
48
|
-
if (ts.getJSDocPublicTag(declaration.compilerNode))
|
|
49
|
-
return;
|
|
50
|
-
if (Node.isJSDocTag(declaration))
|
|
51
|
-
return;
|
|
52
|
-
let identifier;
|
|
53
|
-
let fakeIdentifier;
|
|
54
|
-
if (declaration.isKind(ts.SyntaxKind.EnumDeclaration)) {
|
|
55
|
-
identifier = declaration.getFirstChildByKind(ts.SyntaxKind.Identifier);
|
|
56
|
-
if (report.enumMembers) {
|
|
57
|
-
findUnusedEnumMembers(declaration, filePath).forEach(symbol => {
|
|
58
|
-
issues.add({ type: 'enumMembers', filePath, symbol, parentSymbol: identifier?.getText() });
|
|
59
|
-
});
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
else if (declaration.isKind(ts.SyntaxKind.ClassDeclaration)) {
|
|
63
|
-
identifier = declaration.getFirstChildByKind(ts.SyntaxKind.Identifier);
|
|
64
|
-
if (report.classMembers) {
|
|
65
|
-
findUnusedClassMembers(declaration, filePath).forEach(symbol => {
|
|
66
|
-
issues.add({ type: 'classMembers', filePath, symbol, parentSymbol: identifier?.getText() });
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (Node.isExportGetable(declaration) &&
|
|
71
|
-
declaration.isDefaultExport() &&
|
|
72
|
-
_hasReferencingDefaultImport(sourceFile)) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
if (!identifier) {
|
|
76
|
-
if (declaration.isKind(ts.SyntaxKind.Identifier)) {
|
|
77
|
-
identifier = declaration;
|
|
78
|
-
}
|
|
79
|
-
else if (declaration.isKind(ts.SyntaxKind.ArrowFunction) ||
|
|
80
|
-
declaration.isKind(ts.SyntaxKind.ObjectLiteralExpression) ||
|
|
81
|
-
declaration.isKind(ts.SyntaxKind.ArrayLiteralExpression) ||
|
|
82
|
-
declaration.isKind(ts.SyntaxKind.StringLiteral) ||
|
|
83
|
-
declaration.isKind(ts.SyntaxKind.NumericLiteral)) {
|
|
84
|
-
if (!_hasReferencingDefaultImport(sourceFile)) {
|
|
85
|
-
fakeIdentifier = 'default';
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
else if (declaration.isKind(ts.SyntaxKind.FunctionDeclaration) ||
|
|
89
|
-
declaration.isKind(ts.SyntaxKind.TypeAliasDeclaration) ||
|
|
90
|
-
declaration.isKind(ts.SyntaxKind.InterfaceDeclaration)) {
|
|
91
|
-
identifier = declaration.getFirstChildByKind(ts.SyntaxKind.Identifier);
|
|
92
|
-
}
|
|
93
|
-
else if (declaration.isKind(ts.SyntaxKind.PropertyAccessExpression)) {
|
|
94
|
-
identifier = declaration.getLastChildByKind(ts.SyntaxKind.Identifier);
|
|
95
|
-
}
|
|
96
|
-
else {
|
|
97
|
-
identifier = declaration.getFirstDescendantByKind(ts.SyntaxKind.Identifier);
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
if (identifier || fakeIdentifier) {
|
|
101
|
-
const identifierText = fakeIdentifier ?? identifier?.getText() ?? '*';
|
|
102
|
-
const refs = _findReferences(identifier);
|
|
103
|
-
if (refs.length === 0) {
|
|
104
|
-
issues.add({ type: 'exports', filePath, symbol: identifierText });
|
|
105
|
-
}
|
|
106
|
-
else {
|
|
107
|
-
if (hasExternalReferences(refs, filePath))
|
|
108
|
-
return;
|
|
109
|
-
const referencingNodes = _findReferencingNamespaceNodes(sourceFile);
|
|
110
|
-
if (referencingNodes.length > 0) {
|
|
111
|
-
if (!this.isIncludeEntryExports && referencingNodes.length === 1) {
|
|
112
|
-
const referencingSourceFile = referencingNodes.at(0)?.getSourceFile().getFilePath();
|
|
113
|
-
if (this.skipExportsAnalysis.has(referencingSourceFile))
|
|
114
|
-
return;
|
|
115
|
-
}
|
|
116
|
-
if (type) {
|
|
117
|
-
issues.add({ type: 'nsTypes', filePath, symbol: identifierText, symbolType: type });
|
|
118
|
-
}
|
|
119
|
-
else {
|
|
120
|
-
issues.add({ type: 'nsExports', filePath, symbol: identifierText });
|
|
121
|
-
}
|
|
122
|
-
}
|
|
123
|
-
else if (type) {
|
|
124
|
-
issues.add({ type: 'types', filePath, symbol: identifierText, symbolType: type });
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
127
|
-
issues.add({ type: 'exports', filePath, symbol: identifierText });
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
});
|
|
132
|
-
});
|
|
133
|
-
return issues;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../src/index.js';
|
|
4
|
-
import { resolve } from '../src/util/path.js';
|
|
5
|
-
import baseArguments from './helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from './helpers/baseCounters.js';
|
|
7
|
-
test('Resolve modules properly using tsconfig paths from extended config', async () => {
|
|
8
|
-
const cwd = resolve('tests/fixtures/tsconfig-paths-extends');
|
|
9
|
-
const { counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert.deepEqual(counters, {
|
|
14
|
-
...baseCounters,
|
|
15
|
-
processed: 4,
|
|
16
|
-
total: 4,
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../src/index.js';
|
|
4
|
-
import { resolve } from '../src/util/path.js';
|
|
5
|
-
import baseArguments from './helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from './helpers/baseCounters.js';
|
|
7
|
-
test('Resolve modules properly using tsconfig paths with baseUrl', async () => {
|
|
8
|
-
const cwd = resolve('tests/fixtures/tsconfig-paths-implicit');
|
|
9
|
-
const { counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert.deepEqual(counters, {
|
|
14
|
-
...baseCounters,
|
|
15
|
-
processed: 2,
|
|
16
|
-
total: 2,
|
|
17
|
-
});
|
|
18
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import assert from 'node:assert/strict';
|
|
2
|
-
import test from 'node:test';
|
|
3
|
-
import { main } from '../src/index.js';
|
|
4
|
-
import { resolve } from '../src/util/path.js';
|
|
5
|
-
import baseArguments from './helpers/baseArguments.js';
|
|
6
|
-
import baseCounters from './helpers/baseCounters.js';
|
|
7
|
-
test('Resolve modules properly using tsconfig paths and globs', async () => {
|
|
8
|
-
const cwd = resolve('tests/fixtures/tsconfig-paths');
|
|
9
|
-
const { issues, counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert.equal(issues.dependencies['package.json']['internal'].symbol, 'internal');
|
|
14
|
-
assert.equal(issues.unlisted['index.ts']['@unknown'].symbol, '@unknown');
|
|
15
|
-
assert.equal(issues.unlisted['index.ts']['unresolved/dir'].symbol, 'unresolved/dir');
|
|
16
|
-
assert.equal(issues.exports['internal-package/index.ts']['unused'].symbol, 'unused');
|
|
17
|
-
assert.equal(issues.exports['unprefixed/module.ts']['unused'].symbol, 'unused');
|
|
18
|
-
assert.deepEqual(counters, {
|
|
19
|
-
...baseCounters,
|
|
20
|
-
dependencies: 1,
|
|
21
|
-
unlisted: 2,
|
|
22
|
-
exports: 2,
|
|
23
|
-
processed: 4,
|
|
24
|
-
total: 4,
|
|
25
|
-
});
|
|
26
|
-
});
|