Skip to content
This repository was archived by the owner on Jun 16, 2025. It is now read-only.
This repository was archived by the owner on Jun 16, 2025. It is now read-only.

Support .*ignore files #497

@znarf

Description

@znarf

I think it would be useful to implement support for ".*ignore" files as an alternative to the ignore-dirs option. See for example what was done in prettier: prettier/prettier#2294 and prettier/prettier#2412

Pros:

  • Most projects already have a .gitignore file and this could be automatically used. I don't think anyone wants do depcheck any paths ignored in .gitignore. I've seen depcheck crashing because it was not ignoring some of these files (in my case, huge binary files >= 100MB), it was difficult to troubleshoot.
  • The syntax used in .gitignore and similar .ignore files is more powerful than the current ignore-dirs API. It allows using glob while the ignore-dirs API is only expecting exact matches on single level directory names. https://github.com/depcheck/depcheck/blob/master/src/check.js#L144

Cons:

  • It's confusing to introduce duplicate functionality with ignore-dirs and an incompatible syntax. There needs to be a sensible transition strategy.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions