-
-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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: Enable function string option in comma-dangle (fixes #12058) #12462
Update: Enable function string option in comma-dangle (fixes #12058) #12462
Conversation
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.
Are there any tests which show that functions are ignored by default when ecmaVersion < 8?
I didn't see any new tests along those lines and a quick skim of the existing valid
test cases didn't show me any such tests (but I could have missed some).
@platinumazure You are right. There were Insufficient test cases. I add more test cases. Thanks:) |
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.
Thanks for adding those test cases!
Looks good to me, but I would like more team members to review as well.
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.
Thanks for the correct change and comprehensive tests! I left just one minor note for an additional test.
I think it's correct to treat this as a bug fix with more warnings for a semver-minor, because this behavior
matches the documentation, and it was announced in migrating to 6.0.0:
In ESLint v6, function commas are treated the same way as other types of trailing commas.
...
To restore the previous behavior of a string option like "always-multiline", replace "never" with "always-multiline" in the example above.
Also, it's possible to reconfigure the rule if the new warnings are not desired (might be good to put a note in the release blog post?).
@mdjermanovic Thanks. I added a test case(ecmaVersion >8) |
Apologies, I meant an additional test in The test case you added is anyway useful and should stay. If you can it would be nice to add one more test with |
@mdjermanovic No problem! I added one test case in invalid for ecmaVersion 9 |
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.
Thanks for the test, and sorry again. Everything LGTM, thanks for contributing!
Merged-- thanks @yeonjuan for contributing! |
What is the purpose of this pull request? (put an "X" next to item)
[ ] Documentation update
[X] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] 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)
function string option
in comma-dangle.Is there anything you'd like reviewers to focus on?