Skip to content

Commit

Permalink
suppport eslint v6+
Browse files Browse the repository at this point in the history
closes #21
  • Loading branch information
Ori Roniger authored and zertosh committed Aug 20, 2023
1 parent 96d7027 commit 34cccb5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions no-cycles.js
Expand Up @@ -26,8 +26,17 @@ var eslintModule = (function() {
throw new Error('Could not find eslint');
})();

var Traverser = eslintModule.require('./util/traverser');
var traverser = new Traverser();
var traverser = (function() {
var Traverser;
try {
// ESLint >=6.0.0
Traverser = eslintModule.require('./shared/traverser');
} catch (err) {
// ESLint <6.0.0
Traverser = eslintModule.require('./util/traverser');
}
return new Traverser();
})();

//------------------------------------------------------------------------------
// Utils
Expand Down

0 comments on commit 34cccb5

Please sign in to comment.