Skip to content
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: add autofix to rule multiline-ternary #13958

Merged

Conversation

aladdin-add
Copy link
Member

@aladdin-add aladdin-add commented Dec 26, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ x] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

it added autofix to rule multiline-ternary

Is there anything you'd like reviewers to focus on?

it was based on PR #12982, thanks to @Sawtaytoes great working!
and surely if this PR get merged, that one can be closed!

Sawtaytoes and others added 4 commits December 24, 2020 11:10
I noticed unfixed warnings from this ESLint rule and wanted to auto-fix them. While it may seem like doing `'\n? '` is opinionated, I did have changed to make this take a new option and either put the `?` on the previous line or next line. This is actually unnecessary because `operator-linebreak` handles it for you.
@aladdin-add aladdin-add added rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion feature This change adds a new feature to ESLint autofix This change is related to ESLint's autofixing capabilities labels Dec 26, 2020
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I only have questions about whether the autofixing should make fewer changes in the code, though I don't have a strong opinion.

lib/rules/multiline-ternary.js Outdated Show resolved Hide resolved
lib/rules/multiline-ternary.js Outdated Show resolved Hide resolved
@aladdin-add
Copy link
Member Author

@mdjermanovic thank you so much for reviewing!! 😄

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mdjermanovic mdjermanovic changed the title New: add autofix to rule multiline-ternary Update: add autofix to rule multiline-ternary Dec 31, 2020
@mdjermanovic
Copy link
Member

Changed the title as it seems that all "add fixer" commits had Update: instead of New:

@mdjermanovic mdjermanovic merged commit 0649871 into eslint:master Dec 31, 2020
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jun 30, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion autofix This change is related to ESLint's autofixing capabilities feature This change adds a new feature to ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants