ci: Lint with XO
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user