mirror of https://github.com/lukechilds/node.git
Browse Source
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: https://github.com/nodejs/node/pull/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>process-exit-stdio-flushing
Rich Trott
9 years ago
1 changed files with 5 additions and 0 deletions
Loading…
Reference in new issue