sort-vars
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"sort-vars": "error",
},
},
];Require variables within the same declaration block to be sorted
let b, a;
let c, D, e;
let f, F;let c, d, a, b;let c, d, a, e;let a, b, c, d;
let _a = 10;
let _b = 20;
let E, e;
let G, f, h;Examples from the ESLint documentation.
sort-vars
eslint
export default [
{
rules: {
"sort-vars": "error",
},
},
];sort-vars
eslint plugin · pedantic
{
"rules": {
"sort-vars": "error"
}
}Biome does not have this rule.
Require identifiers to match a specified regular expression
Enforce the consistent use of either function declarations or expressions assigned to variables
Disallow async functions which have no await expression