pnp/cli-microsoft365

Centralise default config values

Offen

#6.186 geöffnet am 27.07.2024

 (5 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)TypeScript (399 Forks)auto 404
enhancementhelp wantedkeep-open

Repository-Metriken

Stars
 (1.390 Sterne)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

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)

Contributor Guide