Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build tools: remove the eslint --fix Git precommit hook #5323

Merged
merged 2 commits into from Mar 6, 2018

Conversation

ntwb
Copy link
Member

@ntwb ntwb commented Mar 1, 2018

Description

Reverts #4985

The package lint-staged currently has no support to lint only the Git staged lines or files, as such this can cause unexpected changes to be added during commit as after ESLint has run git add is run. This makes using a Git workflow such as git add -p unworkable.

Reverting this for now to seek an alternative solution that supports linting and adding only staged changes.

How Has This Been Tested?

n/a

Screenshots (jpeg or gifs if applicable):

Types of changes

Build tooling change

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code has proper inline documentation.

@ntwb ntwb added the [Type] Build Tooling Issues or PRs related to build tooling label Mar 1, 2018
@ntwb ntwb requested review from atimmer and aduth March 1, 2018 07:26
@atimmer
Copy link
Member

atimmer commented Mar 1, 2018

Should we still let ESLint run without the --fix flag? That would display any warnings and stop the commit when it errors.

@ntwb
Copy link
Member Author

ntwb commented Mar 1, 2018

The way lint-staged works it would continue to run git add after ESLint has run if there were no errors or warnings, and as lint-staged requires the git add component in its current implementation let's remove it altogether for now.

Copy link
Member

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs conflict resolution, but 👍 otherwise.

@ntwb ntwb merged commit 77465b5 into master Mar 6, 2018
@ntwb ntwb deleted the update/precommit-hook branch March 6, 2018 02:32
This was referenced Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Type] Build Tooling Issues or PRs related to build tooling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants