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
|
@@ -31,16 +31,20 @@ const pluginSchema = z.union([
|
|
|
31
31
|
}),
|
|
32
32
|
]);
|
|
33
33
|
const pluginsSchema = z.object({
|
|
34
|
+
ava: pluginSchema,
|
|
34
35
|
babel: pluginSchema,
|
|
35
36
|
capacitor: pluginSchema,
|
|
36
37
|
changesets: pluginSchema,
|
|
38
|
+
commitizen: pluginSchema,
|
|
37
39
|
commitlint: pluginSchema,
|
|
40
|
+
cspell: pluginSchema,
|
|
38
41
|
cypress: pluginSchema,
|
|
39
42
|
eslint: pluginSchema,
|
|
40
43
|
gatsby: pluginSchema,
|
|
41
44
|
'github-actions': pluginSchema,
|
|
42
45
|
husky: pluginSchema,
|
|
43
46
|
jest: pluginSchema,
|
|
47
|
+
lefthook: pluginSchema,
|
|
44
48
|
'lint-staged': pluginSchema,
|
|
45
49
|
markdownlint: pluginSchema,
|
|
46
50
|
mocha: pluginSchema,
|
|
@@ -55,9 +59,12 @@ const pluginsSchema = z.object({
|
|
|
55
59
|
remark: pluginSchema,
|
|
56
60
|
remix: pluginSchema,
|
|
57
61
|
rollup: pluginSchema,
|
|
62
|
+
'semantic-release': pluginSchema,
|
|
58
63
|
sentry: pluginSchema,
|
|
59
64
|
storybook: pluginSchema,
|
|
60
65
|
stryker: pluginSchema,
|
|
66
|
+
tailwind: pluginSchema,
|
|
67
|
+
typedoc: pluginSchema,
|
|
61
68
|
typescript: pluginSchema,
|
|
62
69
|
vitest: pluginSchema,
|
|
63
70
|
webpack: pluginSchema,
|
|
@@ -4,14 +4,14 @@ import { load } from '../../util/plugin.js';
|
|
|
4
4
|
import { _resolve } from '../../util/require.js';
|
|
5
5
|
import { fallback } from './fallback.js';
|
|
6
6
|
const getDependencies = (config) => {
|
|
7
|
-
const
|
|
8
|
-
if (
|
|
9
|
-
|
|
7
|
+
const extendsSpecifiers = config.extends ? [config.extends].flat().map(resolveExtendsSpecifier) : [];
|
|
8
|
+
if (extendsSpecifiers.includes('eslint-plugin-prettier'))
|
|
9
|
+
extendsSpecifiers.push('eslint-config-prettier');
|
|
10
10
|
const plugins = config.plugins ? config.plugins.map(resolvePluginPackageName) : [];
|
|
11
11
|
const parser = config.parser;
|
|
12
12
|
const extraParsers = config.parserOptions?.babelOptions?.presets ?? [];
|
|
13
13
|
const settings = config.settings ? getDependenciesFromSettings(config.settings) : [];
|
|
14
|
-
return compact([...
|
|
14
|
+
return compact([...extendsSpecifiers, ...plugins, parser, ...extraParsers, ...settings]);
|
|
15
15
|
};
|
|
16
16
|
export const getDependenciesDeep = async (configFilePath, dependencies = new Set(), options) => {
|
|
17
17
|
const addAll = (deps) => deps.forEach(dependency => dependencies.add(dependency));
|
|
@@ -56,16 +56,16 @@ const resolvePackageName = (namespace, pluginName) => {
|
|
|
56
56
|
: `${namespace}-${pluginName}`;
|
|
57
57
|
};
|
|
58
58
|
export const resolvePluginPackageName = (pluginName) => resolvePackageName('eslint-plugin', pluginName);
|
|
59
|
-
const
|
|
60
|
-
if (isInternal(
|
|
59
|
+
const resolveExtendsSpecifier = (specifier) => {
|
|
60
|
+
if (isInternal(specifier))
|
|
61
61
|
return;
|
|
62
|
-
if (
|
|
63
|
-
const pluginName =
|
|
62
|
+
if (specifier.includes(':')) {
|
|
63
|
+
const pluginName = specifier.replace(/^plugin:/, '').replace(/(\/|:).+$/, '');
|
|
64
64
|
if (pluginName === 'eslint')
|
|
65
65
|
return;
|
|
66
66
|
return resolvePackageName('eslint-plugin', pluginName);
|
|
67
67
|
}
|
|
68
|
-
return
|
|
68
|
+
return specifier.includes('eslint') ? specifier : resolvePackageName('eslint-config', specifier);
|
|
69
69
|
};
|
|
70
70
|
const getImportPluginDependencies = (settings) => {
|
|
71
71
|
const knownKeys = ['typescript'];
|
package/dist/plugins/index.d.ts
CHANGED
|
@@ -31,6 +31,7 @@ export * as sentry from './sentry/index.js';
|
|
|
31
31
|
export * as storybook from './storybook/index.js';
|
|
32
32
|
export * as stryker from './stryker/index.js';
|
|
33
33
|
export * as svelte from './svelte/index.js';
|
|
34
|
+
export * as tailwind from './tailwind/index.js';
|
|
34
35
|
export * as typedoc from './typedoc/index.js';
|
|
35
36
|
export * as typescript from './typescript/index.js';
|
|
36
37
|
export * as vitest from './vitest/index.js';
|
package/dist/plugins/index.js
CHANGED
|
@@ -31,6 +31,7 @@ export * as sentry from './sentry/index.js';
|
|
|
31
31
|
export * as storybook from './storybook/index.js';
|
|
32
32
|
export * as stryker from './stryker/index.js';
|
|
33
33
|
export * as svelte from './svelte/index.js';
|
|
34
|
+
export * as tailwind from './tailwind/index.js';
|
|
34
35
|
export * as typedoc from './typedoc/index.js';
|
|
35
36
|
export * as typescript from './typescript/index.js';
|
|
36
37
|
export * as vitest from './vitest/index.js';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { hasDependency } from '../../util/plugin.js';
|
|
2
|
+
export const NAME = 'Tailwind';
|
|
3
|
+
export const ENABLERS = ['tailwindcss'];
|
|
4
|
+
export const isEnabled = ({ dependencies }) => hasDependency(dependencies, ENABLERS);
|
|
5
|
+
export const CONFIG_FILE_PATTERNS = ['tailwind.config.js'];
|
package/dist/types/ast.d.ts
CHANGED
package/dist/types/issues.d.ts
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
export
|
|
1
|
+
export declare enum SymbolType {
|
|
2
|
+
TYPE = "type",
|
|
3
|
+
INTERFACE = "interface",
|
|
4
|
+
ENUM = "enum",
|
|
5
|
+
FUNCTION = "function",
|
|
6
|
+
CLASS = "class",
|
|
7
|
+
MEMBER = "member",
|
|
8
|
+
UNKNOWN = "unknown"
|
|
9
|
+
}
|
|
2
10
|
export type Issue = {
|
|
3
11
|
type: SymbolIssueType;
|
|
4
12
|
filePath: string;
|
package/dist/types/issues.js
CHANGED
|
@@ -1 +1,10 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var SymbolType;
|
|
2
|
+
(function (SymbolType) {
|
|
3
|
+
SymbolType["TYPE"] = "type";
|
|
4
|
+
SymbolType["INTERFACE"] = "interface";
|
|
5
|
+
SymbolType["ENUM"] = "enum";
|
|
6
|
+
SymbolType["FUNCTION"] = "function";
|
|
7
|
+
SymbolType["CLASS"] = "class";
|
|
8
|
+
SymbolType["MEMBER"] = "member";
|
|
9
|
+
SymbolType["UNKNOWN"] = "unknown";
|
|
10
|
+
})(SymbolType || (SymbolType = {}));
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { isBuiltin } from 'node:module';
|
|
2
2
|
import ts from 'typescript';
|
|
3
|
+
import { SymbolType } from '../types/issues.js';
|
|
3
4
|
import { isInNodeModules } from '../util/path.js';
|
|
4
5
|
import * as ast from './ast-helpers.js';
|
|
5
6
|
export const getImportsAndExports = (sourceFile, options) => {
|
|
@@ -215,7 +216,7 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
215
216
|
}
|
|
216
217
|
const modifierKinds = node.modifiers?.map(modifier => modifier.kind) ?? [];
|
|
217
218
|
if (ts.isExportAssignment(node)) {
|
|
218
|
-
addExport({ node, identifier: 'default', type:
|
|
219
|
+
addExport({ node, identifier: 'default', type: SymbolType.UNKNOWN, pos: node.expression.getStart() });
|
|
219
220
|
maybeAddAliasedExport(node.expression, 'default');
|
|
220
221
|
}
|
|
221
222
|
if (modifierKinds.includes(ts.SyntaxKind.ExportKeyword)) {
|
|
@@ -227,7 +228,7 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
227
228
|
addExport({
|
|
228
229
|
node: element,
|
|
229
230
|
identifier: element.name.escapedText.toString(),
|
|
230
|
-
type:
|
|
231
|
+
type: SymbolType.UNKNOWN,
|
|
231
232
|
pos: element.name.getStart(),
|
|
232
233
|
});
|
|
233
234
|
}
|
|
@@ -239,7 +240,7 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
239
240
|
addExport({
|
|
240
241
|
node: element,
|
|
241
242
|
identifier: element.getText(),
|
|
242
|
-
type:
|
|
243
|
+
type: SymbolType.UNKNOWN,
|
|
243
244
|
pos: element.getStart(),
|
|
244
245
|
});
|
|
245
246
|
}
|
|
@@ -247,7 +248,7 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
247
248
|
}
|
|
248
249
|
else {
|
|
249
250
|
const identifier = declaration.name.getText();
|
|
250
|
-
addExport({ node: declaration, identifier, type:
|
|
251
|
+
addExport({ node: declaration, identifier, type: SymbolType.UNKNOWN, pos: declaration.name.getStart() });
|
|
251
252
|
maybeAddAliasedExport(declaration.initializer, identifier);
|
|
252
253
|
}
|
|
253
254
|
});
|
|
@@ -255,7 +256,7 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
255
256
|
if (ts.isFunctionDeclaration(node) && node.name) {
|
|
256
257
|
const identifier = modifierKinds.includes(ts.SyntaxKind.DefaultKeyword) ? 'default' : node.name.getText();
|
|
257
258
|
const pos = (node.name ?? node.body ?? node).getStart();
|
|
258
|
-
addExport({ node, identifier, pos, type:
|
|
259
|
+
addExport({ node, identifier, pos, type: SymbolType.FUNCTION });
|
|
259
260
|
}
|
|
260
261
|
if (ts.isClassDeclaration(node) && node.name) {
|
|
261
262
|
const identifier = modifierKinds.includes(ts.SyntaxKind.DefaultKeyword) ? 'default' : node.name.getText();
|
|
@@ -266,15 +267,15 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
266
267
|
node: member,
|
|
267
268
|
identifier: member.name.getText(),
|
|
268
269
|
pos: member.name.getStart(),
|
|
269
|
-
type:
|
|
270
|
+
type: SymbolType.MEMBER,
|
|
270
271
|
}));
|
|
271
|
-
addExport({ node, identifier, type:
|
|
272
|
+
addExport({ node, identifier, type: SymbolType.CLASS, pos, members });
|
|
272
273
|
}
|
|
273
274
|
if (ts.isTypeAliasDeclaration(node)) {
|
|
274
|
-
addExport({ node, identifier: node.name.getText(), type:
|
|
275
|
+
addExport({ node, identifier: node.name.getText(), type: SymbolType.TYPE, pos: node.name.getStart() });
|
|
275
276
|
}
|
|
276
277
|
if (ts.isInterfaceDeclaration(node)) {
|
|
277
|
-
addExport({ node, identifier: node.name.getText(), type:
|
|
278
|
+
addExport({ node, identifier: node.name.getText(), type: SymbolType.INTERFACE, pos: node.name.getStart() });
|
|
278
279
|
}
|
|
279
280
|
if (ts.isEnumDeclaration(node)) {
|
|
280
281
|
const identifier = modifierKinds.includes(ts.SyntaxKind.DefaultKeyword) ? 'default' : node.name.getText();
|
|
@@ -283,9 +284,9 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
283
284
|
node: member,
|
|
284
285
|
identifier: ast.stripQuotes(member.name.getText()),
|
|
285
286
|
pos: member.name.getStart(),
|
|
286
|
-
type:
|
|
287
|
+
type: SymbolType.MEMBER,
|
|
287
288
|
}));
|
|
288
|
-
addExport({ node, identifier, type:
|
|
289
|
+
addExport({ node, identifier, type: SymbolType.ENUM, pos, members });
|
|
289
290
|
}
|
|
290
291
|
}
|
|
291
292
|
if (ts.isExportDeclaration(node)) {
|
|
@@ -305,7 +306,7 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
305
306
|
}
|
|
306
307
|
}
|
|
307
308
|
else if (node.exportClause && ts.isNamedExports(node.exportClause)) {
|
|
308
|
-
const type = node.isTypeOnly ?
|
|
309
|
+
const type = node.isTypeOnly ? SymbolType.TYPE : SymbolType.UNKNOWN;
|
|
309
310
|
node.exportClause.elements.forEach(element => {
|
|
310
311
|
addExport({ node: element, identifier: element.name.getText(), type, pos: element.name.pos });
|
|
311
312
|
});
|
|
@@ -316,22 +317,22 @@ export const getImportsAndExports = (sourceFile, options) => {
|
|
|
316
317
|
if (ts.isPropertyAccessExpression(parent)) {
|
|
317
318
|
const identifier = parent.name.getText();
|
|
318
319
|
const pos = parent.name.getStart();
|
|
319
|
-
addExport({ node, identifier, type:
|
|
320
|
+
addExport({ node, identifier, type: SymbolType.UNKNOWN, pos });
|
|
320
321
|
}
|
|
321
322
|
else if (ts.isElementAccessExpression(parent)) {
|
|
322
323
|
const identifier = ast.stripQuotes(parent.argumentExpression.getText());
|
|
323
324
|
const pos = parent.argumentExpression.getStart();
|
|
324
|
-
addExport({ node, identifier, type:
|
|
325
|
+
addExport({ node, identifier, type: SymbolType.UNKNOWN, pos });
|
|
325
326
|
}
|
|
326
327
|
else if (ts.isBinaryExpression(parent)) {
|
|
327
328
|
const expr = parent.right;
|
|
328
329
|
if (ts.isObjectLiteralExpression(expr) && expr.properties.every(ts.isShorthandPropertyAssignment)) {
|
|
329
330
|
expr.properties.forEach(node => {
|
|
330
|
-
addExport({ node, identifier: node.getText(), type:
|
|
331
|
+
addExport({ node, identifier: node.getText(), type: SymbolType.UNKNOWN, pos: node.pos });
|
|
331
332
|
});
|
|
332
333
|
}
|
|
333
334
|
else {
|
|
334
|
-
addExport({ node, identifier: 'default', type:
|
|
335
|
+
addExport({ node, identifier: 'default', type: SymbolType.UNKNOWN, pos: node.getStart() });
|
|
335
336
|
}
|
|
336
337
|
}
|
|
337
338
|
}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import ts from 'typescript';
|
|
2
|
-
import { isAbsolute, join } from '../util/path.js';
|
|
3
2
|
import { ensureRealFilePath, isVirtualFilePath } from './utils.js';
|
|
4
3
|
export function createCustomModuleResolver(customSys, compilerOptions, virtualFileExtensions) {
|
|
5
4
|
function resolveModuleNames(moduleNames, containingFile) {
|
|
@@ -7,9 +6,6 @@ export function createCustomModuleResolver(customSys, compilerOptions, virtualFi
|
|
|
7
6
|
}
|
|
8
7
|
function resolveModuleName(name, containingFile) {
|
|
9
8
|
const tsResolvedModule = ts.resolveModuleName(name, containingFile, compilerOptions, ts.sys).resolvedModule;
|
|
10
|
-
if (tsResolvedModule && !isAbsolute(tsResolvedModule?.resolvedFileName)) {
|
|
11
|
-
tsResolvedModule.resolvedFileName = join(customSys.getCurrentDirectory(), tsResolvedModule.resolvedFileName);
|
|
12
|
-
}
|
|
13
9
|
if (virtualFileExtensions.length === 0)
|
|
14
10
|
return tsResolvedModule;
|
|
15
11
|
if (tsResolvedModule && !isVirtualFilePath(tsResolvedModule.resolvedFileName, virtualFileExtensions)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const helpText = "\u2702\uFE0F Find unused files, dependencies and exports in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.js, knip.ts or package.json#knip)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n --production Analyze only production source files (e.g. no tests, devDependencies, exported types)\n --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n --workspace Analyze a single workspace (default: analyze all configured workspaces)\n --
|
|
1
|
+
export declare const helpText = "\u2702\uFE0F Find unused files, dependencies and exports in your JavaScript and TypeScript projects\n\nUsage: knip [options]\n\nOptions:\n -c, --config [file] Configuration file path (default: [.]knip.json[c], knip.js, knip.ts or package.json#knip)\n -t, --tsConfig [file] TypeScript configuration path (default: tsconfig.json)\n --production Analyze only production source files (e.g. no tests, devDependencies, exported types)\n --strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)\n --workspace Analyze a single workspace (default: analyze all configured workspaces)\n --no-gitignore Don't use .gitignore\n --include Report only provided issue type(s), can be comma-separated or repeated (1)\n --exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)\n --dependencies Shortcut for --include dependencies,unlisted,unresolved\n --exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates\n --no-progress Don't show dynamic progress updates\n --reporter Select reporter: symbols, compact, codeowners, json (default: symbols)\n --reporter-options Pass extra options to the reporter (as JSON string, see example)\n --no-exit-code Always exit with code zero (0)\n --max-issues Maximum number of issues before non-zero exit code (default: 0)\n --debug Show debug output\n --debug-file-filter Filter for files in debug output (regex as string)\n --performance Measure count and running time of expensive functions and display stats table\n --h, --help Print this help text\n --V, version Print version\n\n(1) Issue types: files, dependencies, unlisted, unresolved, exports, nsExports, classMembers, types, nsTypes, enumMembers, duplicates\n\nExamples:\n\n$ knip\n$ knip --production\n$ knip --workspace packages/client --include files,dependencies\n$ knip -c ./config/knip.json --reporter compact\n$ knip --reporter codeowners --reporter-options '{\"path\":\".github/CODEOWNERS\"}'\n$ knip --debug --debug-file-filter '(specific|particular)-module'\n\nMore documentation and bug reports: https://github.com/webpro/knip";
|
|
2
2
|
declare const _default: {
|
|
3
3
|
values: {
|
|
4
4
|
config: string | undefined;
|
|
@@ -8,7 +8,6 @@ declare const _default: {
|
|
|
8
8
|
exclude: string[] | undefined;
|
|
9
9
|
exports: boolean | undefined;
|
|
10
10
|
help: boolean | undefined;
|
|
11
|
-
ignore: string[] | undefined;
|
|
12
11
|
include: string[] | undefined;
|
|
13
12
|
'max-issues': string | undefined;
|
|
14
13
|
'no-exit-code': boolean | undefined;
|
|
@@ -9,11 +9,10 @@ Options:
|
|
|
9
9
|
--production Analyze only production source files (e.g. no tests, devDependencies, exported types)
|
|
10
10
|
--strict Consider only direct dependencies of workspace (not devDependencies, not other workspaces)
|
|
11
11
|
--workspace Analyze a single workspace (default: analyze all configured workspaces)
|
|
12
|
-
--ignore Ignore files matching this glob pattern, can be repeated
|
|
13
12
|
--no-gitignore Don't use .gitignore
|
|
14
13
|
--include Report only provided issue type(s), can be comma-separated or repeated (1)
|
|
15
14
|
--exclude Exclude provided issue type(s) from report, can be comma-separated or repeated (1)
|
|
16
|
-
--dependencies Shortcut for --include dependencies,unlisted
|
|
15
|
+
--dependencies Shortcut for --include dependencies,unlisted,unresolved
|
|
17
16
|
--exports Shortcut for --include exports,nsExports,classMembers,types,nsTypes,enumMembers,duplicates
|
|
18
17
|
--no-progress Don't show dynamic progress updates
|
|
19
18
|
--reporter Select reporter: symbols, compact, codeowners, json (default: symbols)
|
|
@@ -47,7 +46,6 @@ export default parseArgs({
|
|
|
47
46
|
exclude: { type: 'string', multiple: true },
|
|
48
47
|
exports: { type: 'boolean' },
|
|
49
48
|
help: { type: 'boolean', short: 'h' },
|
|
50
|
-
ignore: { type: 'string', multiple: true },
|
|
51
49
|
include: { type: 'string', multiple: true },
|
|
52
50
|
'max-issues': { type: 'string' },
|
|
53
51
|
'no-exit-code': { type: 'boolean' },
|
package/dist/util/compilers.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RawConfiguration } from '../types/config.js';
|
|
2
2
|
export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
3
3
|
exclude?: string[] | undefined;
|
|
4
|
-
ignore?: string | string[] | undefined;
|
|
5
4
|
include?: string[] | undefined;
|
|
6
5
|
entry?: string | string[] | undefined;
|
|
7
6
|
project?: string | string[] | undefined;
|
|
8
7
|
paths?: Record<string, string[]> | undefined;
|
|
8
|
+
ignore?: string | string[] | undefined;
|
|
9
9
|
ignoreBinaries?: string[] | undefined;
|
|
10
10
|
ignoreDependencies?: string[] | undefined;
|
|
11
11
|
ignoreWorkspaces?: string[] | undefined;
|
|
@@ -13,12 +13,17 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
13
13
|
syncCompilers?: Record<string, (args_0: string, ...args_1: unknown[]) => string> | undefined;
|
|
14
14
|
asyncCompilers?: Record<string, (args_0: string, ...args_1: unknown[]) => Promise<string>> | undefined;
|
|
15
15
|
workspaces?: Record<string, {
|
|
16
|
-
ignore?: string | string[] | undefined;
|
|
17
16
|
entry?: string | string[] | undefined;
|
|
18
17
|
project?: string | string[] | undefined;
|
|
19
18
|
paths?: Record<string, string[]> | undefined;
|
|
19
|
+
ignore?: string | string[] | undefined;
|
|
20
20
|
ignoreBinaries?: string[] | undefined;
|
|
21
21
|
ignoreDependencies?: string[] | undefined;
|
|
22
|
+
ava?: string | false | string[] | {
|
|
23
|
+
config?: string | string[] | undefined;
|
|
24
|
+
entry?: string | string[] | undefined;
|
|
25
|
+
project?: string | string[] | undefined;
|
|
26
|
+
} | undefined;
|
|
22
27
|
babel?: string | false | string[] | {
|
|
23
28
|
config?: string | string[] | undefined;
|
|
24
29
|
entry?: string | string[] | undefined;
|
|
@@ -34,11 +39,21 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
34
39
|
entry?: string | string[] | undefined;
|
|
35
40
|
project?: string | string[] | undefined;
|
|
36
41
|
} | undefined;
|
|
42
|
+
commitizen?: string | false | string[] | {
|
|
43
|
+
config?: string | string[] | undefined;
|
|
44
|
+
entry?: string | string[] | undefined;
|
|
45
|
+
project?: string | string[] | undefined;
|
|
46
|
+
} | undefined;
|
|
37
47
|
commitlint?: string | false | string[] | {
|
|
38
48
|
config?: string | string[] | undefined;
|
|
39
49
|
entry?: string | string[] | undefined;
|
|
40
50
|
project?: string | string[] | undefined;
|
|
41
51
|
} | undefined;
|
|
52
|
+
cspell?: string | false | string[] | {
|
|
53
|
+
config?: string | string[] | undefined;
|
|
54
|
+
entry?: string | string[] | undefined;
|
|
55
|
+
project?: string | string[] | undefined;
|
|
56
|
+
} | undefined;
|
|
42
57
|
cypress?: string | false | string[] | {
|
|
43
58
|
config?: string | string[] | undefined;
|
|
44
59
|
entry?: string | string[] | undefined;
|
|
@@ -69,6 +84,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
69
84
|
entry?: string | string[] | undefined;
|
|
70
85
|
project?: string | string[] | undefined;
|
|
71
86
|
} | undefined;
|
|
87
|
+
lefthook?: string | false | string[] | {
|
|
88
|
+
config?: string | string[] | undefined;
|
|
89
|
+
entry?: string | string[] | undefined;
|
|
90
|
+
project?: string | string[] | undefined;
|
|
91
|
+
} | undefined;
|
|
72
92
|
'lint-staged'?: string | false | string[] | {
|
|
73
93
|
config?: string | string[] | undefined;
|
|
74
94
|
entry?: string | string[] | undefined;
|
|
@@ -139,6 +159,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
139
159
|
entry?: string | string[] | undefined;
|
|
140
160
|
project?: string | string[] | undefined;
|
|
141
161
|
} | undefined;
|
|
162
|
+
'semantic-release'?: string | false | string[] | {
|
|
163
|
+
config?: string | string[] | undefined;
|
|
164
|
+
entry?: string | string[] | undefined;
|
|
165
|
+
project?: string | string[] | undefined;
|
|
166
|
+
} | undefined;
|
|
142
167
|
sentry?: string | false | string[] | {
|
|
143
168
|
config?: string | string[] | undefined;
|
|
144
169
|
entry?: string | string[] | undefined;
|
|
@@ -154,6 +179,16 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
154
179
|
entry?: string | string[] | undefined;
|
|
155
180
|
project?: string | string[] | undefined;
|
|
156
181
|
} | undefined;
|
|
182
|
+
tailwind?: string | false | string[] | {
|
|
183
|
+
config?: string | string[] | undefined;
|
|
184
|
+
entry?: string | string[] | undefined;
|
|
185
|
+
project?: string | string[] | undefined;
|
|
186
|
+
} | undefined;
|
|
187
|
+
typedoc?: string | false | string[] | {
|
|
188
|
+
config?: string | string[] | undefined;
|
|
189
|
+
entry?: string | string[] | undefined;
|
|
190
|
+
project?: string | string[] | undefined;
|
|
191
|
+
} | undefined;
|
|
157
192
|
typescript?: string | false | string[] | {
|
|
158
193
|
config?: string | string[] | undefined;
|
|
159
194
|
entry?: string | string[] | undefined;
|
|
@@ -170,6 +205,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
170
205
|
project?: string | string[] | undefined;
|
|
171
206
|
} | undefined;
|
|
172
207
|
}> | undefined;
|
|
208
|
+
ava?: string | false | string[] | {
|
|
209
|
+
config?: string | string[] | undefined;
|
|
210
|
+
entry?: string | string[] | undefined;
|
|
211
|
+
project?: string | string[] | undefined;
|
|
212
|
+
} | undefined;
|
|
173
213
|
babel?: string | false | string[] | {
|
|
174
214
|
config?: string | string[] | undefined;
|
|
175
215
|
entry?: string | string[] | undefined;
|
|
@@ -185,11 +225,21 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
185
225
|
entry?: string | string[] | undefined;
|
|
186
226
|
project?: string | string[] | undefined;
|
|
187
227
|
} | undefined;
|
|
228
|
+
commitizen?: string | false | string[] | {
|
|
229
|
+
config?: string | string[] | undefined;
|
|
230
|
+
entry?: string | string[] | undefined;
|
|
231
|
+
project?: string | string[] | undefined;
|
|
232
|
+
} | undefined;
|
|
188
233
|
commitlint?: string | false | string[] | {
|
|
189
234
|
config?: string | string[] | undefined;
|
|
190
235
|
entry?: string | string[] | undefined;
|
|
191
236
|
project?: string | string[] | undefined;
|
|
192
237
|
} | undefined;
|
|
238
|
+
cspell?: string | false | string[] | {
|
|
239
|
+
config?: string | string[] | undefined;
|
|
240
|
+
entry?: string | string[] | undefined;
|
|
241
|
+
project?: string | string[] | undefined;
|
|
242
|
+
} | undefined;
|
|
193
243
|
cypress?: string | false | string[] | {
|
|
194
244
|
config?: string | string[] | undefined;
|
|
195
245
|
entry?: string | string[] | undefined;
|
|
@@ -220,6 +270,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
220
270
|
entry?: string | string[] | undefined;
|
|
221
271
|
project?: string | string[] | undefined;
|
|
222
272
|
} | undefined;
|
|
273
|
+
lefthook?: string | false | string[] | {
|
|
274
|
+
config?: string | string[] | undefined;
|
|
275
|
+
entry?: string | string[] | undefined;
|
|
276
|
+
project?: string | string[] | undefined;
|
|
277
|
+
} | undefined;
|
|
223
278
|
'lint-staged'?: string | false | string[] | {
|
|
224
279
|
config?: string | string[] | undefined;
|
|
225
280
|
entry?: string | string[] | undefined;
|
|
@@ -290,6 +345,11 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
290
345
|
entry?: string | string[] | undefined;
|
|
291
346
|
project?: string | string[] | undefined;
|
|
292
347
|
} | undefined;
|
|
348
|
+
'semantic-release'?: string | false | string[] | {
|
|
349
|
+
config?: string | string[] | undefined;
|
|
350
|
+
entry?: string | string[] | undefined;
|
|
351
|
+
project?: string | string[] | undefined;
|
|
352
|
+
} | undefined;
|
|
293
353
|
sentry?: string | false | string[] | {
|
|
294
354
|
config?: string | string[] | undefined;
|
|
295
355
|
entry?: string | string[] | undefined;
|
|
@@ -305,6 +365,16 @@ export declare const partitionCompilers: (rawLocalConfig: RawConfiguration) => {
|
|
|
305
365
|
entry?: string | string[] | undefined;
|
|
306
366
|
project?: string | string[] | undefined;
|
|
307
367
|
} | undefined;
|
|
368
|
+
tailwind?: string | false | string[] | {
|
|
369
|
+
config?: string | string[] | undefined;
|
|
370
|
+
entry?: string | string[] | undefined;
|
|
371
|
+
project?: string | string[] | undefined;
|
|
372
|
+
} | undefined;
|
|
373
|
+
typedoc?: string | false | string[] | {
|
|
374
|
+
config?: string | string[] | undefined;
|
|
375
|
+
entry?: string | string[] | undefined;
|
|
376
|
+
project?: string | string[] | undefined;
|
|
377
|
+
} | undefined;
|
|
308
378
|
typescript?: string | false | string[] | {
|
|
309
379
|
config?: string | string[] | undefined;
|
|
310
380
|
entry?: string | string[] | undefined;
|
package/dist/util/performance.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { performance, PerformanceObserver } from 'node:perf_hooks';
|
|
2
2
|
import EasyTable from 'easy-table';
|
|
3
|
-
import parsedArgs from './cli-arguments.js';
|
|
4
3
|
import Summary from 'summary';
|
|
4
|
+
import parsedArgs from './cli-arguments.js';
|
|
5
5
|
const { performance: isEnabled = false } = parsedArgs.values;
|
|
6
6
|
export const timerify = fn => (isEnabled ? performance.timerify(fn) : fn);
|
|
7
7
|
export class Performance {
|
package/dist/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "2.0.0
|
|
1
|
+
export declare const version = "2.0.0";
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.0.0
|
|
1
|
+
export const version = '2.0.0';
|
|
@@ -50,7 +50,7 @@ export declare class WorkspaceWorker {
|
|
|
50
50
|
peerDependencies: PeerDependencies;
|
|
51
51
|
installedBinaries: InstalledBinaries;
|
|
52
52
|
referencedDependencies: ReferencedDependencies;
|
|
53
|
-
enabledPlugins: ("typescript" | "babel" | "capacitor" | "changesets" | "commitlint" | "cypress" | "eslint" | "gatsby" | "husky" | "jest" | "markdownlint" | "mocha" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "
|
|
53
|
+
enabledPlugins: ("typescript" | "ava" | "babel" | "capacitor" | "changesets" | "commitizen" | "commitlint" | "cspell" | "cypress" | "eslint" | "gatsby" | "husky" | "jest" | "lefthook" | "markdownlint" | "mocha" | "next" | "nx" | "nyc" | "playwright" | "postcss" | "prettier" | "remark" | "remix" | "rollup" | "sentry" | "storybook" | "stryker" | "tailwind" | "typedoc" | "vitest" | "webpack" | "githubActions" | "lintStaged" | "npmPackageJsonLint" | "releaseIt" | "semanticRelease" | "svelte")[];
|
|
54
54
|
}>;
|
|
55
55
|
}
|
|
56
56
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "knip",
|
|
3
|
-
"version": "2.0.0
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Find unused files, dependencies and exports in your TypeScript and JavaScript projects",
|
|
5
5
|
"homepage": "https://github.com/webpro/knip",
|
|
6
6
|
"repository": "github:webpro/knip",
|
|
@@ -23,8 +23,9 @@
|
|
|
23
23
|
"lint:fix": "eslint src tests --fix",
|
|
24
24
|
"format": "prettier scripts src tests schema.json --with-node-modules --write --config .prettierrc",
|
|
25
25
|
"test": "globstar -- node --loader tsx --test \"tests/**/*.test.ts\"",
|
|
26
|
+
"coverage": "c8 npm test",
|
|
26
27
|
"watch": "tsc --watch",
|
|
27
|
-
"
|
|
28
|
+
"prebuild": "node -e \"require('fs').rmSync('dist', { force: true, recursive: true })\"",
|
|
28
29
|
"build": "tsc",
|
|
29
30
|
"docs": "npm run docs:cli && npm run docs:plugins && npm run docs:format",
|
|
30
31
|
"docs:cli": "tsx ./scripts/update-cli-usage-in-readme.ts",
|
|
@@ -33,7 +34,7 @@
|
|
|
33
34
|
"qa": "npm run lint && npm run build && npm run knip && npm run knip:production && npm test",
|
|
34
35
|
"release": "release-it",
|
|
35
36
|
"create-plugin": "tsx ./scripts/create-new-plugin.ts",
|
|
36
|
-
"postcreate-plugin": "prettier schema.json --write --config .prettierrc --loglevel silent"
|
|
37
|
+
"postcreate-plugin": "prettier schema.json src/configuration-validator.ts --write --config .prettierrc --loglevel silent"
|
|
37
38
|
},
|
|
38
39
|
"files": [
|
|
39
40
|
"dist",
|
|
@@ -61,24 +62,25 @@
|
|
|
61
62
|
"@jest/types": "29.5.0",
|
|
62
63
|
"@npmcli/package-json": "3.0.0",
|
|
63
64
|
"@release-it/bumper": "4.0.2",
|
|
64
|
-
"@types/eslint": "8.21.
|
|
65
|
+
"@types/eslint": "8.21.3",
|
|
65
66
|
"@types/js-yaml": "4.0.5",
|
|
66
67
|
"@types/micromatch": "4.0.2",
|
|
67
68
|
"@types/minimist": "1.2.2",
|
|
68
|
-
"@types/node": "18.15.
|
|
69
|
+
"@types/node": "18.15.5",
|
|
69
70
|
"@types/npmcli__map-workspaces": "3.0.0",
|
|
70
71
|
"@types/webpack": "5.28.0",
|
|
71
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
72
|
-
"@typescript-eslint/parser": "5.
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "5.56.0",
|
|
73
|
+
"@typescript-eslint/parser": "5.56.0",
|
|
74
|
+
"c8": "7.13.0",
|
|
73
75
|
"eslint": "8.36.0",
|
|
74
76
|
"eslint-import-resolver-typescript": "3.5.3",
|
|
75
77
|
"eslint-plugin-import": "2.27.5",
|
|
76
78
|
"globstar": "1.0.0",
|
|
77
|
-
"prettier": "2.8.
|
|
78
|
-
"release-it": "15.9.
|
|
79
|
+
"prettier": "2.8.6",
|
|
80
|
+
"release-it": "15.9.1",
|
|
79
81
|
"remark-cli": "11.0.0",
|
|
80
82
|
"remark-preset-webpro": "0.0.2",
|
|
81
|
-
"tsx": "3.12.
|
|
83
|
+
"tsx": "3.12.6",
|
|
82
84
|
"type-fest": "3.6.1"
|
|
83
85
|
},
|
|
84
86
|
"engines": {
|
package/schema.json
CHANGED
|
@@ -308,6 +308,10 @@
|
|
|
308
308
|
"title": "svelte plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/svelte/README.md)",
|
|
309
309
|
"$ref": "#/definitions/plugin"
|
|
310
310
|
},
|
|
311
|
+
"tailwind": {
|
|
312
|
+
"title": "tailwind plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/tailwind/README.md)",
|
|
313
|
+
"$ref": "#/definitions/plugin"
|
|
314
|
+
},
|
|
311
315
|
"typedoc": {
|
|
312
316
|
"title": "typedoc plugin configuration (https://github.com/webpro/knip/blob/main/src/plugins/typedoc/README.md)",
|
|
313
317
|
"$ref": "#/definitions/plugin"
|
package/dist/commonjs.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
package/dist/commonjs.test.js
DELETED
|
@@ -1,29 +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('Find unused files and exports', async () => {
|
|
8
|
-
const cwd = resolve('tests/fixtures/commonjs');
|
|
9
|
-
const { issues, counters } = await main({
|
|
10
|
-
...baseArguments,
|
|
11
|
-
cwd,
|
|
12
|
-
});
|
|
13
|
-
assert(issues.exports['dir/mod1.js']['identifier2']);
|
|
14
|
-
assert(issues.unlisted['index.js']['side-effects']);
|
|
15
|
-
assert(issues.unlisted['index.js']['aliased-binding']);
|
|
16
|
-
assert(issues.unlisted['index.js']['default-identifier']);
|
|
17
|
-
assert(issues.unlisted['index.js']['named-object-binding']);
|
|
18
|
-
assert(issues.unlisted['index.js']['no-substitution-tpl-literal']);
|
|
19
|
-
assert(issues.unlisted['index.js']['string-literal-resolve']);
|
|
20
|
-
assert(issues.unlisted['dir/mod.js']['string-literal']);
|
|
21
|
-
assert(issues.unlisted['dir/mod.js']['another-unlisted']);
|
|
22
|
-
assert.deepEqual(counters, {
|
|
23
|
-
...baseCounters,
|
|
24
|
-
exports: 1,
|
|
25
|
-
unlisted: 8,
|
|
26
|
-
processed: 7,
|
|
27
|
-
total: 7,
|
|
28
|
-
});
|
|
29
|
-
});
|
package/dist/compilers.test.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|