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

object-curly-newline minProperties documentation clarification #8874

Closed
solmsted opened this issue Jul 4, 2017 · 1 comment · Fixed by #8878 or homezen/eslint-config-homezen#43
Closed
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 documentation Relates to ESLint's documentation

Comments

@solmsted
Copy link
Contributor

solmsted commented Jul 4, 2017

Tell us about your environment

  • ESLint Version: 4.1.1
  • Node Version: 8.0.0
  • npm Version: 5.0.4

What parser (default, Babel-ESLint, etc.) are you using? default

The documentation for object-curly-newline's minProperties option states

"minProperties" requires line breaks if the number of properties is more than the given integer.

In practice I have found that it requires line breaks when the number of properties is not simply more than the given integer but greater than or equal to the given integer.

Here is an example:

/* eslint object-curly-newline: [2, {minProperties: 1}] */
let obj = {a: 1};

This triggers errors:

  • ESLint Error object-curly-newline Expected a line break after this opening brace.
  • ESLint Error object-curly-newline Expected a line break before this closing brace.

This object has one property and minProperties is set to one. One is not "more than" one. So I believe the documentation is incorrect.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Jul 4, 2017
@not-an-aardvark
Copy link
Member

Thanks for reporting, this looks like a typo in the docs. Would you like to submit a PR?

@not-an-aardvark not-an-aardvark added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly documentation Relates to ESLint's documentation and removed triage An ESLint team member will look at this issue soon labels Jul 4, 2017
solmsted added a commit to solmsted/eslint that referenced this issue Jul 4, 2017
Fixes eslint#8874
Wording "at least" copied from array-bracket-newline docs.
solmsted added a commit to solmsted/eslint that referenced this issue Jul 4, 2017
…int#8874)

Wording "at least" copied from array-bracket-newline docs.
platinumazure pushed a commit that referenced this issue Jul 4, 2017
…) (#8878)

Wording "at least" copied from array-bracket-newline docs.
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 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 Feb 6, 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 documentation Relates to ESLint's documentation
Projects
None yet
3 participants