chore: 🔧 add and configure lint-staged#4
Merged
Merged
Conversation
This update includes the addition of lint-staged version 16.2.6 to both package.json and package-lock.json for improved code quality checks before commits.
This update introduces a lint-staged configuration to automate code formatting with Prettier and ESLint on staged files.
Updated the pre-commit hook to run lint-staged for improved code formatting and linting.
Clarified the usage of Husky and lint-staged for running linters and formatters on staged files before commits.
Clarified the usage of Husky and lint-staged for running linters and formatters on staged files before commits.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the project's pre-commit workflow to use
lint-stagedin combination with Husky, ensuring that formatting and linting are only run on staged files. It also addslint-stagedas a dependency and updates the documentation to reflect these changes.Pre-commit workflow improvements:
.husky/pre-commitscript to usenpx lint-staged, replacing the previous approach of running formatting, linting, type-checking, and tests on all files. This makes pre-commit checks faster and more targeted.lint-stagedas a dev dependency inpackage.jsonand configured it to run Prettier and ESLint only on staged files. [1] [2]Documentation updates:
README.mdto mention the use of both Husky and lint-staged for running linters and formatters on staged files before commits.These changes streamline the development workflow by ensuring only relevant files are checked before commits, improving efficiency and developer experience.