sonarjs/shorthand-property-grouping
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/shorthand-property-grouping": "error",
},
},
];Shorthand object properties should be grouped at the beginning or end of an object declaration
let obj1 = {
foo,
a: 1,
color, // Noncompliant
b: 2,
judyGarland // Noncompliant
}let obj1 = {
foo,
color,
judyGarland,
a: 1,
b: 2
}let obj1 = {
a: 1,
b: 2,
foo,
color,
judyGarland
}Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
sonarjs/shorthand-property-grouping
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/shorthand-property-grouping": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Local variables should not be declared and then immediately returned or thrown
Loops should not contain more than a single "break" or "continue" statement
Regular expressions using Unicode character classes or property escapes should enable the unicode flag
Arithmetic operations should not result in "NaN"