This repository was archived by the owner on Oct 23, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -61,9 +61,9 @@ if (options.help || Object.keys(options).length === 0) {
61
61
62
62
if ( options . lint ) {
63
63
// Check lint deps
64
- const lintDeps = [ 'eslint' ] ;
64
+ const lintDeps = [ 'eslint' , 'eslint-config-google' ] ;
65
65
console . log ( 'Checking lint dependencies...' ) ;
66
- const npmRoot = execSync ( `npm root -g ` ) . toString ( ) . trim ( ) ;
66
+ const npmRoot = execSync ( `npm root` ) . toString ( ) . trim ( ) ;
67
67
const missingLintDeps = lintDeps . filter ( ( dep ) => {
68
68
return ! fs . existsSync ( path . join ( npmRoot , dep ) ) ;
69
69
} ) ;
@@ -72,8 +72,9 @@ if (options.lint) {
72
72
console . log ( 'Lint dependencies OK.' ) ;
73
73
} else {
74
74
for ( const dep of missingLintDeps ) {
75
- console . log ( 'Installing eslint' ) ;
76
- execSync ( `npm install eslint --global --save-dev` ) ;
75
+ console . log ( 'Installing missing eslint deps' ) ;
76
+ chdir ( rootDir ) ;
77
+ execSync ( `npm install --save-dev ${ dep } ` ) ;
77
78
}
78
79
}
79
80
}
@@ -263,7 +264,7 @@ function packCommon(target) {
263
264
const extname = path . extname ( filePath ) ;
264
265
if ( options . lint && extname === '.js' ) {
265
266
try {
266
- execSync ( `eslint -c ${ rootDir } /source/.eslintrc.json ${ filePath } ` ) ;
267
+ execSync ( `${ rootDir } /node_modules/.bin/ eslint -c ${ rootDir } /source/.eslintrc.json ${ filePath } ` ) ;
267
268
} catch ( error ) {
268
269
console . error ( error . stdout . toString ( ) ) ;
269
270
}
You can’t perform that action at this time.
0 commit comments