rest-spread-spacing
eslint
Safe autofix
eslint.config.js
export default [
{
rules: {
"rest-spread-spacing": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
Enforce spacing between rest and spread operators and their expressions
fn(... args);
[... arr, 4, 5, 6];
let [a, b, ... arr] = [1, 2, 3, 4, 5];
function fn(... args) { console.log(args); }
let { x, y, ... z } = { x: 1, y: 2, a: 3, b: 4 };
let n = { x, y, ... z };fn(...args);
[...arr, 4, 5, 6];
let [a, b, ...arr] = [1, 2, 3, 4, 5];
function fn(...args) { console.log(args); }
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
let n = { x, y, ...z };fn(...args);
[...arr, 4, 5, 6];
let [a, b, ...arr] = [1, 2, 3, 4, 5];
function fn(...args) { console.log(args); }
let { x, y, ...z } = { x: 1, y: 2, a: 3, b: 4 };
let n = { x, y, ...z };fn(... args);
[... arr, 4, 5, 6];
let [a, b, ... arr] = [1, 2, 3, 4, 5];
function fn(... args) { console.log(args); }
let { x, y, ... z } = { x: 1, y: 2, a: 3, b: 4 };
let n = { x, y, ... z };Examples from the ESLint documentation.
rest-spread-spacing
eslint
export default [
{
rules: {
"rest-spread-spacing": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Enforce variables to be declared either together or separately in functions
Disallow assignment operators in return statements
Disallow new operators outside of assignments or comparisons
Disallow specified global variables