-
Notifications
You must be signed in to change notification settings - Fork 885
New rule option: 'check-rest-spread' for 'whitespace' rule #3089
Conversation
src/rules/whitespaceRule.ts
Outdated
@@ -27,6 +27,7 @@ const OPTION_DECL = "check-decl"; | |||
const OPTION_OPERATOR = "check-operator"; | |||
const OPTION_MODULE = "check-module"; | |||
const OPTION_SEPARATOR = "check-separator"; | |||
const OPTION_SPREAD = "check-spread"; |
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 prefer check-rest-spread
which checks object and array spread as well as object and array rest and rest parameters
src/rules/whitespaceRule.ts
Outdated
@@ -192,6 +196,13 @@ function walk(ctx: Lint.WalkContext<Options>) { | |||
if (options.decl && initializer !== undefined) { | |||
checkForTrailingWhitespace((type !== undefined ? type : name).getEnd()); | |||
} | |||
break; | |||
|
|||
case ts.SyntaxKind.SpreadAssignment: |
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 also checks foo(...bar)
, which is correct if this option checks rest and spread.
It would also need to check BindingElement
and Parameter
where dotDotDotToken
is not undefined and SpreadElement
.
@ajafff thank you for the feedback! will get back to it soon |
thanks @ksvitkovsky |
my pleasure 😊 |
Last build cause error, looks like prob in this option:
/**
* Vue component 'preFetch' hook, that is used in SSR to do required
* things with given Vuex store before page rendering.
*
42: * @param store Vuex store, to perform actions on.
*
* @return Resolved promise with array of all users, that exist
* in the system.
*/ Looks like it has conflict with option Default
If remove
|
PR checklist
CHANGELOG.md entry:
[new-rule-option]
whitespace
: Addcheck-rest-spread
option (#2122)