Skip to content

Commit

Permalink
FOOP
Browse files Browse the repository at this point in the history
  • Loading branch information
nikku committed Jul 20, 2023
1 parent 635fe47 commit 5cd6c80
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions lib/support/compile-config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const path = require('path').posix;
const path = require('path');

const { isString } = require('min-dash');

Expand Down Expand Up @@ -154,15 +154,11 @@ cache['${ originalPkg }/${ ruleName }'] = rule_${ idx };`;

function computeRuleImport(resolver, pkg, rule) {

console.log();

// local reference, resolved relative to pkg location
if (rule.startsWith('.')) {
console.log(pkg, resolver.require.resolve(pkg));

const pkgDir = path.dirname(resolver.require.resolve(pkg));
const pkgMain = resolver.require.resolve(pkg);

Check warning on line 159 in lib/support/compile-config.js

View check run for this annotation

Codecov / codecov/patch

lib/support/compile-config.js#L159

Added line #L159 was not covered by tests

console.log(pkgDir);
const pkgDir = path.dirname(pkgMain.split(path.sep).join(path.posix.sep));

Check warning on line 161 in lib/support/compile-config.js

View check run for this annotation

Codecov / codecov/patch

lib/support/compile-config.js#L161

Added line #L161 was not covered by tests

return path.normalize(path.join(pkgDir, rule));

Check warning on line 163 in lib/support/compile-config.js

View check run for this annotation

Codecov / codecov/patch

lib/support/compile-config.js#L163

Added line #L163 was not covered by tests
}
Expand Down

0 comments on commit 5cd6c80

Please sign in to comment.