Revert "Revert "chore: add modifications to staging automatically after eslint fix (#113443)""

This reverts commit cc73577f84.
This commit is contained in:
spalger 2021-10-04 15:52:42 +00:00
parent a9c100768e
commit 9df5051817

View file

@ -6,6 +6,9 @@
* Side Public License, v 1.
*/
import SimpleGit from 'simple-git/promise';
import { REPO_ROOT } from '@kbn/utils';
import { run, combineErrors, createFlagError, createFailError } from '@kbn/dev-utils';
import * as Eslint from './eslint';
import * as Stylelint from './stylelint';
@ -48,6 +51,11 @@ run(
await Linter.lintFiles(log, filesToLint, {
fix: flags.fix,
});
if (flags.fix) {
const simpleGit = new SimpleGit(REPO_ROOT);
await simpleGit.add(filesToLint);
}
} catch (error) {
errors.push(error);
}