-
Notifications
You must be signed in to change notification settings - Fork 5k
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
Update ESLint shared config to v3 #9274
Conversation
40f3a5f
to
9e54a7c
Compare
@@ -1,4 +1,9 @@ | |||
import ObservableStore from 'obs-store' | |||
|
|||
/* eslint-disable import/first,import/order */ |
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.
Are these rules disabled here because they conflicted with each other?
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.
They're disabled here because they both apply to the following code
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.
import/first
wants therequire
andimport
s to moveimport/order
wants therequire
call alone to move
They're both disabled here and re-enabled as soon as ESLint will allow.
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 e2e tests break if I move the require call so I don't want to move it
], | ||
) | ||
|
||
return t('connectTo', [ |
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.
What motivated this change 🤔
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.
Whoops, habit—I'd meant to only remove the extra newline but got carried away
const _fetch = timeout | ||
? fetchWithTimeout({ timeout }) | ||
: window.fetch |
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.
These changes are extraneous, not suggested by ESLint
|
||
export default { | ||
version, | ||
|
||
migrate: function (originalVersionedData) { | ||
migrate (originalVersionedData) { |
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.
What syntax is this O_O
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.
Starting with ECMAScript 2015, a shorter syntax for method definitions on objects initializers is introduced. It is a shorthand for a function assigned to the method's name.
development/build/index.js
Outdated
@@ -41,8 +41,7 @@ function defineAllTasks () { | |||
manifestTasks.dev, | |||
reload, | |||
), | |||
), |
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.
This change is unexpected. I prefer the older format, and I'm not sure what could have caused this 🤔
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 first arg to the function is mis-aligned, causing the auto-fix to do this. I'll fix this with db7f5f2.
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 same problem is present in many other places, but I'm not gonna block on it. Hopefully prettier will fix it.
test/lib/createTxMeta.js
Outdated
status: 'unapproved', | ||
txParams: {}, | ||
}, partialMeta) | ||
txParams: {}, ...partialMeta, |
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.
It's weird to see multi-line object literals with things doubled up on the same line like this 🤔 I would have expected this to be disallowed.
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'm not sure why this is allowed. I've fixed it with 4ae9694.
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 same problem is present in many other places, but I'm not gonna block on it. Hopefully prettier will fix it.
Co-authored-by: Mark Stacey <[email protected]>
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.
LGTM!
* origin/develop: (137 commits) Use @metamask/[email protected] (#9275) Standardize scss import practices (#9183) Update ESLint shared config to v3 (#9274) Add lock icon to default networks (#9269) Adds toPrecisionWithoutTrailingZeros utility (#9270) Hide gas estimate on non-main network (#9189) Move the mascot component to its own directory (#9272) Use @metamask/[email protected] (#9266) Fix padding, alignment of actionable-message; add left aligned story Code cleanup and simplification for actionable-message component Adds actionable message component and stories Fix lint issues (#9265) Fix prefer-destructuring issues (#9263) colocate confirm-decrypt-message page styles (#9252) Tidy up Migrator tests (#9264) Adds pulse loader component (#9259) Fix import/order issues (#9239) Fix radix issues (#9247) New info tooltip component (#9180) Improve scss naming ...
Closes #8982
This PR updates the ESLint config to the latest version, v3.
There are two commits with fixes, one that's automated and one that was manual. Only the first and last commit require review.
I disabled the following:
default-param-last
was too annoying to fixrequire-atomic-updates
was also too annoying to fiximport/no-unassigned-import
all the instances of this in the codebase are legitimate—I don't think we should enable it if every time it flags something we need to disable itI'm open to enabling those in separate PRs in the future, should someone feel inclined.