跳到主要內容

no-loss-of-precision

不允許會失去精度的字面數字。

This rule extends the base eslint/no-loss-of-precision rule. It adds support for numeric separators.

選項

請參閱 eslint/no-loss-of-precision 選項

如何使用

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

在操場中嘗試此規則 ↗

資源

ESLint 核心 中取得 ❤️。