Skip to content

Commit

Permalink
Fix compiler “An argument for 'config' was not provided”
Browse files Browse the repository at this point in the history
  • Loading branch information
colinrotherham committed Nov 8, 2022
1 parent 65485cc commit 5529e24
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/govuk/components/accordion/accordion.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ var TRANSLATIONS_DEFAULT = {
*
* @class
* @param {HTMLElement} $module - HTML element to use for accordion
* @param {object} config - Accordion config
* @param {object} [config] - Accordion config
* @param {AccordionTranslations} config.i18n - Translations
*/
function Accordion ($module, config) {
Expand Down
2 changes: 1 addition & 1 deletion src/govuk/components/button/button.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var DEBOUNCE_TIMEOUT_IN_SECONDS = 1
*
* @class
* @param {HTMLElement} $module - The element this component controls
* @param {object} config - Button config
* @param {object} [config] - Button config
* @param {boolean} [config.preventDoubleClick=false] - Whether the button should prevent double clicks
*/
function Button ($module, config) {
Expand Down
2 changes: 1 addition & 1 deletion src/govuk/components/character-count/character-count.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ var TRANSLATIONS_DEFAULT = {
*
* @class
* @param {HTMLElement} $module - The element this component controls
* @param {object} config - Character count config
* @param {object} [config] - Character count config
* @param {number} config.maxlength - If `maxwords` is set, this is not required.
* The maximum number of characters. If `maxwords` is provided, it will be ignored.
* @param {number} config.maxwords - If `maxlength` is set, this is not required.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,9 @@ describe('CharacterCount', () => {

const component = new CharacterCount($div, {
i18n: {
charactersUnderLimitOne: 'Different custom text. Count: %{count}'
charactersUnderLimit: {
one: 'Different custom text. Count: %{count}'
}
}
})
expect(component.formatCountMessage(1, 'characters')).toEqual('Custom text. Count: 1')
Expand Down
2 changes: 1 addition & 1 deletion src/govuk/components/error-summary/error-summary.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { normaliseDataset } from '../../common/normalise-dataset.mjs'
*
* @class
* @param {HTMLElement} $module - The element this component controls
* @param {object} config - Error summary config
* @param {object} [config] - Error summary config
* @param {boolean} [config.disableAutoFocus=false] - Whether to disable the component taking focus on initialisation
*/
function ErrorSummary ($module, config) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import { normaliseDataset } from '../../common/normalise-dataset.mjs'
*
* @class
* @param {HTMLElement} $module - HTML element to use for notification banner
* @param {object} config - Error summary config
* @param {object} [config] - Error summary config
* @param {boolean} [config.disableAutoFocus=false] - Whether to disable the component taking focus on initialisation
*/
function NotificationBanner ($module, config) {
Expand Down
2 changes: 1 addition & 1 deletion src/govuk/i18n.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* @class
* @private
* @param {object} translations - Key-value pairs of the translation strings to use.
* @param {object} config - Configuration options for the function.
* @param {object} [config] - Configuration options for the function.
* @param {string} config.locale - An overriding locale for the PluralRules functionality.
*/
export function I18n (translations, config) {
Expand Down

0 comments on commit 5529e24

Please sign in to comment.