-
Notifications
You must be signed in to change notification settings - Fork 885
one-line: Allow to specify "next-line" #2410
Conversation
Added parsing for old-style options. Shouldn't be a breaking change any more. |
@andy-hanson are you still working on this PR and relevant? |
Updated, seems to still work with no change. Note that there is an |
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.
@andy-hanson is there any way we can make this less breaking?
please update this branch so we can review it, or close it if no longer relevant. we will close this if we do not hear from you in two weeks.
const OPTION_BRACE = "open-brace"; | ||
const OPTION_CATCH = "catch"; | ||
const OPTION_ELSE = "else"; | ||
const OPTION_FINALLY = "finally"; |
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.
changing the option names is super breaking. do we have to do this?
const OPTION_WHITESPACE = "check-whitespace"; | ||
|
||
type BraceSetting = "same-line" | "next-line"; | ||
const OPTION_SAME_LINE: BraceSetting = "same-line"; | ||
const OPTION_NEXT_LINE: BraceSetting = "next-line"; |
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.
swap the order, reuse the constants.
const OPTION_SAME_LINE = "same-line";
const OPTION_NEXT_LINE = "next-line";
type BraceSetting = OPTION_SAME_LINE | OPTION_NEXT_LINE;
Closing due to age and inactivity. Feel free to re-open or create a new pull request if you decide to continue working on this. |
PR checklist
Overview of change:
Before, you would specify:
And get code like:
Is there anything you'd like reviewers to focus on?
This is a breaking change to "one-line" as the options have changed.
We could instead create a new rule and deprecate "one-line". (The old name is less accurate now.) Or, we could deprecate the old options style but still handle it in
parseOptions
.CHANGELOG.md entry:
TBD