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

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 ESLint is working incorrectly rule Relates to ESLint's core rules accepted There is consensus among the team that this change meets the criteria for inclusion labels Mar 19, 2018
@platinumazure platinumazure merged commit abc765c into master Mar 21, 2018
@platinumazure platinumazure deleted the issue10101 branch March 21, 2018 22:23
This was referenced Mar 22, 2018
This was referenced Mar 22, 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 This issue has been archived; please open a new issue for any further discussion label Sep 18, 2018
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 bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants