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 Dec 24, 2020
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.
Copy link
Member

@mdjermanovic mdjermanovic left a comment

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.

Loading

lib/rules/multiline-ternary.js Outdated Show resolved Hide resolved
Loading
lib/rules/multiline-ternary.js Outdated Show resolved Hide resolved
Loading
@aladdin-add aladdin-add requested a review from mdjermanovic Dec 28, 2020
lib/rules/multiline-ternary.js Outdated Show resolved Hide resolved
Loading
lib/rules/multiline-ternary.js Outdated Show resolved Hide resolved
Loading
@aladdin-add
Copy link
Member Author

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

@mdjermanovic thank you so much for reviewing!! 😄

Loading

Copy link
Member

@mdjermanovic mdjermanovic left a comment

LGTM, thanks!

Loading

@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

@mdjermanovic mdjermanovic commented Dec 31, 2020

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

Loading

@mdjermanovic mdjermanovic merged commit 0649871 into eslint:master Dec 31, 2020
13 checks passed
Loading
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jun 30, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants