pnp/cli-microsoft365

Centralise default config values

Open

#6,186 opened on Jul 27, 2024

View on GitHub
 (5 comments) (0 reactions) (0 assignees)TypeScript (399 forks)auto 404
enhancementhelp wantedkeep-open

Repository metrics

Stars
 (1,390 stars)
PR merge metrics
 (PR metrics pending)

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)

Contributor guide