🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter, drop-in ESLint superpower replacement 💪 with built-in support for js, jsx, typescript, flow, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
This error appears every time you want to use function chaining in a class and eslint-plugin-putout finds a rule that.
Example:
export default class Vector {
x: number
y: number
constructor(x = 0, y = 0) {
this.x = x
this.y = y
}
add(v: Vector): this {
this.x += v.x
this.y += v.y
return this
}
}
// No issues, everything is fine :)
With eslint issue:
typeof 5 === 'number' // <-- found eslint issue! Try parsing file
export default class Vector {
x: number
y: number
constructor(x = 0, y = 0) {
this.x = x
this.y = y
}
add(v: Vector): this { // <-- Unknown type, Syntax error!
this.x += v.x
this.y += v.y
return this
}
}
This error appears every time you want to use function chaining in a class and
eslint-plugin-putout
finds a rule that.Example:
With eslint issue: