Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix linting
Browse files Browse the repository at this point in the history
LucasHill committed Aug 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
1 parent 9a51518 commit a049fee
Showing 5 changed files with 20 additions and 15 deletions.
7 changes: 4 additions & 3 deletions lib/rules/no-assert-equal.js
Original file line number Diff line number Diff line change
@@ -138,10 +138,11 @@ module.exports = {
},
Program: function (node) {
// Gather all calls to global `equal()`.
const sourceCode = context.sourceCode ?? context.getSourceCode();
const sourceCode =
context.sourceCode ?? context.getSourceCode();
const scope = sourceCode.getScope
? sourceCode.getScope(node)
: context.getScope();
? sourceCode.getScope(node)
: context.getScope();

const tracker = new ReferenceTracker(scope);
const traceMap = { equal: { [ReferenceTracker.CALL]: true } };
7 changes: 4 additions & 3 deletions lib/rules/no-global-assertions.js
Original file line number Diff line number Diff line change
@@ -34,10 +34,11 @@ module.exports = {
create: function (context) {
return {
Program: function (node) {
const sourceCode = context.sourceCode ?? context.getSourceCode();
const sourceCode =
context.sourceCode ?? context.getSourceCode();
const scope = sourceCode.getScope
? sourceCode.getScope(node)
: context.getScope();
? sourceCode.getScope(node)
: context.getScope();

const tracker = new ReferenceTracker(scope);
const traceMap = {};
7 changes: 4 additions & 3 deletions lib/rules/no-global-expect.js
Original file line number Diff line number Diff line change
@@ -32,10 +32,11 @@ module.exports = {
create: function (context) {
return {
Program: function (node) {
const sourceCode = context.sourceCode ?? context.getSourceCode();
const sourceCode =
context.sourceCode ?? context.getSourceCode();
const scope = sourceCode.getScope
? sourceCode.getScope(node)
: context.getScope();
? sourceCode.getScope(node)
: context.getScope();

const tracker = new ReferenceTracker(scope);
const traceMap = { expect: { [ReferenceTracker.CALL]: true } };
7 changes: 4 additions & 3 deletions lib/rules/no-global-module-test.js
Original file line number Diff line number Diff line change
@@ -32,10 +32,11 @@ module.exports = {
create: function (context) {
return {
Program: function (node) {
const sourceCode = context.sourceCode ?? context.getSourceCode();
const sourceCode =
context.sourceCode ?? context.getSourceCode();
const scope = sourceCode.getScope
? sourceCode.getScope(node)
: context.getScope();
? sourceCode.getScope(node)
: context.getScope();

const tracker = new ReferenceTracker(scope);
const traceMap = {
7 changes: 4 additions & 3 deletions lib/rules/no-global-stop-start.js
Original file line number Diff line number Diff line change
@@ -34,10 +34,11 @@ module.exports = {

return {
Program: function (node) {
const sourceCode = context.sourceCode ?? context.getSourceCode();
const sourceCode =
context.sourceCode ?? context.getSourceCode();
const scope = sourceCode.getScope
? sourceCode.getScope(node)
: context.getScope();
? sourceCode.getScope(node)
: context.getScope();

const tracker = new ReferenceTracker(scope);
const traceMap = {

0 comments on commit a049fee

Please sign in to comment.