pnp/cli-microsoft365

Centralise default config values

Ouverte

#6 186 ouverte le 27 juil. 2024

 (5 commentaires) (0 réaction) (0 personne assignée)TypeScript (399 forks)auto 404
enhancementhelp wantedkeep-open

Métriques du dépôt

Stars
 (1 390 étoiles)
Métriques de merge PR
 (Métriques PR en attente)

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)

Guide contributeur