Skip to content

[FEAT] Add option to delete stale files #232

@lensbart

Description

@lensbart

Is your feature request related to a problem? Please describe.
When you’re making a larger change, sometimes many files can be renamed or deleted and created at once. In such a situation, it could be helpful if this plugin would delete all files it doesn’t recognise in the output folders (that is, all files excluding .graphql files, mapper files, and files that would be generated if missing).

Describe the solution you'd like
This should probably not be the default behaviour, as it is a destructive action that will require the developer to keep unrelated files (for e.g. helper functions) out of the resolvers folders. So I’m thinking of a configuration option

Describe alternatives you've considered

  • Checking the git deletions and creations before committing (status quo, brittle)
  • Enabling the import/no-unused-modules plugin. This might be a good and sufficient approach, but requires a bit more work to set up, makes assumptions about the tooling (some project might be using Biome or might not be using this plugin, not sure what the performance implications are)

Additional context
Not an urgent request, just a friendly suggestion 😊 Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions