博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
如何禁用ESLint规则
阅读量:2511 次
发布时间:2019-05-11

本文共 949 字,大约阅读时间需要 3 分钟。

What can you do to disable one rule that is perhaps set automatically by your tooling?

如何禁用可能由您的工具自动设置的一个规则?

Consider the case where your tooling set the and rules.

考虑一下您的工具设置规则和规则的情况。

There might be a valid reason for production code, but in development mode, having the ability to access the and the is essential.

生产代码可能有正当的理由,但是在开发模式下,具有访问和能力至关重要。

You can disable one or more specific ESLint rules for a whole file by adding on a few lines:

您可以通过添加以下几行来为整个文件禁用一个或多个特定的ESLint规则:

/* eslint-disable no-debugger, no-console */console.log('test')

or you can just do so in a block, re-enabling it afterwards:

或者,您可以在一个代码块中这样做,然后再启用它:

/* eslint-disable no-debugger, no-console */console.log('test')/* eslint-enable no-alert, no-console */

Or you can disable the rule on a specific line:

或者,您可以在特定行上禁用该规则:

console.log('test') // eslint-disable-line no-console
debugger // eslint-disable-line no-debugger
alert('test') // eslint-disable-line no-alert

翻译自:

转载地址:http://xvqgb.baihongyu.com/

你可能感兴趣的文章
java基础学习——7、String类和StringBuffer类的区别
查看>>
js基础
查看>>
sklearn 中 make_blobs模块
查看>>
C#之桶中取黑白球问题
查看>>
python学习笔记之多个装饰器
查看>>
自己创建一个android studio在线依赖compile
查看>>
【android】安卓开发apk列表
查看>>
清北学堂Day3
查看>>
JavaScript高级特性-实现继承的七种方式
查看>>
20121016学习笔记四
查看>>
EntityFramework 学习 一 Stored Procedure
查看>>
Sliverlight之 故事板
查看>>
Java 必知必会的 20 种常用类库和 API
查看>>
HDU 1087 Super Jumping! Jumping! Jumping!
查看>>
0007_初始模块和字节码
查看>>
[效率提升]如何管理好你的电脑文件
查看>>
C++实验二
查看>>
Sultan's Dowry Problem - 苏丹新娘问题
查看>>
SharePoint2010 富文本框添加图片功能的扩展
查看>>
零零碎碎的知识
查看>>