围绕箭头主体的意外块语句 [英] Unexpected block statement surrounding arrow body

查看:27
本文介绍了围绕箭头主体的意外块语句的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用 "eslint-config-airbnb": "^6.1.0", 来保持我的 JavaScript 干净.

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

我的 linter 对看似合法的代码不满意:

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

这似乎是一个持续存在的问题.在此期间,有人对 OCD 开发人员如何解决此问题有任何建议吗?也许禁用此规则或其他方式?

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?

推荐答案

单个表达式不需要块语句.

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

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

这篇关于围绕箭头主体的意外块语句的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆