javascript - Eslint:禁用运算符 `in`

标签 javascript eslint

有什么方法可以告诉eslint不允许使用in运算符吗?

我的意思是:

console.log(1 in [1]);

最佳答案

禁止指定语法(无限制语法)

For instance, you might decide to disallow the use of try-catch or class, or you might decide to disallow the use of the in operator.

http://eslint.org/docs/rules/no-restricted-syntax

关于javascript - Eslint:禁用运算符 `in`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40504402/

相关文章:

javascript - ESLint 定义前不使用

javascript - 在对象上使用映射时意外使用逗号

JavaScript全屏无法滚动

javascript - 取消选中有条件的复选框

reactjs - 类型错误 : Failed to load plugin 'jest' declared in '.eslintrc' : Class extends value undefined is not a constructor or null

javascript - 你如何在保存时按字母顺序格式化 React Component Prop ?

javascript - jQuery 延迟对象

javascript - 如何对输入标签中的两个数字求和?

javascript - 错误滚动条 : top not defined

express - Heroku 应用程序因 eslint 导入错误而崩溃