pnp/cli-microsoft365

Centralise default config values

オープン

#6,186 opened on 2024/07/27

 (5 件のコメント) (0 件のリアクション) (0 人の担当者)TypeScript (399 件のフォーク)auto 404
enhancementhelp wantedkeep-open

Repository metrics

Stars
 (1,390 個のスター)
PR merge metrics
 (PR metrics pending)

説明

In a lot of commands, we retrieve config values as follows:

cli.getSettingWithDefaultValue<boolean>(settingsNames.autoOpenLinksInBrowser, false)

I don't think it's a good approach to define the default value in the command itself. A better approach would be that we centralize all default values and provide a new function where the user should only specify the config variable. E.g.:

cli.getSetting<boolean>(settingsNames.autoOpenLinksInBrowser)

コントリビューターガイド