Skip to content

Commit

Permalink
Update eslint to discourage push.apply
Browse files Browse the repository at this point in the history
  • Loading branch information
javagl committed Jan 26, 2025
1 parent 3cfa5d5 commit 3bebc12
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,18 @@ export default [
"error",
{ vars: "all", args: "none", caughtErrors: "none" },
],
"no-restricted-syntax": [
"warn",
{
// The pattern of Array.push.apply() can lead to stack
// overflow errors when the source array is large.
// See https://github.com/CesiumGS/cesium/issues/12053
selector:
"CallExpression[callee.object.property.name=push][callee.property.name=apply]",
message:
"Avoid Array.push.apply(). Use addAllToArray() for arrays of unknown size, or the spread syntax for arrays that are known to be small",
},
],
},
},
{
Expand Down

0 comments on commit 3bebc12

Please sign in to comment.