js文件忽略ESLint语法检查

1. 整个文件忽略

复制代码
/* eslint-disable */
// 代码开始位置

2. 临时禁止

复制代码
/* eslint-disable */
console.log('hello');
/* eslint-enable */

3. 对指定规则忽略

复制代码
/* eslint-disable no-alert, no-console */
alert('foo');
console.log('bar');
/* eslint-enable no-alert, no-console */

4. 指定行忽略

复制代码
alert('foo'); // eslint-disable-line
 
// eslint-disable-next-line
alert('foo');

5. 指定行禁用某个规则

复制代码
alert('foo'); // eslint-disable-line no-alert
 
// eslint-disable-next-line no-alert
alert('foo');

6. 指定行禁用多个规则

复制代码
alert('foo'); // eslint-disable-line no-alert, quotes, semi
 
// eslint-disable-next-line no-alert, quotes, semi
alert('foo');
相关推荐
JieE2123 小时前
LeetCode 56. 合并区间|超清晰 JS 图解思路,面试高频区间题
javascript·算法·面试
candyTong6 小时前
RTK 技术原理:一次典型会话里,80% 上下文是怎么省下来的
javascript·后端·架构
_柳青杨10 小时前
深入理解 JavaScript 事件循环
前端·javascript
大家的林语冰15 小时前
ES5 凉凉,Babel 8 正式发布,默认不再编译为 ES5 和 CJS......
前端·javascript·前端工程化
weedsfly18 小时前
异步编程全景与事件循环——彻底搞懂 JS 执行机制
前端·javascript
用户17335980753718 小时前
纯前端 PDF 数字签名实战:Vue 3 + pdf-lib 在浏览器里完成签名嵌入
前端·javascript
JieE2121 天前
LeetCode 226. 翻转二叉树|JS 递归超详细拆解,二叉树入门经典题
javascript·算法
JieE2121 天前
LeetCode 104. 二叉树的最大深度|递归思路超详细拆解
javascript·算法
kyriewen1 天前
我用 AI 一周写完了整个项目,上线第一天就崩了——这是我踩过最贵的 5 个坑
前端·javascript·ai编程
Larcher1 天前
AI Loop:让AI像人一样自主完成任务的核心机制
javascript·人工智能·设计模式