Skip to content

Commit

Permalink
Rename variables on expiring-todo-comments (#399)
Browse files Browse the repository at this point in the history
  • Loading branch information
AwfulDarkness0110 committed Sep 27, 2019
1 parent d2612a9 commit 4a18df0
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions rules/expiring-todo-comments.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ const MESSAGE_ID_ENGINE_MATCHES = 'engineMatches';
const MESSAGE_ID_REMOVE_WHITESPACES = 'removeWhitespaces';
const MESSAGE_ID_MISSING_AT_SYMBOL = 'missingAtSymbol';

const hasPackage = readPkgUp.sync();
const pkg = hasPackage ? hasPackage.package : {};
const packageResult = readPkgUp.sync();
const hasPackage = Boolean(packageResult);
const packageJson = hasPackage ? packageResult.package : {};

const pkgDependencies = {
...pkg.dependencies,
...pkg.devDependencies
...packageJson.dependencies,
...packageJson.devDependencies
};

const DEPENDENCY_INCLUSION_RE = /^[+|-]\s*@?[\S+]\/?\S+/;
Expand Down Expand Up @@ -282,7 +283,7 @@ const create = context => {
uses++;
const [{condition, version}] = packageVersions;

const pkgVersion = tryToCoerceVersion(pkg.version);
const pkgVersion = tryToCoerceVersion(packageJson.version);
const desidedPkgVersion = tryToCoerceVersion(version);

const compare = semverComparisonForOperator(condition);
Expand Down Expand Up @@ -351,7 +352,7 @@ const create = context => {
}
}

const pkgEngines = pkg.engines || {};
const pkgEngines = packageJson.engines || {};

for (const engine of engines) {
uses++;
Expand Down

0 comments on commit 4a18df0

Please sign in to comment.