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

Fix: object-curly-newline minProperties w/default export (fixes #10101) #10103

merged 1 commit into from Mar 21, 2018


Copy link

@platinumazure platinumazure commented Mar 19, 2018

minProperties only tracks ImportSpecifier and ExportSpecifier nodes

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:

See #10101.

What changes did you make? (Give an overview)

The object-curly-newline rule used to count all specifiers under an ImportDeclaration or ExportDeclaration node when determining if there are enough specifiers to require line breaks. However, ImportDefaultSpecifier and ImportNamespaceSpecifier nodes are not actually part of the "object" (i.e., nodes surrounded by curly brace tokens), so they should be ignored by this rule. This change fixes the logic to only check for the count of ImportSpecifier or ExportSpecifier nodes associated with the ImportDeclaration or ExportDeclaration nodes.

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

Any other unit tests I should add?

minProperties only tracks ImportSpecifier and ExportSpecifier nodes
@platinumazure platinumazure added bug rule accepted labels Mar 19, 2018
@platinumazure platinumazure merged commit abc765c into master Mar 21, 2018
5 checks passed
@platinumazure platinumazure deleted the issue10101 branch Mar 21, 2018
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Sep 18, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age label Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
accepted archived due to age bug rule
None yet

Successfully merging this pull request may close these issues.

None yet

3 participants