Skip to content

oxc/no-rest-spread-properties Restriction ​

What it does ​

Disallow Object Rest/Spread Properties.

Example ​

javascript
let { x, ...y } = z;
let z = { x, ...y };

Options ​

json
{
  "rules": {
    "no-rest-spread-properties": [
      "error",
      {
        "objectSpreadMessage": "Object spread properties are not allowed.",
        "objectRestMessage": "Object rest properties are not allowed."
      }
    ]
  }
}
  • objectSpreadMessage: A message to display when object spread properties are found.
  • objectRestMessage: A message to display when object rest properties are found.

References ​

Released under the MIT License.