停用規則
停用下一行的檢查:
// eslint-disable-next-line
停用整份檔案的檢查:
/* eslint-disable */
linebreak-style
linebreak-style 用來強制統一換行符號:
unix:LF(\n)windows:CRLF(\r\n)
/* eslint linebreak-style: ["error", "unix"] */
/* eslint linebreak-style: ["error", "windows"] */
no-new
no-new 不允許只建立實例、卻不把它存進變數:
new Person();
改為:
var person = new Person();
2026 年後記
行內停用指令與這兩條規則仍可使用。停用 ESLint 時應縮小範圍並寫清原因,避免用整份檔案停用掩蓋其他問題。