Skip to content
This repository has been archived by the owner on Nov 3, 2022. It is now read-only.

Commit

Permalink
feat: warn on deprecated config (#62)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed Apr 13, 2022
1 parent 1f47a6c commit 190065e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 2 additions & 3 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,10 +506,9 @@ class Config {
}

[_checkDeprecated] (key, where, obj, kv) {
// XXX a future npm version will make this a warning.
// An even more future npm version will make this an error.
// XXX(npm9+) make this throw an error
if (this.deprecated[key]) {
log.verbose('config', key, this.deprecated[key])
log.warn('config', key, this.deprecated[key])
}
}

Expand Down
4 changes: 2 additions & 2 deletions test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ loglevel = yolo
['warn', 'invalid config', 'Must be one or more', 'numeric value'],
['warn', 'invalid config', 'prefix=true', 'set in command line options'],
['warn', 'invalid config', 'Must be', 'valid filesystem path'],
['verbose', 'config', 'also', 'Please use --include=dev instead.'],
['warn', 'config', 'also', 'Please use --include=dev instead.'],
['warn', 'invalid config', 'loglevel="yolo"',
`set in ${resolve(path, 'project/.npmrc')}`],
['warn', 'invalid config', 'Must be one of:',
Expand Down Expand Up @@ -506,7 +506,7 @@ loglevel = yolo
['warn', 'invalid config', 'Must be one or more', 'numeric value'],
['warn', 'invalid config', 'prefix=true', 'set in command line options'],
['warn', 'invalid config', 'Must be', 'valid filesystem path'],
['verbose', 'config', 'also', 'Please use --include=dev instead.'],
['warn', 'config', 'also', 'Please use --include=dev instead.'],
])
})

Expand Down

0 comments on commit 190065e

Please sign in to comment.