unicorn/number-literal-case
eslint-plugin-unicorn
Safe autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/number-literal-case": "error",
},
},
];const foo = 0XFF;const foo = 0xff;const foo = 0Xff;const foo = 0xFF;const foo = 0xFFn;const foo = 0b10;Examples from the ESLint documentation.
unicorn/number-literal-case
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/number-literal-case": "error",
},
},
];unicorn/number-literal-case
unicorn plugin · style
{
"rules": {
"unicorn/number-literal-case": "error"
}
}Biome does not have this rule.
Move function definitions to the highest possible scope.
Enforce consistent break/return/continue/throw position in case clauses.
Enforce consistent brace style for case clauses.
Prefer the spread operator over Array.from(…), Array#concat(…), Array#{slice,toSpliced}(), and trivial for…of copies.