mirror of
https://github.com/wassname/talk.git
synced 2026-07-14 11:18:50 +08:00
feat: supported watcher
This commit is contained in:
+4
-2
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user