chore: cleanup unusued variables + enable linting (#38898)

This commit is contained in:
Milan Burda 2023-06-26 11:51:54 +02:00 committed by GitHub
parent e900f6ecc3
commit ef6569b7d3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
36 changed files with 31 additions and 89 deletions

View file

@ -12,7 +12,7 @@ function parseCommandLine () {
string: ['bump', 'version'],
boolean: ['dryRun', 'help'],
alias: { version: ['v'] },
unknown: arg => { help = true; }
unknown: () => { help = true; }
});
if (help || opts.help || !opts.bump) {
console.log(`
@ -33,14 +33,6 @@ async function main () {
const currentVersion = getElectronVersion();
const version = await nextVersion(opts.bump, currentVersion);
const parsed = semver.parse(version);
const components = {
major: parsed.major,
minor: parsed.minor,
patch: parsed.patch,
pre: parsed.prerelease
};
// print would-be new version and exit early
if (opts.dryRun) {
console.log(`new version number would be: ${version}\n`);
@ -97,18 +89,6 @@ async function nextVersion (bumpType, version) {
return version;
}
function isMajorStable (bump, currentVersion) {
if (versionUtils.isBeta(currentVersion) && (bump === 'stable')) return true;
return false;
}
function isMajorNightly (version, currentVersion) {
const parsed = semver.parse(version);
const current = semver.parse(currentVersion);
if (versionUtils.isNightly(currentVersion) && (parsed.major > current.major)) return true;
return false;
}
if (require.main === module) {
main().catch((error) => {
console.error(error);