Skip to content

Commit

Permalink
Linting
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Sep 22, 2023
1 parent c4975d0 commit 1cefef5
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions rules/prefer-event-target.js
Expand Up @@ -14,22 +14,23 @@ const packagesShouldBeIgnored = new Set([
])

Check failure on line 14 in rules/prefer-event-target.js

View workflow job for this annotation

GitHub Actions / lint-test

Missing semicolon.

const isConstVariableDeclarationId = node =>
node.parent.type === 'VariableDeclarator'
&& node.parent.id === node
&& node.parent.parent.type === 'VariableDeclaration'
&& node.parent.parent.kind === 'const'
&& node.parent.parent.declarations.includes(node.parent)
node.parent.type === 'VariableDeclarator'
&& node.parent.id === node
&& node.parent.parent.type === 'VariableDeclaration'
&& node.parent.parent.kind === 'const'
&& node.parent.parent.declarations.includes(node.parent);

function isAwaitImportOrRequireFromIgnoredPackages(node) {
if (!node) {
return false;
}

const source = isStaticRequire(node)
? node.arguments[0]
: node.type === 'AwaitExpression' && node.argument.type === 'ImportExpression'
? node.argument.source
: undefined;
let source;
if (isStaticRequire(node)) {
[source] = node.arguments

Check failure on line 30 in rules/prefer-event-target.js

View workflow job for this annotation

GitHub Actions / lint-test

Missing semicolon.
} else if (node.type === 'AwaitExpression' && node.argument.type === 'ImportExpression') {
({source} = node.argument)

Check failure on line 32 in rules/prefer-event-target.js

View workflow job for this annotation

GitHub Actions / lint-test

Missing semicolon.
}

if (isStringLiteral(source) && packagesShouldBeIgnored.has(source.value)) {
return true;
Expand Down

0 comments on commit 1cefef5

Please sign in to comment.