| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -2,7 +2,7 @@ | |||
| 2 | 2 | /* eslint-disable no-console */ | |
| 3 | 3 | ||
| 4 | 4 | const path = require('path'); | |
| 5 | - | ||
| 5 | + const fs = require('fs'); | ||
| 6 | 6 | const execa = require('execa'); | |
| 7 | 7 | const chalk = require('chalk'); | |
| 8 | 8 | ||
@@ -11,7 +11,9 @@ execa | |||
| 11 | 11 | .then(staged => staged.split('\n')) | |
| 12 | 12 | // lint and commit any lint fixes | |
| 13 | 13 | .then(staged => { | |
| 14 | - const jsFiles = staged.filter(file => file.endsWith('.js')); | ||
| 14 | + const jsFiles = staged | ||
| 15 | + .filter(file => file.endsWith('.js')) | ||
| 16 | + .filter(file => fs.existsSync(file)); | ||
| 15 | 17 | if (jsFiles.length) { | |
| 16 | 18 | return execa('eslint', ['--fix', ...jsFiles], { | |
| 17 | 19 | stdio: 'inherit', | |
| Back | FazBrowse Home | New Git URL |
0 commit comments