Skip to content

Automatically Prettify and Lint after every commit using Husky and Lint-Staged #100

@nirmalhk7

Description

@nirmalhk7

Currently we're required to run npm run format to prettify the entire code and npm run lint:fix to fix the code. However, we can use Husky and lint-staged to automatically format those files which are staged into Git, making it more convenient.

We add Husky (which is a git hooks implementation for NodeJS projects) to execute our commands after pre-commit. We use lint-staged to filter out files which are in our staging area, and run our Prettify and ESLint commands there. This automation will massively increase code-maintenance in the future.

I'd like to implement this issue myself. Please let me know if its suitable.

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