File tree Expand file tree Collapse file tree 5 files changed +19
-18
lines changed
Expand file tree Collapse file tree 5 files changed +19
-18
lines changed Original file line number Diff line number Diff line change 11language : node_js
22node_js :
3+ - ' 14'
34 - ' 12'
45 - ' 10'
5- - ' 8'
Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ class UpdateNotifier {
5555 // after the set interval, so not to bother users right away
5656 lastUpdateCheck : Date . now ( )
5757 } ) ;
58- } catch ( _ ) {
58+ } catch {
5959 // Expecting error code EACCES or EPERM
6060 const message =
6161 chalk ( ) . yellow ( format ( ' %s update check failed ' , options . pkg . name ) ) +
@@ -119,13 +119,13 @@ class UpdateNotifier {
119119 return this ;
120120 }
121121
122- options = Object . assign ( {
122+ options = {
123123 isGlobal : isInstalledGlobally ( ) ,
124- isYarnGlobal : isYarnGlobal ( ) ( )
125- } , options ) ;
124+ isYarnGlobal : isYarnGlobal ( ) ( ) ,
125+ ...options
126+ } ;
126127
127128 let installCommand ;
128-
129129 if ( options . isYarnGlobal ) {
130130 installCommand = `yarn global add ${ this . packageName } ` ;
131131 } else if ( options . isGlobal ) {
Original file line number Diff line number Diff line change 1111 "url" : " https://sindresorhus.com"
1212 },
1313 "engines" : {
14- "node" : " >=8 "
14+ "node" : " >=10 "
1515 },
1616 "scripts" : {
17- "test" : " xo && ava --timeout=20s -s "
17+ "test" : " xo && ava --timeout=20s --serial "
1818 },
1919 "files" : [
2020 " index.js" ,
3535 ],
3636 "dependencies" : {
3737 "boxen" : " ^4.2.0" ,
38- "chalk" : " ^3.0 .0" ,
38+ "chalk" : " ^4.1 .0" ,
3939 "configstore" : " ^5.0.1" ,
4040 "has-yarn" : " ^2.1.0" ,
4141 "import-lazy" : " ^2.1.0" ,
4242 "is-ci" : " ^2.0.0" ,
4343 "is-installed-globally" : " ^0.3.1" ,
44- "is-npm" : " ^4 .0.0" ,
44+ "is-npm" : " ^5 .0.0" ,
4545 "is-yarn-global" : " ^0.3.0" ,
4646 "latest-version" : " ^5.0.0" ,
4747 "pupa" : " ^2.0.1" ,
5555 "fixture-stdout" : " ^0.2.1" ,
5656 "mock-require" : " ^3.0.3" ,
5757 "strip-ansi" : " ^6.0.0" ,
58- "xo" : " ^0.25.0"
59- },
60- "xo" : {
61- "rules" : {
62- "prefer-object-spread" : 0
63- }
58+ "xo" : " ^0.33.1"
6459 }
6560}
Original file line number Diff line number Diff line change @@ -4,7 +4,10 @@ import test from 'ava';
44let updateNotifier ;
55
66test . before ( ( ) => {
7- [ '..' , 'configstore' , 'xdg-basedir' ] . forEach ( clearModule ) ;
7+ for ( const name of [ '..' , 'configstore' , 'xdg-basedir' ] ) {
8+ clearModule ( name ) ;
9+ }
10+
811 // Set configstore.config to something that requires root access
912 process . env . XDG_CONFIG_HOME = '/usr' ;
1013 updateNotifier = require ( '..' ) ;
Original file line number Diff line number Diff line change @@ -19,7 +19,10 @@ function Control(shouldNotifyInNpmScript) {
1919}
2020
2121const setupTest = isNpmReturnValue => {
22- [ '..' , 'is-npm' ] . forEach ( clearModule ) ;
22+ for ( const name of [ '..' , 'is-npm' ] ) {
23+ clearModule ( name ) ;
24+ }
25+
2326 process . stdout . isTTY = true ;
2427 mock ( 'is-npm' , { isNpmOrYarn : isNpmReturnValue || false } ) ;
2528 const updateNotifier = require ( '..' ) ;
You can’t perform that action at this time.
0 commit comments