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) {
6161
6262if ( options . lint ) {
6363 // Check lint deps
64- const lintDeps = [ 'eslint' ] ;
64+ const lintDeps = [ 'eslint' , 'eslint-config-google' ] ;
6565 console . log ( 'Checking lint dependencies...' ) ;
66- const npmRoot = execSync ( `npm root -g ` ) . toString ( ) . trim ( ) ;
66+ const npmRoot = execSync ( `npm root` ) . toString ( ) . trim ( ) ;
6767 const missingLintDeps = lintDeps . filter ( ( dep ) => {
6868 return ! fs . existsSync ( path . join ( npmRoot , dep ) ) ;
6969 } ) ;
@@ -72,8 +72,9 @@ if (options.lint) {
7272 console . log ( 'Lint dependencies OK.' ) ;
7373 } else {
7474 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 } ` ) ;
7778 }
7879 }
7980}
@@ -263,7 +264,7 @@ function packCommon(target) {
263264 const extname = path . extname ( filePath ) ;
264265 if ( options . lint && extname === '.js' ) {
265266 try {
266- execSync ( `eslint -c ${ rootDir } /source/.eslintrc.json ${ filePath } ` ) ;
267+ execSync ( `${ rootDir } /node_modules/.bin/ eslint -c ${ rootDir } /source/.eslintrc.json ${ filePath } ` ) ;
267268 } catch ( error ) {
268269 console . error ( error . stdout . toString ( ) ) ;
269270 }
You can’t perform that action at this time.
0 commit comments