From e0d15118b0f0d1958b13e280e3f72ee99503e3a6 Mon Sep 17 00:00:00 2001 From: Paul Robert Lloyd Date: Thu, 14 Nov 2024 17:38:20 +0000 Subject: [PATCH] Lint JavaScript --- index.js | 5 +++-- lib/block-tokenizer.js | 11 ++++++----- lib/class-generator.js | 1 + test/compatibility.js | 4 +++- test/index.js | 4 +++- 5 files changed, 16 insertions(+), 9 deletions(-) diff --git a/index.js b/index.js index 90a2032..0ad8f2e 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,7 @@ /** - * Render Govspeak markup. - * @param {object} [options] Options for the extension + * Render Govspeak markup + * + * @param {object} [options] - Options for the extension * @returns {object} A MarkedExtension to be passed to `marked.use()` */ module.exports = function (options = {}) { diff --git a/lib/block-tokenizer.js b/lib/block-tokenizer.js index 1698913..710721e 100644 --- a/lib/block-tokenizer.js +++ b/lib/block-tokenizer.js @@ -1,10 +1,11 @@ /** * Parse a Govspeak Markdown block - * @param {import('marked').Lexer} lexer Marked lexer - * @param {string} src Source text to be parsed - * @param {string} name Extension name, i.e. `govspeak-example` - * @param {string} open Opening tag, i.e. $E - * @param {string} [close] Closing tag, i.e. $E + * + * @param {import('marked').Lexer} lexer - Marked lexer + * @param {string} src - Source text to be parsed + * @param {string} name - Extension name, i.e. `govspeak-example` + * @param {string} open - Opening tag, i.e. $E + * @param {string} [close] - Closing tag, i.e. $E * @returns {object|undefined} Tokens */ module.exports = function (lexer, src, name, open, close) { diff --git a/lib/class-generator.js b/lib/class-generator.js index 0f04dbb..37c54e4 100644 --- a/lib/class-generator.js +++ b/lib/class-generator.js @@ -3,6 +3,7 @@ const gemCompatibleClassNames = require('./class-names').compatible /** * Get class name for given component + * * @param {string} component - Component name, i.e. 'button' * @param {object} [options] - Extension options * @returns {string} Class name, i.e. 'govuk-button' diff --git a/test/compatibility.js b/test/compatibility.js index 8d34734..36971de 100644 --- a/test/compatibility.js +++ b/test/compatibility.js @@ -1,6 +1,8 @@ -const assert = require('assert/strict') +const assert = require('node:assert/strict') const { describe, it } = require('node:test') + const { marked } = require('marked') + const govspeak = require('../index.js') describe('Govspeak with RubyGem compatibility', () => { diff --git a/test/index.js b/test/index.js index 91b1934..af46bc5 100644 --- a/test/index.js +++ b/test/index.js @@ -1,6 +1,8 @@ -const assert = require('assert/strict') +const assert = require('node:assert/strict') const { describe, it } = require('node:test') + const { marked } = require('marked') + const govspeak = require('../index.js') describe('Govspeak', () => {