UNPKG

343 BJavaScriptView Raw
1const { exec } = require ("child_process")
2const queue = require ("@ptb/queue")
3const { SyncHook } = require ("tapable")
4
5const amory = new SyncHook ()
6
7const lint = (file) => {
8 if (file.obj === "file") {
9 exec (`prettier-eslint --write ${file.src}`)
10 }
11}
12
13amory.tap ("js:lint", () => {
14 queue.watch ({ "src": "src/**/*.js" }, lint)
15})