Skip to content

Ignore cometGen.tsx files in Knip - #938

Draft
manuelblum wants to merge 1 commit into
mainfrom
chore/knip-ignore-cometGen-tsx-files
Draft

Ignore cometGen.tsx files in Knip#938
manuelblum wants to merge 1 commit into
mainfrom
chore/knip-ignore-cometGen-tsx-files

Conversation

@manuelblum

Copy link
Copy Markdown
Contributor

Description

This Pull Request updates the Knip configuration to ignore cometGen.tsx files.

False / Positive Error Message of unused file

Screenshot 2025-08-22 at 10 11 28

Background:

  • Normally, generated .cometGen files are created as cometGen.ts.
  • when a React component is used inside a renderCell, the file must be renamed to cometGen.tsx to support JSX.
Screenshot 2025-08-22 at 10 08 52
  • Knip was incorrectly reporting these .tsx files as unused.

@auto-assign
auto-assign Bot requested a review from johnnyomair August 22, 2025 08:13
@manuelblum manuelblum changed the title gnore cometGen.tsx files in Knip ignore cometGen.tsx files in Knip Aug 22, 2025
@manuelblum

Copy link
Copy Markdown
Contributor Author

also configured similar in comet repository: https://github.com/vivid-planet/comet/blob/main/knip.json#L87

Comment thread admin/knip.json
".": {
"entry": ["./src/loader.ts"],
"ignore": ["./codegen.ts", "./schema.gql", "./src/**/generated/**/*.{ts,tsx}", "./src/**/*.cometGen.ts"],
"ignore": ["./codegen.ts", "./schema.gql", "./src/**/generated/**/*.{ts,tsx}", "./src/**/*.cometGen.{ts,tsx}"],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

ignoring cometGen files, has other problems.

if a file, for example a validate function is only used in a cometGen file, those validate files will be marked as unused.

I think we should to set the cometGen files as entry files.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@manuelblum do you plan to do this in this PR?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

still investigating into this. i will update this pr

@johnnyomair johnnyomair changed the title ignore cometGen.tsx files in Knip Ignore cometGen.tsx files in Knip Sep 1, 2025
@johnnyomair
johnnyomair marked this pull request as draft September 3, 2025 07:42
@johnnyomair
johnnyomair removed their request for review September 3, 2025 07:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants