File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change 11const fs = require ( 'fs/promises' ) ;
2- const leasot = require ( 'leasot' ) ;
32const path = require ( 'path' ) ;
43const { promisify } = require ( 'util' ) ;
54const glob = promisify ( require ( 'glob' ) ) ;
@@ -8,6 +7,7 @@ const cache = new Map();
87
98module . exports = function ( eleventyConfig ) {
109 eleventyConfig . addGlobalData ( 'todos' , async function generateTodos ( ) {
10+ const { parse, report } = await import ( 'leasot' ) ;
1111 const start = performance . now ( ) ;
1212
1313 const todos = [ ] ;
@@ -26,8 +26,8 @@ module.exports = function(eleventyConfig) {
2626 for ( const filename of files ) {
2727 const contents = await fs . readFile ( filename , 'utf8' ) ;
2828 const extension = path . extname ( filename ) ;
29- const parsed = leasot . parse ( contents , { extension, filename } ) ;
30- const output = leasot . report ( parsed , 'raw' ) ;
29+ const parsed = await parse ( contents , { extension, filename } ) ;
30+ const output = await report ( parsed , 'raw' ) ;
3131 todos . push ( ...output ) ;
3232 }
3333
You can’t perform that action at this time.
0 commit comments