jfmengels/eslint-plugin-fp

"no-unused-expressions" catches super() as an unused statement

shadedesignz opened this issue · 2 comments

When creating a class in es6 there are often times for extension when I used 'super'. The no-unused-expressions catches this as an unused expression and should probably be an option if not outright defaulted to always being ignored.

👍 for defaulting this to being ignored. Practically speaking, super() is a function called, so the expressions are always getting used (assuming the target function doesn't ignore them, and I think this plugin would catch that anyway).

I just ran into this issue here:

module.exports = class NestedResult extends Result {
  constructor (runnable, results = []) {
    super(runnable, _.some('error')(results) || undefined)
    this.results = results
  }
}

I will open a PR to address this case.