feat: supported watcher

This commit is contained in:
Wyatt Johnson
2018-07-04 10:17:48 -06:00
parent eacdb7db59
commit 679ad01a7d
9 changed files with 41 additions and 103 deletions
+4 -2
View File
@@ -4,7 +4,7 @@ const { getGraphQLConfig } = require("graphql-config");
const path = require("path");
const fs = require("fs");
function lint(files) {
function lintAndWrite(files) {
const linter = new Linter({ fix: true });
for (const { fileName, types } of files) {
@@ -80,7 +80,7 @@ async function main() {
}
// Send the files off to the linter to be linted and written.
lint(files);
lintAndWrite(files);
return files;
}
@@ -88,9 +88,11 @@ async function main() {
main()
.then(files => {
for (const { fileName } of files) {
// tslint:disable-next-line:no-console
console.log(`Generated ${fileName}`);
}
})
.catch(err => {
// tslint:disable-next-line:no-console
console.error(err);
});