indent
已停用
格式設定規則現已納入 eslint-stylistic 中。 @stylistic/ts/indent 是此規則的替代品。
請參閱 停用格式設定規則 以取得更多資訊。
強制設定一致縮排。
🔧
本規則回報的一些問題可自動修正,方式為使用 --fix
ESLint 命令列選項.
警告
警告
在使用此規則前請閱讀 問題 #1824:壓縮規則的問題!
此規則延伸了基本 eslint/indent
規則。它新增了對 TypeScript 節點的支援。
選項
請見 eslint/indent
選項。
使用方法
.eslintrc.cjs
module.exports = {
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"indent": "off",
"@typescript-eslint/indent": "error"
}
};
在此處遊樂場測試此規則 ↗