Skip to content

Support schema.prisma generators / providers for dead-code analysis #288

@FunctionDJ

Description

@FunctionDJ

Problem

Libraries like https://github.com/arthurfiorette/prisma-json-types-generator#configuration might have their only reference in the project inside the schema.prisma file as the provider for a generator.

Right now, fallow doesn't seem to analyze dependencies referenced in schema.prisma, causing it to list packages like prisma-json-types-generator (and other generator packages) as unused dependencies in this scenario.

Proposed solution

If a file is a .prisma file, scan for dependencies with a regex that detects lines like

  provider = "prisma-json-types-generator"

and add the dependency to fallow's internal graph of tracked dependencies.

Parsing .schema files "properly" instead of regex is probably too much work.

Alternatives considered

Users add Prisma providers to ignoreDependencies in .fallowrc.json.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions