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

Missing properties on prefer-property-order has unexpected behavour #57

Closed
moshest opened this issue Aug 25, 2017 · 5 comments
Closed
Assignees
Milestone

Comments

@moshest
Copy link

moshest commented Aug 25, 2017

My package.json has the property nyc which is not included on the default order list at:

{
  "rules": {
    "prefer-property-order": ["error", []]
  }
}

This rule is failing with the following error:

Your package.json properties are not in the desired order. nyc is not in the preferred property list.

I think that prefer-property-order should ignore properties that are not in the preferred property list.

@tclindner
Copy link
Owner

Hey @moshest what is the purpose of the rule if we ignore properties that aren’t in the list? We are already allowing properties in the list to be missing from the package.json file.

@moshest
Copy link
Author

moshest commented Aug 29, 2017

Just ordering. Like the role prefer-alphabetical-dependencies which only check the order of the dependencies and not what in it.

The user should use other roles to require properties.

@tclindner
Copy link
Owner

Gotcha. I see what you are thinking now. Thanks for talking that through, @moshest!

tclindner pushed a commit that referenced this issue Sep 2, 2017
This change gives better recommendations for what change is required by
the user to resolve the lint issue. It also no longer throws an error
when a property exists in the package.json file that doesn't exist in
the preferred property order array. Thanks @moshest for the input.
@tclindner
Copy link
Owner

Hi @moshest v2.10.0 has been released! Let me know if it meets your needs. Thank you for suggesting the great improvements.

@moshest
Copy link
Author

moshest commented Sep 2, 2017

Works great!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants