Skip to content

Commit 5529e24

Browse files
Fix compiler “An argument for 'config' was not provided”
1 parent 65485cc commit 5529e24

File tree

7 files changed

+9
-7
lines changed

7 files changed

+9
-7
lines changed

src/govuk/components/accordion/accordion.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ var TRANSLATIONS_DEFAULT = {
3131
*
3232
* @class
3333
* @param {HTMLElement} $module - HTML element to use for accordion
34-
* @param {object} config - Accordion config
34+
* @param {object} [config] - Accordion config
3535
* @param {AccordionTranslations} config.i18n - Translations
3636
*/
3737
function Accordion ($module, config) {

src/govuk/components/button/button.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var DEBOUNCE_TIMEOUT_IN_SECONDS = 1
1111
*
1212
* @class
1313
* @param {HTMLElement} $module - The element this component controls
14-
* @param {object} config - Button config
14+
* @param {object} [config] - Button config
1515
* @param {boolean} [config.preventDoubleClick=false] - Whether the button should prevent double clicks
1616
*/
1717
function Button ($module, config) {

src/govuk/components/character-count/character-count.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ var TRANSLATIONS_DEFAULT = {
4848
*
4949
* @class
5050
* @param {HTMLElement} $module - The element this component controls
51-
* @param {object} config - Character count config
51+
* @param {object} [config] - Character count config
5252
* @param {number} config.maxlength - If `maxwords` is set, this is not required.
5353
* The maximum number of characters. If `maxwords` is provided, it will be ignored.
5454
* @param {number} config.maxwords - If `maxlength` is set, this is not required.

src/govuk/components/character-count/character-count.unit.test.mjs

+3-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,9 @@ describe('CharacterCount', () => {
101101

102102
const component = new CharacterCount($div, {
103103
i18n: {
104-
charactersUnderLimitOne: 'Different custom text. Count: %{count}'
104+
charactersUnderLimit: {
105+
one: 'Different custom text. Count: %{count}'
106+
}
105107
}
106108
})
107109
expect(component.formatCountMessage(1, 'characters')).toEqual('Custom text. Count: 1')

src/govuk/components/error-summary/error-summary.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ import { normaliseDataset } from '../../common/normalise-dataset.mjs'
1212
*
1313
* @class
1414
* @param {HTMLElement} $module - The element this component controls
15-
* @param {object} config - Error summary config
15+
* @param {object} [config] - Error summary config
1616
* @param {boolean} [config.disableAutoFocus=false] - Whether to disable the component taking focus on initialisation
1717
*/
1818
function ErrorSummary ($module, config) {

src/govuk/components/notification-banner/notification-banner.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { normaliseDataset } from '../../common/normalise-dataset.mjs'
88
*
99
* @class
1010
* @param {HTMLElement} $module - HTML element to use for notification banner
11-
* @param {object} config - Error summary config
11+
* @param {object} [config] - Error summary config
1212
* @param {boolean} [config.disableAutoFocus=false] - Whether to disable the component taking focus on initialisation
1313
*/
1414
function NotificationBanner ($module, config) {

src/govuk/i18n.mjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
* @class
66
* @private
77
* @param {object} translations - Key-value pairs of the translation strings to use.
8-
* @param {object} config - Configuration options for the function.
8+
* @param {object} [config] - Configuration options for the function.
99
* @param {string} config.locale - An overriding locale for the PluralRules functionality.
1010
*/
1111
export function I18n (translations, config) {

0 commit comments

Comments
 (0)