Skip to content

Update the version of lint-staged - #14971

Merged
ntwb merged 2 commits into
WordPress:masterfrom
Jackie6:update/package-json
Apr 13, 2019
Merged

ntwb merged 2 commits into
WordPress:masterfrom
Jackie6:update/package-json

Conversation

@Jackie6

@Jackie6 Jackie6 commented Apr 13, 2019

Copy link
Copy Markdown
Contributor

Description

Fix #14784

How has this been tested?

  1. git add modified-files, call the files VersionA
  2. git commit -m "some messages", then the program will run npm run -s precommit to check lint styles and some other things.
  3. Encounter some errors like "Multiple spaces found", so you change the code again and save, call the files VersionB. But do not git add again.
  4. git commit again, failed. Because now the lint-staged only check staged changes (i.e, VersionA).
    You should git add again and then git commit

Screenshots

The screenshot of running git commit with old version of lint-staged
image
The screenshot of running git commit with latest version of lint-staged. The blue boxes highlight the difference
image

Types of changes

Upgrade lint-staged

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.
  • I've included developer documentation if appropriate.

@ntwb

ntwb commented Apr 13, 2019

Copy link
Copy Markdown
Member

Changelog:

lint-staged/lint-staged@v7.3.0...v8.1.5
Add support for partially staged files

@ntwb ntwb left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM 👍

@ntwb
ntwb merged commit 3aca80f into WordPress:master Apr 13, 2019
mchowning pushed a commit to mchowning/gutenberg that referenced this pull request Apr 15, 2019
## Description
Fix WordPress#14784 

## How has this been tested?
1. `git add modified-files`, call the files VersionA
2. `git commit -m "some messages"`, then the program will run `npm run -s precommit` to check lint styles and some other things.
3. Encounter some errors like "Multiple spaces found", so you change the code again and save, call the files VersionB. But do not `git add` again.
4. `git commit` again, failed. Because now the `lint-staged` only check staged changes (i.e, VersionA).
You should `git add` again and then `git commit`

## Screenshots <!-- if applicable -->
The screenshot of running `git commit` with old version of `lint-staged`
![image](https://user-images.githubusercontent.com/24849874/56072453-06486a80-5d65-11e9-990a-9447b14abd9a.png)
The screenshot of running `git commit` with latest version of `lint-staged`. The blue boxes highlight the difference
![image](https://user-images.githubusercontent.com/24849874/56072493-84a50c80-5d65-11e9-8373-77353c8601ac.png)


## Types of changes
Upgrade lint-staged

## Checklist:
- [X] My code is tested.
- [X] My code follows the WordPress code style. <!-- Check code: `npm run lint`, Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/javascript/ -->
- [X] My code follows the accessibility standards. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/coding-standards/accessibility-coding-standards/ -->
- [X] My code has proper inline documentation. <!-- Guidelines: https://make.wordpress.org/core/handbook/best-practices/inline-documentation-standards/javascript/ -->
- [X] I've included developer documentation if appropriate. <!-- Handbook: https://wordpress.org/gutenberg/handbook/designers-developers/ -->
@youknowriad youknowriad added this to the 5.5 (Gutenberg) milestone Apr 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Update pre-commit to check modified files only

3 participants