Unexpected block statement surrounding arrow body

ilrein picture ilrein · Mar 18, 2016 · Viewed 37.5k times · Source

I'm using "eslint-config-airbnb": "^6.1.0", to keep my JavaScript clean.

My linter is unhappy with what seems to be legitimate code:

enter image description here

It seems like this might be an ongoing issue. Does anyone have any suggestions for an OCD developer on how to address this in the meantime? Perhaps disabling this rule or otherwise?

Answer

Kevin B picture Kevin B · Mar 18, 2016

The block statement isn't needed for a single expression.

this.state.todos.filter(filterTodo => filterTodo !== todo);