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

Update eslint:recommended #4953

Closed
nzakas opened this Issue Jan 14, 2016 · 10 comments

Comments

Projects
None yet
6 participants
@nzakas
Copy link
Member

nzakas commented Jan 14, 2016

We've added a bunch of new rules since 1.0.0, and we should update eslint:recommended so that it has all of the important, error-catching rules that have been added since.

These seem like a good idea to have on by default:

  1. no-unexpected-multiline
  2. no-empty-pattern

What others should be added? (Remember, these can't be stylistic rules, only rules that catch possible errors.)

@mysticatea

This comment has been minimized.

Copy link
Member

mysticatea commented Jan 15, 2016

👍

no-empty-pattern is a rule for ES6, so I think:

  • no-class-assign (no-func-assign is on by default already)
  • no-const-assign (always error)
  • no-dupe-class-members (no-dupe-keys is on by default already)
  • no-new-symbol (always error)
  • no-this-before-super (always error)
  • constructor-super (always error)

And maybe the following rules are proper as well:

  • no-case-declarations (prevents a cause of reference errors (TDZ))
  • no-empty-label (I think those labels are a mistake since ECMAScript has no goto statement)
@gyandeeps

This comment has been minimized.

Copy link
Member

gyandeeps commented Jan 15, 2016

How about array-callback-return ?

@nzakas

This comment has been minimized.

Copy link
Member Author

nzakas commented Jan 15, 2016

These all seem like good additions. Any others?

@michaelficarra

This comment has been minimized.

Copy link
Member

michaelficarra commented Jan 15, 2016

array-callback-return is not safe because it doesn't know the target is actually an array, so it should not be recommended.

@btmills

This comment has been minimized.

Copy link
Member

btmills commented Jan 15, 2016

What about no-arrow-condition?

@nzakas

This comment has been minimized.

Copy link
Member Author

nzakas commented Jan 15, 2016

no-arrow-condition is a good one.

@michaelficarra has a point, array-callback-return is probably not safe enough to have as part of this.

@mysticatea

This comment has been minimized.

Copy link
Member

mysticatea commented Jan 16, 2016

no-arrow-condition has been deprecated :)

@btmills

This comment has been minimized.

Copy link
Member

btmills commented Jan 16, 2016

Ah right, I was reading the published rules list. I don't think we could put either of its replacements on the recommended list.

@nzakas

This comment has been minimized.

Copy link
Member Author

nzakas commented Jan 17, 2016

Oh duh. :) That's OK, I think we have a good list of additions here.

@alberto

This comment has been minimized.

Copy link
Member

alberto commented Jan 18, 2016

Should the new rules also be listed in the migrating-to-2.0.0 doc?

@nzakas nzakas closed this in 5b96265 Jan 19, 2016

nzakas added a commit that referenced this issue Jan 19, 2016

Merge pull request #4994 from eslint/issue4953
Breaking: Update eslint:recommended (fixes #4953)

@eslint eslint bot locked and limited conversation to collaborators Feb 6, 2018

@eslint eslint bot added the archived due to age label Feb 6, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.