Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign upIndentation/alignment within ternary branches (consequent/alternate) #927
Comments
This comment has been minimized.
This comment has been minimized.
stale
bot
commented
May 10, 2018
|
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
stale
bot
added
the
stale
label
May 10, 2018
stale
bot
closed this
May 17, 2018
This comment has been minimized.
This comment has been minimized.
|
I agree that we should auto-format to the former example. Re-opening and setting this as a goal for |
feross
added
the
bug
label
May 20, 2018
feross
reopened this
May 20, 2018
stale
bot
removed
the
stale
label
May 20, 2018
feross
added this to the
standard v12 milestone
May 20, 2018
This comment has been minimized.
This comment has been minimized.
|
This would definitely resolve an unfortunate consistency with Prettier (#811 (comment)). Unfortunately both eslint/eslint#6606 and eslint/eslint#7698 reports are now "archived due to age". I suspect the best solution would be for someone to make an eslint plugin, similar to the following: |
feross
modified the milestones:
standard v12,
standard v14
Jul 5, 2019
feross
removed this from the standard v14 milestone
Jul 27, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
josephfrazier commentedJun 21, 2017
•
edited
(extracted from #811 (comment))
Currently (commit 05595b5), standard formats the following code:
as:
That is, it unindents the function body and closing brace. Here's the diff:
If ESLint makes it possible (see eslint/eslint#6606 and eslint/eslint#7698), would it be acceptable to have standard use the original indentation in this case?
I might be able to hack together a way to test breakage by postprocessing standard's output with prettier-miscellaneous, which produces standard-formatted code with
prettier --no-semi --single-quote --jsx-single-quote --space-before-function-paren(with the exception of this issue, as far as I know).EDIT: This is similar to #521