Useless constructor. Open
constructor (props) {
- Read upRead up
- Exclude checks
Disallow unnecessary constructor (no-useless-constructor)
ES2015 provides a default class constructor if one is not specified. As such, it is unnecessary to provide an empty constructor or one that simply delegates into its parent class, as in the following examples:
class A {
constructor () {
}
}
class A extends B {
constructor (value) {
super(value);
}
}
Rule Details
This rule flags class constructors that can be safely removed without changing how the class works.
Examples
Examples of incorrect code for this rule:
/*eslint no-useless-constructor: "error"*/
/*eslint-env es6*/
class A {
constructor () {
}
}
class A extends B {
constructor (...args) {
super(...args);
}
}
Examples of correct code for this rule:
/*eslint no-useless-constructor: "error"*/
class A { }
class A {
constructor () {
doSomething();
}
}
class A extends B {
constructor() {
super('foo');
}
}
class A extends B {
constructor() {
super();
doSomething();
}
}
When Not To Use It
If you don't want to be notified about unnecessary constructors, you can safely disable this rule. Source: http://eslint.org/docs/rules/
Absolute imports should come before relative imports. Open
import { connect } from 'react-redux'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
JSX not allowed in files with extension '.js' Open
<Login
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Absolute imports should come before relative imports. Open
import * as AuthActions from 'client/admin/actions/AuthActions'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Component should be written as a pure function Open
class LoginHandler extends Component {
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/
Absolute imports should come before relative imports. Open
import { bindActionCreators } from 'redux'
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/