Bump packages to fix linter
This commit is contained in:
parent
ed9506bbaf
commit
0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions
29
node_modules/eslint-plugin-escompat/lib/rules/no-edge-destructure-bug.js
generated
vendored
Normal file
29
node_modules/eslint-plugin-escompat/lib/rules/no-edge-destructure-bug.js
generated
vendored
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
const objectPatternHasDefaults = node =>
|
||||
node.type === 'ObjectPattern' && node.properties.some(prop => prop.value.type === 'AssignmentPattern')
|
||||
|
||||
module.exports = function(context) {
|
||||
return {
|
||||
ArrowFunctionExpression(node) {
|
||||
// Unary functions don't trip on this bug
|
||||
if (node.params.length < 2) return
|
||||
|
||||
// This bug only occurs when some arguments use Object destructuring
|
||||
if (!node.params.some(param => param.type === 'ObjectPattern')) return
|
||||
|
||||
const objectPatternArgs = node.params.filter(node => node.type === 'ObjectPattern')
|
||||
|
||||
// This bug is only occurs when an argument uses Object Destructuring with Default assignment
|
||||
if (!objectPatternArgs.some(objectPatternHasDefaults)) return
|
||||
|
||||
// This bug gets fixed if the first argument uses Object destructuring with default assignments!
|
||||
if (node.params[0].type === 'ObjectPattern' && objectPatternHasDefaults(node.params[0])) return
|
||||
|
||||
context.report(
|
||||
node,
|
||||
'There is an Edge 15-17 bug which causes second argument destructuring to fail. See https://git.io/fhd7N for more'
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports.schema = []
|
||||
Loading…
Add table
Add a link
Reference in a new issue