Skip to content

Commit 07802c9

Browse files
dgp1130alan-agius4
authored andcommitted
ci: update dist-tag to make flags optional.
We can't guarantee that the user provided these options at compile time, so all options should include `undefined` in their types. This makes the type system a little smarter and hopefully prevent future mistakes. Fortunately we were already doing the right thing, this will make sure we continue to do so in the future. I opted to use `Partial<DistTagArgs>` so that all future flags would be implicitly forced to be optional. Otherwise, we may forget to make them optional and potentially introduce a bug.
1 parent 49ed081 commit 07802c9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/dist-tag.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ interface DistTagOptions {
3737
/**
3838
* This function adds a tag to all public packages in the CLI repo.
3939
*/
40-
export default function(args: DistTagOptions, logger: logging.Logger) {
40+
export default function(args: Partial<DistTagOptions>, logger: logging.Logger) {
4141
if (args.help) {
4242
logger.info(`dist-tag adds a tag to all public packages in the CLI repo.
4343

0 commit comments

Comments
 (0)