Skip to content

Commit aec09b5

Browse files
committed
docs: update leasot call site
1 parent dd9b112 commit aec09b5

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

docs/_plugins/todos.cjs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const fs = require('fs/promises');
2-
const leasot = require('leasot');
32
const path = require('path');
43
const { promisify } = require('util');
54
const glob = promisify(require('glob'));
@@ -8,6 +7,7 @@ const cache = new Map();
87

98
module.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

0 commit comments

Comments
 (0)