Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/fix lint on change #20

Merged
Merged
Changes from 1 commit
Commits
File filter
Filter file types
Jump to
Jump to file
Failed to load files.

Always

Just for now

output lint after webpack output

  • Loading branch information
trickpattyFH20 committed Mar 30, 2018
commit a5dfd6990b3080459c574356cbbeaa89a118f1f2
@@ -74,19 +74,20 @@ lintOnChange.prototype.apply = function(compiler) {
if (process.argv.includes('--env.prod') || (process.argv.includes('--env.nolint') || process.env.NO_LINT)) {
return;
}
compiler.plugin("watch-run", (watching, done) => {
compiler.plugin("done", (watching, done) => {
const changedTimes = compiler.watchFileSystem.watcher.mtimes;
const changedFiles = Object.keys(changedTimes);
if (changedFiles.length) {
const args = ['run', 'lint.raw', '--', ...changedFiles];
if (process.argv.includes('--env.fix')) {
args.push('--fix')
}
let lint = spawnSync('npm', args, { stdio: 'inherit'});
setTimeout(() => {
spawnSync('npm', args, { stdio: 'inherit'});
});
}
done();
});

};

const buildPlugins = [
ProTip! Use n and p to navigate between commits in a pull request.