Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@

var logger = require( 'debug' );
var visit = require( 'unist-util-visit' );
var createTOC = require( '@stdlib/_tools/markdown/namespace-toc' );

Check warning on line 25 in lib/node_modules/@stdlib/_tools/remark/plugins/remark-namespace-toc/lib/transformer.js

View workflow job for this annotation

GitHub Actions / Lint Changed Files

only the `sync` property of the required module is used; require the property directly
var startsWith = require( '@stdlib/string/starts-with' );
var endsWith = require( '@stdlib/string/ends-with' );
var format = require( '@stdlib/string/format' );


// VARIABLES //
Expand Down Expand Up @@ -171,7 +172,7 @@
}
}
if ( i === parent.children.length - 1 ) {
throw new Error( 'invalid node. Invalid table of contents (toc) comment. Ensure that the Markdown file includes both starting and ending `toc` comments. Node: `' + node.value + '`.' );
throw new Error( format( 'invalid node. Invalid table of contents (toc) comment. Ensure that the Markdown file includes both starting and ending `toc` comments. Node: `%s`.', node.value ) );
}
if ( found ) {
debug( 'Append links to links section...' );
Expand Down