Skip to content

Commit

Permalink
fix: lint undefined template literals
Browse files Browse the repository at this point in the history
* chore: updates from devScripts

* fix: lint undefined template literals

---------

Co-authored-by: mshanemc <[email protected]>
  • Loading branch information
svc-cli-bot and mshanemc authored Jul 30, 2024
1 parent 21938ed commit 150b2b7
Show file tree
Hide file tree
Showing 6 changed files with 258 additions and 458 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"devDependencies": {
"@oclif/plugin-command-snapshot": "^5.2.7",
"@salesforce/dev-scripts": "^10.2.2",
"@salesforce/dev-scripts": "^10.2.4",
"@salesforce/ts-sinon": "^1.4.22",
"@types/semver": "^7.5.8",
"@types/shelljs": "^0.8.15",
Expand Down
2 changes: 1 addition & 1 deletion src/amazonS3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ type GetObjectOption = Omit<GetObjectRequest, 'Bucket'>;

type AmazonS3Options = {
bucket?: string;
cli?: CLI;
cli: CLI;
channel?: Channel;
baseUrl?: string;
credentials?: CredentialsOptions;
Expand Down
4 changes: 2 additions & 2 deletions src/commands/cli/release/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ export default class build extends SfCommand<void> {
const email = await this.exec('git config user.email', true);
if (!username || !email) {
const user = await octokit.request('GET /user');
if (!username) await this.exec(`git config user.name "${user.data.name}"`);
if (!email) await this.exec(`git config user.email "${user.data.email}"`);
if (!username && user.data.name) await this.exec(`git config user.name "${user.data.name}"`);
if (!email && user.data.email) await this.exec(`git config user.email "${user.data.email}"`);
}
}
}
11 changes: 5 additions & 6 deletions src/commands/cli/releasenotes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,14 @@ export default class ReleaseNotes extends SfCommand<ChangesByPlugin> {
if (differences.upgraded.size) {
this.styledHeader('Upgraded Plugins');
for (const [plugin, version] of differences.upgraded.entries()) {
this.log(`• ${plugin} ${oldPlugins.get(plugin)} => ${version}`);
this.log(`• ${plugin} ${oldPlugins.get(plugin) ?? '<no match in old plugins>'} => ${version}`);
}
}

if (differences.downgraded.size) {
this.styledHeader('Downgraded Plugins');
for (const [plugin, version] of differences.downgraded.entries()) {
this.log(`• ${plugin} ${oldPlugins.get(plugin)} => ${version}`);
this.log(`• ${plugin} ${oldPlugins.get(plugin) ?? '<no match in old plugins>'} => ${version}`);
}
}

Expand Down Expand Up @@ -155,10 +155,9 @@ export default class ReleaseNotes extends SfCommand<ChangesByPlugin> {
(pr) => pr.merged_at && (!publishDate || pr.merged_at > publishDate) && !pr.user?.login.includes('dependabot')
)
.map(async (pr) => {
const username = await this.getNameOfUser(
ensureString(pr.user?.login, `No user.login property found for ${JSON.stringify(pr)}`)
);
const author = pr.user?.login === username ? username : `${username} (${pr.user?.login})`;
const prUserLogin = ensureString(pr.user?.login, `No user.login property found for ${JSON.stringify(pr)}`);
const username = await this.getNameOfUser(prUserLogin);
const author = pr.user?.login === username ? username : `${username} (${prUserLogin})`;
return {
author,
mergedAt: pr.merged_at,
Expand Down
9 changes: 6 additions & 3 deletions src/registry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ export class Registry {
* Return a properly formatted --registry string
*/
public getRegistryParameter(): string {
if (!this.registryUrl) {
throw new SfError('registry is not set');
}
return `--registry ${this.registryUrl}`;
}

Expand All @@ -47,12 +50,12 @@ export class Registry {
npmrc = npmrc.map((line) => {
if (line.includes('registry=')) {
if (this.registryUrl && line.endsWith(this.registryUrl)) return line;
return `registry=${this.registryUrl}`;
return `registry=${this.registryUrl ?? ''}`;
}
return line;
});
} else {
npmrc.push(`registry=${this.registryUrl}`);
npmrc.push(`registry=${this.registryUrl ?? ''}`);
}
await this.writeNpmrc(packageDirectory, npmrc);
}
Expand All @@ -75,7 +78,7 @@ export class Registry {
npmrc = npmrc.map((line) => {
if (line.includes('_authToken')) {
if (line.includes(normalizedRegistry)) return line;
return `${normalizedRegistry}:_authToken="${this.authToken}"`;
return `${normalizedRegistry}:_authToken="${this.authToken ?? ''}"`;
}
return line;
});
Expand Down
Loading

0 comments on commit 150b2b7

Please sign in to comment.