diff options
Diffstat (limited to 'src/content/dependencies/index.js')
-rw-r--r-- | src/content/dependencies/index.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/content/dependencies/index.js b/src/content/dependencies/index.js index c2d88f64..f82062f7 100644 --- a/src/content/dependencies/index.js +++ b/src/content/dependencies/index.js @@ -1,6 +1,7 @@ import chokidar from 'chokidar'; import EventEmitter from 'events'; import * as path from 'path'; +import {ESLint} from 'eslint'; import {fileURLToPath} from 'url'; import contentFunction from '../../content-function.js'; @@ -35,6 +36,8 @@ export function watchContentDependencies({ close, }); + const eslint = new ESLint(); + // Watch adjacent files const metaPath = fileURLToPath(import.meta.url); const metaDirname = path.dirname(metaPath); @@ -129,6 +132,13 @@ export function watchContentDependencies({ let error = null; main: { + const eslintResults = await eslint.lintFiles([filePath]); + const eslintFormatter = await eslint.loadFormatter('stylish'); + const eslintResultText = eslintFormatter.format(eslintResults); + if (eslintResultText.trim().length) { + console.log(eslintResultText); + } + let spec; try { spec = (await import(cachebust(filePath))).default; |