pnp/cli-microsoft365

Centralise default config values

開放

#6,186 建立於 2024年7月27日

 (5 則留言) (0 個反應) (0 位負責人)TypeScript (399 個分叉)auto 404
enhancementhelp wantedkeep-open

倉庫指標

星標
 (1,390 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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)

貢獻者指南