Skip to content

Commit 4d586eb

Browse files
committed
feat(config): warn on deprecated configs
1 parent 1f2d89a commit 4d586eb

File tree

4 files changed

+3
-23
lines changed

4 files changed

+3
-23
lines changed

lib/auth/sso.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ function sleep (time) {
3636
}
3737

3838
const login = async (npm, { creds, registry, scope }) => {
39-
log.warn('deprecated', 'SSO --auth-type is deprecated')
40-
4139
const opts = { ...npm.flatOptions, creds, registry, scope }
4240
const { ssoType } = opts
4341

lib/commands/install.js

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,6 @@ class Install extends ArboristWorkspaceCmd {
109109
const isGlobalInstall = this.npm.config.get('global')
110110
const where = isGlobalInstall ? globalTop : this.npm.prefix
111111
const forced = this.npm.config.get('force')
112-
const isDev = this.npm.config.get('dev')
113112
const scriptShell = this.npm.config.get('script-shell') || undefined
114113

115114
// be very strict about engines when trying to update npm itself
@@ -140,14 +139,6 @@ class Install extends ArboristWorkspaceCmd {
140139
args = ['.']
141140
}
142141

143-
// TODO: Add warnings for other deprecated flags? or remove this one?
144-
if (isDev) {
145-
log.warn(
146-
'install',
147-
'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.'
148-
)
149-
}
150-
151142
const opts = {
152143
...this.npm.flatOptions,
153144
auditLevel: null,
@@ -163,7 +154,7 @@ class Install extends ArboristWorkspaceCmd {
163154
'preinstall',
164155
'install',
165156
'postinstall',
166-
'prepublish', // XXX should we remove this finally??
157+
'prepublish', // XXX(npm9) should we remove this finally??
167158
'preprepare',
168159
'prepare',
169160
'postprepare',

test/lib/auth/sso.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ t.test('empty login', async (t) => {
4444
'should throw if no sso-type defined in flatOptions'
4545
)
4646

47-
t.equal(
48-
warn,
49-
'deprecated SSO --auth-type is deprecated',
50-
'should print deprecation warning'
51-
)
52-
5347
_flatOptions.ssoType = 'oauth'
5448
log = ''
5549
warn = ''

test/lib/commands/install.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ t.test('with args, dev=true', async t => {
1212
let REIFY_CALLED = false
1313
let ARB_OBJ = null
1414

15-
const { npm, logs } = await loadMockNpm(t, {
15+
const { npm } = await loadMockNpm(t, {
1616
'@npmcli/run-script': ({ event }) => {
1717
SCRIPTS.push(event)
1818
},
@@ -41,10 +41,7 @@ t.test('with args, dev=true', async t => {
4141
npm.prefix = path.resolve(t.testdir({}))
4242

4343
await npm.exec('install', ['fizzbuzz'])
44-
t.match(
45-
logs.warn,
46-
[['install', 'Usage of the `--dev` option is deprecated. Use `--include=dev` instead.']]
47-
)
44+
4845
t.match(
4946
ARB_ARGS,
5047
{ global: false, path: npm.prefix, auditLevel: null },

0 commit comments

Comments
 (0)