Skip to content

fix: recognize prisma.config.ts as an entry-point (#281)#286

Merged
BartWaardenburg merged 1 commit intofallow-rs:mainfrom
ChrisJr404:fix/prisma-config-entry-point-281
May 5, 2026
Merged

fix: recognize prisma.config.ts as an entry-point (#281)#286
BartWaardenburg merged 1 commit intofallow-rs:mainfrom
ChrisJr404:fix/prisma-config-entry-point-281

Conversation

@ChrisJr404
Copy link
Copy Markdown
Contributor

Closes #281.

Prisma 6.x introduced prisma.config.ts as the officially-supported root config-file location. The Prisma CLI loads it directly, so no source file imports it, which means fallow list and fallow dead-code currently report it as an unused file:

$ npx -y fallow list
Active plugins:
  - prisma
Discovered 1 files
prisma.config.ts
Found 0 entry points

Change

Adds prisma.config.{ts,mts,cts,js,mjs,cjs} to the prisma plugin's CONFIG_PATTERNS and ALWAYS_USED lists in crates/core/src/plugins/prisma.rs. The plugin is already activated by the prisma / @prisma/client enablers, so the new entry only takes effect when prisma is actually a dependency.

Six extensions match the supported ESM/CJS variants for both TypeScript and JavaScript:

extension notes
.ts default per Prisma docs
.mts / .cts explicit ESM / CJS TypeScript
.js plain JavaScript
.mjs / .cjs explicit ESM / CJS JavaScript

This mirrors the convention already used by sibling plugins (cypress.config.{ts,js,mjs,cjs}, tsdown.config.{ts,js,cjs,mjs}).

Test

Adds prisma_config_ts_is_recognized_as_entry_point to false_positive_fixes.rs. Builds a temp project with:

package.json          { devDependencies: { prisma: "6.0.0" } }
prisma/schema.prisma
prisma.config.ts      (defineConfig({ schema: "prisma/schema.prisma" }))

and asserts that prisma.config.ts is not reported in unused_files.

Verification

  • cargo test -p fallow-core — 316 integration tests pass, 110 plugin-registry unit tests pass
  • cargo test -p fallow-cli --bin fallow — 1737 tests pass

…#281)

Prisma 6.x added `prisma.config.{ts,mts,cts,js,mjs,cjs}` as the
officially-supported root config-file location. The Prisma CLI loads
it directly, so no source file imports it, which made `fallow list`
and `fallow dead-code` report it as an unused file.

Add the config-file pattern to the prisma plugin's `config_patterns`
and `always_used` lists. The plugin is already activated by the
`prisma` / `@prisma/client` enablers, so the new entry only takes
effect when prisma is actually a dependency.
@BartWaardenburg BartWaardenburg merged commit 6e27b02 into fallow-rs:main May 5, 2026
18 checks passed
@BartWaardenburg
Copy link
Copy Markdown
Collaborator

Released in v2.65.0. Thanks @ChrisJr404.

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.

prisma.config.ts is not recognized as an entry-point

2 participants