-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
tools: add recommended ES6 lint rules #5210
Closed
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add the following (seemingly non-controversial) ESLint rules: * `constructor-super`: Verify calls of `super()` in constructors. Flags situations that will result in runtime errors. Since we do not have 100% code coverage in tests, linting for runtime errors is useful. * `no-class-assign`: Flags cases where a class declaration is overwritten via variable assignment later. It is difficult to think of a situation where this is not an error, and easy to think of situations (particularly in lengthy test files) where it could come up. * `no-const-assign`: Assigning to a const after declaration is a runtime error. * `no-dupe-class-members`: Declare a class member twice, then only the second one counts. This is analogous to redeclaring a variable. * `no-this-before-super`: Using `this` or `super` in a derived class before a call to `super()` is a `ReferenceError`
LGTM |
2 similar comments
LGTM |
LGTM |
lgtm |
Trott
added a commit
to Trott/io.js
that referenced
this pull request
Feb 16, 2016
Add the following (seemingly non-controversial) ESLint rules: * `constructor-super`: Verify calls of `super()` in constructors. Flags situations that will result in runtime errors. Since we do not have 100% code coverage in tests, linting for runtime errors is useful. * `no-class-assign`: Flags cases where a class declaration is overwritten via variable assignment later. It is difficult to think of a situation where this is not an error, and easy to think of situations (particularly in lengthy test files) where it could come up. * `no-const-assign`: Assigning to a const after declaration is a runtime error. * `no-dupe-class-members`: Declare a class member twice, then only the second one counts. This is analogous to redeclaring a variable. * `no-this-before-super`: Using `this` or `super` in a derived class before a call to `super()` is a `ReferenceError` PR-URL: nodejs#5210 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org>
Landed in 57891c3 |
MylesBorins
pushed a commit
that referenced
this pull request
Feb 18, 2016
Add the following (seemingly non-controversial) ESLint rules: * `constructor-super`: Verify calls of `super()` in constructors. Flags situations that will result in runtime errors. Since we do not have 100% code coverage in tests, linting for runtime errors is useful. * `no-class-assign`: Flags cases where a class declaration is overwritten via variable assignment later. It is difficult to think of a situation where this is not an error, and easy to think of situations (particularly in lengthy test files) where it could come up. * `no-const-assign`: Assigning to a const after declaration is a runtime error. * `no-dupe-class-members`: Declare a class member twice, then only the second one counts. This is analogous to redeclaring a variable. * `no-this-before-super`: Using `this` or `super` in a derived class before a call to `super()` is a `ReferenceError` PR-URL: #5210 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org>
rvagg
pushed a commit
that referenced
this pull request
Feb 18, 2016
Add the following (seemingly non-controversial) ESLint rules: * `constructor-super`: Verify calls of `super()` in constructors. Flags situations that will result in runtime errors. Since we do not have 100% code coverage in tests, linting for runtime errors is useful. * `no-class-assign`: Flags cases where a class declaration is overwritten via variable assignment later. It is difficult to think of a situation where this is not an error, and easy to think of situations (particularly in lengthy test files) where it could come up. * `no-const-assign`: Assigning to a const after declaration is a runtime error. * `no-dupe-class-members`: Declare a class member twice, then only the second one counts. This is analogous to redeclaring a variable. * `no-this-before-super`: Using `this` or `super` in a derived class before a call to `super()` is a `ReferenceError` PR-URL: #5210 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org>
MylesBorins
pushed a commit
that referenced
this pull request
Feb 18, 2016
Add the following (seemingly non-controversial) ESLint rules: * `constructor-super`: Verify calls of `super()` in constructors. Flags situations that will result in runtime errors. Since we do not have 100% code coverage in tests, linting for runtime errors is useful. * `no-class-assign`: Flags cases where a class declaration is overwritten via variable assignment later. It is difficult to think of a situation where this is not an error, and easy to think of situations (particularly in lengthy test files) where it could come up. * `no-const-assign`: Assigning to a const after declaration is a runtime error. * `no-dupe-class-members`: Declare a class member twice, then only the second one counts. This is analogous to redeclaring a variable. * `no-this-before-super`: Using `this` or `super` in a derived class before a call to `super()` is a `ReferenceError` PR-URL: #5210 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org>
Merged
stefanmb
pushed a commit
to stefanmb/node
that referenced
this pull request
Feb 23, 2016
Add the following (seemingly non-controversial) ESLint rules: * `constructor-super`: Verify calls of `super()` in constructors. Flags situations that will result in runtime errors. Since we do not have 100% code coverage in tests, linting for runtime errors is useful. * `no-class-assign`: Flags cases where a class declaration is overwritten via variable assignment later. It is difficult to think of a situation where this is not an error, and easy to think of situations (particularly in lengthy test files) where it could come up. * `no-const-assign`: Assigning to a const after declaration is a runtime error. * `no-dupe-class-members`: Declare a class member twice, then only the second one counts. This is analogous to redeclaring a variable. * `no-this-before-super`: Using `this` or `super` in a derived class before a call to `super()` is a `ReferenceError` PR-URL: nodejs#5210 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org>
MylesBorins
pushed a commit
that referenced
this pull request
Mar 2, 2016
Add the following (seemingly non-controversial) ESLint rules: * `constructor-super`: Verify calls of `super()` in constructors. Flags situations that will result in runtime errors. Since we do not have 100% code coverage in tests, linting for runtime errors is useful. * `no-class-assign`: Flags cases where a class declaration is overwritten via variable assignment later. It is difficult to think of a situation where this is not an error, and easy to think of situations (particularly in lengthy test files) where it could come up. * `no-const-assign`: Assigning to a const after declaration is a runtime error. * `no-dupe-class-members`: Declare a class member twice, then only the second one counts. This is analogous to redeclaring a variable. * `no-this-before-super`: Using `this` or `super` in a derived class before a call to `super()` is a `ReferenceError` PR-URL: #5210 Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Johan Bergström <bugs@bergstroem.nu> Reviewed-By: Rod Vagg <rod@vagg.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add the following (seemingly non-controversial) ESLint rules:
constructor-super
: Verify calls ofsuper()
in constructors. Flagssituations that will result in runtime errors. Since we do not have 100%
code coverage in tests, linting for runtime errors is useful.
no-class-assign
: Flags cases where a class declaration isoverwritten via variable assignment later. It is difficult to think of a
situation where this is not an error, and easy to think of situations
(particularly in lengthy test files) where it could come up.
no-const-assign
: Assigning to a const after declaration is aruntime error.
no-dupe-class-members
: Declare a class member twice, then only thesecond one counts. This is analogous to redeclaring a variable.
no-this-before-super
: Usingthis
orsuper
in a derived classbefore a call to
super()
is aReferenceError