Bump packages to fix linter

This commit is contained in:
Henry Mercer 2023-01-18 20:50:03 +00:00
parent ed9506bbaf
commit 0a11e3fdd9
6063 changed files with 378752 additions and 306784 deletions

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
':function[async=true][generator=true]'(node) {
context.report(node, `Async Generators are not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
'ForOfStatement[await=true]'(node) {
context.report(node, `Async Iteration is not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
'Literal[bigint]'(node) {
context.report(node, `BigInts are not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
BindExpression(node) {
context.report(node, `The Bind Operator is not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,9 @@
module.exports = (context, badBrowser) => ({
// Ignore type annotations that don't assign
'ClassProperty[computed=true]:not([typeAnnotation]:not([value]))'(node) {
context.report(node, `Computed Class Fields are not supported in ${badBrowser}`)
},
'PropertyDefinition[computed=true]:not([typeAnnotation]:not([value]))'(node) {
context.report(node, `Computed Class Fields are not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
DoExpression(node) {
context.report(node, `Do Expressions are not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
'ImportExpression, CallExpression[callee.type="Import"]'(node) {
context.report(node, `Dynamic import is not supported in ${badBrowser}`)
}
})

View 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 = []

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
'AssignmentExpression[operator="**="], BinaryExpression[operator="**"]'(node) {
context.report(node, `Exponentiation Operator is not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
'LogicalExpression[operator="??"]'(node) {
context.report(node, `the Nullish Coalescing Operator is not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,14 @@
module.exports = {
meta: {
fixable: 'code'
},
create: (context, badBrowser) => ({
'Literal[raw=/_/][value>=0], Literal[raw=/_/][value<=0]'(node) {
context.report({
node,
message: `Numeric Separators are not supported in ${badBrowser}`,
fix: fixer => fixer.replaceText(node, String(node.value))
})
}
})
}

View file

@ -0,0 +1,16 @@
module.exports = (context, badBrowser) => ({
'ObjectExpression > SpreadElement'(node) {
context.report(node, `Object Rest/Spread is not supported in ${badBrowser}`)
},
'ObjectPattern > RestElement'(node) {
context.report(node, `Object Rest/Spread is not supported in ${badBrowser}`)
},
// Catch older versions of eslint and babel-eslint
ExperimentalRestProperty(node) {
context.report(node, `Object Rest/Spread is not supported in ${badBrowser}`)
},
ExperimentalSpreadProperty(node) {
context.report(node, `Object Rest/Spread is not supported in ${badBrowser}`)
},
})

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
'CatchClause:not([param])'(node) {
context.report(node, `Optional Catch Parameters are not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,8 @@
module.exports = (context, badBrowser) => ({
OptionalMemberExpression(node) {
context.report(node, `Optional Chaining is not supported in ${badBrowser}`)
},
ChainExpression(node) {
context.report(node, `Optional Chaining is not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,5 @@
module.exports = (context, badBrowser) => ({
'BinaryExpression[operator="|>"]'(node) {
context.report(node, `The Pipeline Operator is not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,8 @@
module.exports = (context, badBrowser) => ({
ClassPrivateProperty(node) {
context.report(node, `Private Class Fields are not supported in ${badBrowser}`)
},
PrivateIdentifier(node) {
context.report(node, `Private Class Fields are not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,11 @@
module.exports = (context, badBrowser) => ({
// Ignore type annotations that don't assign
'ClassProperty[static=false]:not([typeAnnotation]:not([value]))'(node) {
if (node.value === null) return
context.report(node, `Instance Class Fields are not supported in ${badBrowser}`)
},
'PropertyDefinition[static=false]:not([typeAnnotation]:not([value]))'(node) {
if (node.value === null) return
context.report(node, `Instance Class Fields are not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,9 @@
module.exports = (context, badBrowser) => ({
// Ignore type annotations that don't assign
'ClassProperty[static=true]:not([typeAnnotation]:not([value]))'(node) {
context.report(node, `Static Class Fields are not supported in ${badBrowser}`)
},
'PropertyDefinition[static=true]:not([typeAnnotation]:not([value]))'(node) {
context.report(node, `Static Class Fields are not supported in ${badBrowser}`)
}
})

View file

@ -0,0 +1,28 @@
const hasLookbehind = s => s.includes('(?<=') || s.includes('(?<!)')
module.exports = (context, badBrowser) => ({
'Literal[regex]'(node) {
if (hasLookbehind(node.regex.pattern)) {
context.report(node, `RegExp lookbehinds are not supported in ${badBrowser}`)
}
},
'CallExpression[callee.name="RegExp"], NewExpression[callee.name="RegExp"]'(node) {
const [source] = node.arguments;
if (
source &&
(
(
source.type === 'Literal' &&
typeof source.value === 'string' &&
hasLookbehind(source.value)
) ||
(
source.type === 'TemplateLiteral' &&
source.quasis.some(({value: {raw}}) => hasLookbehind(raw))
)
)
) {
context.report(node, `RegExp lookbehinds are not supported in ${badBrowser}`)
}
}
})

View file

@ -0,0 +1,28 @@
const hasNamedGroup = s => /\(\?<[_$\w]/.test(s)
module.exports = (context, badBrowser) => ({
'Literal[regex]'(node) {
if (hasNamedGroup(node.regex.pattern)) {
context.report(node, `RegExp named groups are not supported in ${badBrowser}`)
}
},
'CallExpression[callee.name="RegExp"], NewExpression[callee.name="RegExp"]'(node) {
const [source] = node.arguments;
if (
source &&
(
(
source.type === 'Literal' &&
typeof source.value === 'string' &&
hasNamedGroup(source.value)
) ||
(
source.type === 'TemplateLiteral' &&
source.quasis.some(({value: {raw}}) => hasNamedGroup(raw))
)
)
) {
context.report(node, `RegExp named groups are not supported in ${badBrowser}`)
}
}
})

View file

@ -0,0 +1,26 @@
module.exports = (context, badBrowser) => ({
'Literal[regex]'(node) {
if (node.regex.flags.includes('s')) {
context.report(node, `RegExp "s" flag is not supported in ${badBrowser}`)
}
},
'CallExpression[callee.name="RegExp"], NewExpression[callee.name="RegExp"]'(node) {
const [, flags] = node.arguments;
if (
flags &&
(
(
flags.type === 'Literal' &&
typeof flags.value === 'string' &&
flags.value.includes('s')
) ||
(
flags.type === 'TemplateLiteral' &&
flags.quasis.some(({value: {raw}}) => raw.includes('s'))
)
)
) {
context.report(node, `RegExp "s" flag is not supported in ${badBrowser}`)
}
}
})