diff --git a/lib/utils.js b/lib/utils.js index 876973e..4ed7d1c 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -76,7 +76,7 @@ function getInstalledVarsPackage() { function runInsideCoreComponents() { try { - const rootPackage = require(path.join(__dirname, '../../../package.json')); + const rootPackage = require(path.join(process.cwd(), 'package.json')); return rootPackage.name === CORE_COMPONENTS_PACKAGE; } catch (e) { console.log(e); @@ -94,7 +94,7 @@ function resolveVarsFile(file) { return fs.readFileSync(require.resolve(fullPath)); } else { - return fs.readFileSync(path.resolve(__dirname, `../../../packages/vars/src/${file}`)); + return fs.readFileSync(path.resolve(process.cwd(), `packages/vars/src/${file}`)); } } @@ -268,7 +268,7 @@ function findTypographyMixins(ruleProps) { return TYPOGRAPHY_PROPS.every((prop) => ruleProps[prop] === mixinProps[prop]); } else { return TYPOGRAPHY_PROPS.every( - (prop) => !ruleProps[prop] || ruleProps[prop] === mixinProps[prop] + (prop) => !ruleProps[prop] || ruleProps[prop] === mixinProps[prop], ); } })