跳到主要內容

space-before-function-paren

已過時

格式規則現在位於 eslint-stylistic@stylistic/ts/space-before-function-paren 是此規則的替代方案。
請參閱 過時的格式化規則 以進一步了解。

強制執行函數括號前的一致間距。

🔧

使用以下方法可以自動修正此規則報告的某些問題 --fix ESLint 命令列選項.

此規則擴充了基礎 eslint/space-before-function-paren 規則。它增加了對函數呼叫中泛型型別參數的支援。

選項

查看 eslint/space-before-function-paren 選項

如何使用

.eslintrc.cjs
module.exports = {
"rules": {
// Note: you must disable the base rule as it can report incorrect errors
"space-before-function-paren": "off",
"@typescript-eslint/space-before-function-paren": "error"
}
};

在此遊戲空間中嘗試這個規則↗

資源

取自 ESLint 核心❤️。