Skip to content

Commit

Permalink
fixup
Browse files Browse the repository at this point in the history
  • Loading branch information
targos committed May 8, 2024
1 parent 46381af commit db1731a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
1 change: 0 additions & 1 deletion tools/eslint-rules/prefer-primordials.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@ module.exports = {
},
schema: {
type: 'array',
minItems: 1,
items: [
{
type: 'object',
Expand Down
6 changes: 3 additions & 3 deletions tools/eslint-rules/prefer-proto.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
'use strict';

// Cribbed from `eslint-module-utils/declaredScope`
function declaredScope(context, name) {
const references = context.sourceCode.getScope().references;
function declaredScope(context, node, name) {
const references = context.sourceCode.getScope(node).references;
const reference = references.find((x) => x.identifier.name === name);
if (!reference) return undefined;
return reference.resolved.scope.type;
Expand All @@ -33,7 +33,7 @@ module.exports = {
[callee.type="MemberExpression"][callee.object.name="Object"][callee.property.name="create"]\
)'(node) {
if (node.callee.type === 'MemberExpression') {
const scope = declaredScope(context, node.callee.object);
const scope = declaredScope(context, node, node.callee.object);
if (scope && scope !== 'module' && scope !== 'global') {
return;
}
Expand Down

0 comments on commit db1731a

Please sign in to comment.