Skip to content

Skip actual npm run? #93

@rauchg

Description

@rauchg

I love the fact that pre-commit ties directly into package.json scripts from an ergonomics perspective.

However, I think it'd be a good idea to avoid the npm sub-process altogether, for performance reasons. You could, for example, look up the scripts yourself and run them with the ./node_modules/.bin prefix.

Every commit will pay a penalty of ~380ms per pre-commit script defined. See investigation by @vjeux: prettier/prettier#443

Since pre-commit is now the recommended way to set up prettier, I think this is very much a worthwhile optimization that'll save a lot of time to many people.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions