diff --git a/.eslintrc b/.eslintrc index 5597fdc..44d150f 100644 --- a/.eslintrc +++ b/.eslintrc @@ -7,6 +7,7 @@ "consistent-return": 1, "func-name-matching": 0, "max-nested-callbacks": 0, + "max-lines-per-function": 0, "sort-keys": 0, }, } diff --git a/getLockfile.js b/getLockfile.js index ca351bb..423cd43 100644 --- a/getLockfile.js +++ b/getLockfile.js @@ -23,6 +23,9 @@ module.exports = function getLockfile(packageFile, date, { if (typeof date !== 'undefined' && !new Date(date).getTime()) { return Promise.reject(colors.red(`\`date\` must be a valid Date format if provided; got ${inspect(date)}`)); } + if (only && only !== 'prod' && only !== 'production') { + return Promise.reject(colors.red('`only`, when provided, must be "prod" or "production"')); + } const tmpDirP = getProjectTempDir({ npmNeeded, logger }); const npmRC = path.join(path.dirname(packageFile), '.npmrc'); const copyPkg = tmpDirP.then((tmpDir) => {