Ensure function arity is preserved after build (#31808)

Co-authored-by: eps1lon <sebastian.silbermann@vercel.com>
This commit is contained in:
David Sancho
2024-12-18 14:08:56 +01:00
committed by GitHub
co-authored by eps1lon
parent 6a4b46cd70
commit 2bd1c756c6
8 changed files with 113 additions and 6 deletions
+11
View File
@@ -86,6 +86,17 @@ module.exports = {
rules: {
'no-undef': 'error',
'no-shadow-restricted-names': 'error',
'no-restricted-syntax': [
'error',
// TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
{
selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
message:
'Google Closure Compiler optimized `arguments` access. ' +
'This affects function arity. ' +
'Create a reference to `arguments` to avoid this optimization',
},
],
},
// These plugins aren't used, but eslint complains if an eslint-ignore comment
@@ -81,6 +81,17 @@ module.exports = {
rules: {
'no-undef': 'error',
'no-shadow-restricted-names': 'error',
'no-restricted-syntax': [
'error',
// TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
{
selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
message:
'Google Closure Compiler optimized `arguments` access. ' +
'This affects function arity. ' +
'Create a reference to `arguments` to avoid this optimization',
},
],
},
// These plugins aren't used, but eslint complains if an eslint-ignore comment
+11
View File
@@ -83,6 +83,17 @@ module.exports = {
rules: {
'no-undef': 'error',
'no-shadow-restricted-names': 'error',
'no-restricted-syntax': [
'error',
// TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
{
selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
message:
'Google Closure Compiler optimized `arguments` access. ' +
'This affects function arity. ' +
'Create a reference to `arguments` to avoid this optimization',
},
],
},
// These plugins aren't used, but eslint complains if an eslint-ignore comment
+11
View File
@@ -71,6 +71,17 @@ module.exports = {
rules: {
'no-undef': 'error',
'no-shadow-restricted-names': 'error',
'no-restricted-syntax': [
'error',
// TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
{
selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
message:
'Google Closure Compiler optimized `arguments` access. ' +
'This affects function arity. ' +
'Create a reference to `arguments` to avoid this optimization',
},
],
},
// These plugins aren't used, but eslint complains if an eslint-ignore comment
+11
View File
@@ -73,6 +73,17 @@ module.exports = {
rules: {
'no-undef': 'error',
'no-shadow-restricted-names': 'error',
'no-restricted-syntax': [
'error',
// TODO: Can be removed once we upgrade GCC to a version without `optimizeArgumentsArray` optimization.
{
selector: 'Identifier[name=/^JSCompiler_OptimizeArgumentsArray_/]',
message:
'Google Closure Compiler optimized `arguments` access. ' +
'This affects function arity. ' +
'Create a reference to `arguments` to avoid this optimization',
},
],
},
// These plugins aren't used, but eslint complains if an eslint-ignore comment