Skip to content

Commit

Permalink
[Refactor] ensure getScope compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
manuth committed Sep 6, 2024
1 parent e8ac4e4 commit 46fe08d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/rules/order.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import minimatch from 'minimatch';
import includes from 'array-includes';
import groupBy from 'object.groupby';
import { getSourceCode } from 'eslint-module-utils/contextCompat';
import { getScope, getSourceCode } from 'eslint-module-utils/contextCompat';

import importType from '../core/importType';
import isStaticRequire from '../core/staticRequire';
Expand Down Expand Up @@ -182,10 +182,10 @@ function isCJSExports(context, node) {
&& node.property.type === 'Identifier'
&& node.object.name === 'module'
&& node.property.name === 'exports') {
return (context.sourceCode || context).getScope(node).variables.findIndex((variable) => variable.name === 'module') === -1;
return getScope(context, node).variables.findIndex((variable) => variable.name === 'module') === -1;
} else if (node.type === 'Identifier'
&& node.name === 'exports') {
return (context.sourceCode || context).getScope(node).variables.findIndex((variable) => variable.name === 'exports') === -1;
return getScope(context, node).variables.findIndex((variable) => variable.name === 'exports') === -1;
}
}

Expand Down

0 comments on commit 46fe08d

Please sign in to comment.