Skip to content

Commit 150b2b7

Browse files
fix: lint undefined template literals
* chore: updates from devScripts * fix: lint undefined template literals --------- Co-authored-by: mshanemc <shane.mclaughlin@salesforce.com>
1 parent 21938ed commit 150b2b7

File tree

6 files changed

+258
-458
lines changed

6 files changed

+258
-458
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
},
3535
"devDependencies": {
3636
"@oclif/plugin-command-snapshot": "^5.2.7",
37-
"@salesforce/dev-scripts": "^10.2.2",
37+
"@salesforce/dev-scripts": "^10.2.4",
3838
"@salesforce/ts-sinon": "^1.4.22",
3939
"@types/semver": "^7.5.8",
4040
"@types/shelljs": "^0.8.15",

src/amazonS3.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ type GetObjectOption = Omit<GetObjectRequest, 'Bucket'>;
2929

3030
type AmazonS3Options = {
3131
bucket?: string;
32-
cli?: CLI;
32+
cli: CLI;
3333
channel?: Channel;
3434
baseUrl?: string;
3535
credentials?: CredentialsOptions;

src/commands/cli/release/build.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ export default class build extends SfCommand<void> {
298298
const email = await this.exec('git config user.email', true);
299299
if (!username || !email) {
300300
const user = await octokit.request('GET /user');
301-
if (!username) await this.exec(`git config user.name "${user.data.name}"`);
302-
if (!email) await this.exec(`git config user.email "${user.data.email}"`);
301+
if (!username && user.data.name) await this.exec(`git config user.name "${user.data.name}"`);
302+
if (!email && user.data.email) await this.exec(`git config user.email "${user.data.email}"`);
303303
}
304304
}
305305
}

src/commands/cli/releasenotes.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,14 @@ export default class ReleaseNotes extends SfCommand<ChangesByPlugin> {
8181
if (differences.upgraded.size) {
8282
this.styledHeader('Upgraded Plugins');
8383
for (const [plugin, version] of differences.upgraded.entries()) {
84-
this.log(`• ${plugin} ${oldPlugins.get(plugin)} => ${version}`);
84+
this.log(`• ${plugin} ${oldPlugins.get(plugin) ?? '<no match in old plugins>'} => ${version}`);
8585
}
8686
}
8787

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

@@ -155,10 +155,9 @@ export default class ReleaseNotes extends SfCommand<ChangesByPlugin> {
155155
(pr) => pr.merged_at && (!publishDate || pr.merged_at > publishDate) && !pr.user?.login.includes('dependabot')
156156
)
157157
.map(async (pr) => {
158-
const username = await this.getNameOfUser(
159-
ensureString(pr.user?.login, `No user.login property found for ${JSON.stringify(pr)}`)
160-
);
161-
const author = pr.user?.login === username ? username : `${username} (${pr.user?.login})`;
158+
const prUserLogin = ensureString(pr.user?.login, `No user.login property found for ${JSON.stringify(pr)}`);
159+
const username = await this.getNameOfUser(prUserLogin);
160+
const author = pr.user?.login === username ? username : `${username} (${prUserLogin})`;
162161
return {
163162
author,
164163
mergedAt: pr.merged_at,

src/registry.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ export class Registry {
3131
* Return a properly formatted --registry string
3232
*/
3333
public getRegistryParameter(): string {
34+
if (!this.registryUrl) {
35+
throw new SfError('registry is not set');
36+
}
3437
return `--registry ${this.registryUrl}`;
3538
}
3639

@@ -47,12 +50,12 @@ export class Registry {
4750
npmrc = npmrc.map((line) => {
4851
if (line.includes('registry=')) {
4952
if (this.registryUrl && line.endsWith(this.registryUrl)) return line;
50-
return `registry=${this.registryUrl}`;
53+
return `registry=${this.registryUrl ?? ''}`;
5154
}
5255
return line;
5356
});
5457
} else {
55-
npmrc.push(`registry=${this.registryUrl}`);
58+
npmrc.push(`registry=${this.registryUrl ?? ''}`);
5659
}
5760
await this.writeNpmrc(packageDirectory, npmrc);
5861
}
@@ -75,7 +78,7 @@ export class Registry {
7578
npmrc = npmrc.map((line) => {
7679
if (line.includes('_authToken')) {
7780
if (line.includes(normalizedRegistry)) return line;
78-
return `${normalizedRegistry}:_authToken="${this.authToken}"`;
81+
return `${normalizedRegistry}:_authToken="${this.authToken ?? ''}"`;
7982
}
8083
return line;
8184
});

0 commit comments

Comments
 (0)