ci: Lint with XO

This commit is contained in:
Pierre Vanduynslager
2017-11-21 20:55:47 -05:00
parent d548edcf37
commit facdadaddb
10 changed files with 68 additions and 73 deletions
+4 -4
View File
@@ -3,15 +3,15 @@ const SemanticReleaseError = require('@semantic-release/error');
module.exports = (type, lastRelease, logger) => {
let version;
if (!lastRelease.version) {
version = '1.0.0';
logger.log('There is no previous release, the next release version is %s', version);
} else {
if (lastRelease.version) {
version = semver.inc(lastRelease.version, type);
if (!version) {
throw new SemanticReleaseError(`Invalid release type ${type}`, 'EINVALIDTYPE');
}
logger.log('The next release version is %s', version);
} else {
version = '1.0.0';
logger.log('There is no previous release, the next release version is %s', version);
}
return version;
+1 -2
View File
@@ -7,6 +7,7 @@ const npm = require('@semantic-release/npm');
const github = require('@semantic-release/github');
const RELEASE_TYPE = ['major', 'premajor', 'minor', 'preminor', 'patch', 'prepatch', 'prerelease'];
const validatePluginConfig = conf => isString(conf) || isString(conf.path) || isFunction(conf);
module.exports = {
verifyConditions: {
@@ -74,5 +75,3 @@ module.exports = {
},
},
};
const validatePluginConfig = conf => isString(conf) || isString(conf.path) || isFunction(conf);