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
merged 1 commit into from Mar 21, 2018

Conversation

@platinumazure
Copy link
Member

@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 merged commit abc765c into master Mar 21, 2018
5 checks passed
5 checks passed
commit-message Commit message follows guidelines
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
licence/cla Contributor License Agreement is signed.
Details
release-monitor This change is semver-patch
Details
@platinumazure platinumazure deleted the issue10101 branch Mar 21, 2018
This was referenced Mar 22, 2018
@eslint eslint bot locked and limited conversation to collaborators Sep 18, 2018
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
You can’t perform that action at this time.