Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/knip/src/plugins/tsx/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { PackageJson } from 'src/types/package-json.js';
import { toBinary, toDependency, toEntry } from 'src/util/input.js';
import { toDependency, toEntry } from 'src/util/input.js';
import { hasDependency } from 'src/util/plugin.js';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use relative imports

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

import type { IsPluginEnabled, Plugin, ResolveConfig } from '../../types/config.js';

Expand All @@ -18,7 +18,7 @@ const packageJsonPath = (id: PackageJson) => id;
const resolveConfig: ResolveConfig<PackageJson> = localConfig => {
const scripts = localConfig.scripts;

const entries = [toBinary('tsx'), toDependency('tsx')];
const entries = [toDependency('tsx')];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one should probably not be added here. If tsx is listed in package.json but not used anywhere we probably want it reported as unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed


if (scripts && Object.keys(scripts).some(script => /(?<=^|\s)tsx\s(.*)--test/.test(scripts[script]))) {
const patterns = [
Expand Down