-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Prepare for bumping ESLint to 4.6.1 #17868
Conversation
f3a94df
to
662ca51
Compare
Jarda, I cannot test the prettier magic. Would you mind giving this PR a try and confirm that it doesn't break anything for prettier? |
The Prettier magic can be tested by anyone, no editor integration setup is needed. Here's what I did to verify that this branch is still OK:
const x = true
? {
a: 1
}
: {
b: 1
}; That's how Prettier would format it. const x = true
? {
a: 1
}
: {
b: 1
}; But we want to ignore the I verified that this branch still does the right magic! 👍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated the Calypso ESLint dependencies to their now-released versions (1.0.0 config, 4.0.0 plugin). Also included necessary shrinkwrap revisions.
Will want to point ESLines to their npm releases prior to merge (and update shrinkwrap accordingly) but otherwise this looks good 👍
ccbafe8
to
e8c5ade
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad to see ESLint becoming smarter and catching more issues 😄
There's quite a few removals in the shrinkwrap that I wouldn't have expected, and in fact are added back when regenerate locally. Did you generate the shrinkwrap with npm run update-deps
?
client/state/http/actions.js
Outdated
@@ -26,7 +26,6 @@ export const http = ( { | |||
url, | |||
method, | |||
headers, | |||
queryParams, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense - added it back, solved the issue, and updated the docs. Yuri, Dennis: would you mind confirming that's what you intended and provide testing instructions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The tests @nosolosw added looks good.
There isn't anything that uses queryParams
for the generic http handler afaik, so the only tests are unit tests.
Yes, I used |
From what I was seeing, most everything removed in the changes here was added back. |
e8c5ade
to
bcffe1c
Compare
Pushed the changes suggested by Andrew and re-created the shrinkwrap. |
bcffe1c
to
e9ceb30
Compare
@@ -543,7 +543,7 @@ export const getShippingZoneLocationsList = createSelector( | |||
const locations = getShippingZoneLocations( state, zoneId, siteId ); | |||
return getShippingZoneLocationsListFromLocations( state, locations, maxCountries, siteId ); | |||
}, | |||
( state, zoneId, maxCountries = 999, siteId = getSelectedSiteId( state ) ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that i needed to remove this initialization for the no-unused-vars
not to fail.
@@ -567,7 +567,7 @@ export const getCurrentlyEditingShippingZoneLocationsList = createSelector( | |||
const locations = getShippingZoneLocationsWithEdits( state, siteId, false ); | |||
return getShippingZoneLocationsListFromLocations( state, locations, maxCountries, siteId ); | |||
}, | |||
( state, maxCountries = 999, siteId = getSelectedSiteId( state ) ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that i needed to remove this initialization for the no-unused-vars
not to fail.
@@ -9,7 +9,7 @@ import { suggestedUsernameSchema } from './schema'; | |||
|
|||
const suggestedUsername = createReducer( '', | |||
{ | |||
[ SIGNUP_OPTIONAL_DEPENDENCY_SUGGESTED_USERNAME_SET ]: ( state = null, action ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that i needed to remove this initialization for the no-unused-vars
not to fail.
@@ -11,7 +11,7 @@ import { designTypeSchema } from './schema'; | |||
|
|||
export default createReducer( '', | |||
{ | |||
[ SIGNUP_STEPS_DESIGN_TYPE_SET ]: ( state = '', action ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that i needed to remove this initialization for the no-unused-vars
not to fail.
@@ -11,7 +11,7 @@ import { siteTitleSchema } from './schema'; | |||
|
|||
export default createReducer( '', | |||
{ | |||
[ SIGNUP_STEPS_SITE_TITLE_SET ]: ( state = '', action ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that i needed to remove this initialization for the no-unused-vars
not to fail.
@@ -46,7 +46,7 @@ export const uploadProgress = ( state = null, { type, percentage } ) => { | |||
* @param {Object} action Action object | |||
* @return {Boolean} Whether or not an error should now be shown | |||
*/ | |||
export const showError = ( state = false, { type } ) => type === VIDEO_EDITOR_SHOW_ERROR; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that i needed to remove this initialization for the no-unused-vars
not to fail.
e9ceb30
to
432a830
Compare
@@ -50,7 +50,7 @@ export const receiveRestoreProgress = ( { dispatch }, { siteId, timestamp, resto | |||
}; | |||
|
|||
// FIXME: Could be a network Error (instanceof Error) or an API error. Handle each case correctly. | |||
export const receiveRestoreError = ( { dispatch }, { siteId, timestamp, restoreId }, error ) => { | |||
export const receiveRestoreError = ( { dispatch }, {}, error ) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't know it's possible to specify an empty destructuring ;) It's better to name the parameter:
( { dispatch }, action, error ) => ...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Automattic motto: always learning! :D Thanks for catching this, it's fixed now.
@@ -37,6 +38,7 @@ export const http = ( { | |||
url, | |||
method, | |||
headers, | |||
queryParams, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice bugfix here 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd recommend to do the {}
=> action
change. Otherwise, this looks 👍
- Bump ESLint to v4 branch - Update eslint-config-wpcalypso to 1.0.0 https://github.com/Automattic/eslint-config-wpcalypso/blob/master/CHANGELOG.md#v100-2017-09-07 - Update eslint-plugin-wpcalypso to 4.0.0 https://github.com/Automattic/eslint-plugin-wpcalypso/blob/master/CHANGELOG.md#v400-2017-09-07 - Update eslint-eslines to 1.0.0 Automattic/[email protected]
432a830
to
1c3139d
Compare
Prepare for bumping ESLint version to 4.6.1.
Testing
Check that CircleCI test PRs run as expected
Locally:
--no-verify
) and push to a remote branch to double-check that CircleCI reports the same.