pnp/cli-microsoft365

Centralise default config values

Aberta

#6.186 aberto em 27 de jul. de 2024

 (5 comentários) (0 reação) (0 responsável)TypeScript (399 forks)auto 404
enhancementhelp wantedkeep-open

Métricas do repositório

Stars
 (1.390 estrelas)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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)

Guia do colaborador