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

Officially deprecate shorthand options #8112

Closed
c-vetter opened this issue Feb 20, 2017 · 2 comments
Closed

Officially deprecate shorthand options #8112

c-vetter opened this issue Feb 20, 2017 · 2 comments
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion

Comments

@c-vetter
Copy link
Contributor

c-vetter commented Feb 20, 2017

According to the discussion on #8092, shorthands like max-depth: ["error", 4] for max-depth: ["error", { max: 4}] are intentionally not added for newer rules, like max-statements-per-line in that case. The rationale is that there should not be multiple ways to do the same thing, and that such shorthands are basically magic numbers.

Personally, I can get behind that from a consistency stand-point. In the interest of consistency, I think all shorthands should be deprecated, just like the maximum option has been deprecated in favor of a standard max option.

This may be tied to #7443, but I think the shorthands should at least be discouraged in the docs. As it stands, the docs are actually kind of propagating the shorthands. From my personal case: for convenience, I used the snippets from the rules examples, so from the max-depth rule page I took max-depth: ["error", 4]. I guess, this applies to others as well. Also, the complexity rule page lists the shorthand as the default way, and the explicit way as the optional alternative.

@eslintbot eslintbot added the triage An ESLint team member will look at this issue soon label Feb 20, 2017
@platinumazure platinumazure added documentation Relates to ESLint's documentation evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion and removed triage An ESLint team member will look at this issue soon labels Feb 20, 2017
@platinumazure
Copy link
Member

I guess I see two issues here: First is getting the documentation to use non-shorthand options when they are available, and second is actually changing rules with shorthand options to deprecate or remove shorthand options. The latter will probably require TSC approval.

I'm 👍 to getting the rule docs to use explicit options in examples, for sure.

@not-an-aardvark
Copy link
Member

Thanks for your interest in improving ESLint. Unfortunately, it looks like this issue didn't get enough support from the team and so I'm closing it. While we wish we'd be able to accommodate everyone's requests, we do need to prioritize. We've found that issues failing to reach consensus after a long time tend to never do it, and as such, we close those issues. This doesn't mean the idea isn't interesting, just that it's not something the team can commit to.

@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 12, 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 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion documentation Relates to ESLint's documentation evaluating The team will evaluate this issue to decide whether it meets the criteria for inclusion
Projects
None yet
Development

No branches or pull requests

4 participants