| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Consistently use printf-style strings for error messages that do not need a custom argument order or processing of arguments.
Sorry, something went wrong.
There was a problem hiding this comment.
Personally, I like literals better, but as long as there's one standard that's enforced by the linter, fine by me 😄
Sorry, something went wrong.
| create: function(context) { | ||
| return { | ||
| ExpressionStatement: function(node) { | ||
| if (!isDefiningError(node)) |
There was a problem hiding this comment.
I've been meaning to do this, but while you're here, can you extract this to rules-utils.js, and update the other usage of this?
Sorry, something went wrong.
|
@maclover7 Yeah, I'm fine with either. We currently have more printf-formatted errors so this made sense to me (and the fact that it avoids creating all these extra functions) but either is fine. |
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM
Sorry, something went wrong.
Consistently use printf-style strings for error messages that do not need a custom argument order or processing of arguments. PR-URL: #16904 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
Should this be backported to v9.x-staging? If yes please follow the guide and raise a backport PR, if not let me know or add the dont-land-on label. |
Sorry, something went wrong.
Consistently use printf-style strings for error messages that do not need a custom argument order or processing of arguments. PR-URL: nodejs#16904 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Consistently use printf-style strings for error messages that do not need a custom argument order or processing of arguments. Backport-PR-URL: #17624 PR-URL: #16904 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Consistently use printf-style strings for error messages that do not need a custom argument order or processing of arguments. Backport-PR-URL: #17624 PR-URL: #16904 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
Consistently use printf-style strings for error messages that do not need a custom argument order or processing of arguments. Backport-PR-URL: #17624 PR-URL: #16904 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Anna Henningsen <anna@addaleax.net>
|
Should this be backported to v6.x and v8.x-staging? If so please include #17376. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Consistently use printf-style strings for error messages that do not need a custom argument order or processing of arguments.
Also added an eslint rule (with a test) that checks for this and warns about it.
Checklist
Affected core subsystem(s)
errors, test, tools