Skip to content

Commit

Permalink
Merge pull request #152 from DEFRA/BAU-remove-warnings
Browse files Browse the repository at this point in the history
BAU: remove eslint-warnings
  • Loading branch information
hughfdjackson authored Jan 24, 2025
2 parents a43d816 + 3cfce41 commit 57a2110
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 12 deletions.
23 changes: 12 additions & 11 deletions src/server/common/model/answer/answer-model.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/**
* @import {AnswerErrors, AnswerValidationResult} from './validation.js'
* @import {Page} from '../../model/page/page-model.js'
*/

import { NotImplementedError } from '../../helpers/not-implemented-error.js'
/** @import {AnswerErrors, AnswerValidationResult} from './validation.js' */

/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable jsdoc/require-returns-check */

/**
* @typedef {{ href: string, text: string }} ViewErrorMessage
Expand Down Expand Up @@ -40,7 +39,6 @@ export class AnswerModel {
* @param {Payload} _data
* @returns {Payload}
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
_extractFields(_data) {
throw new NotImplementedError()
}
Expand All @@ -63,7 +61,9 @@ export class AnswerModel {
}))
}

/** @returns {string} */
/**
* @returns {string}
*/
get html() {
throw new NotImplementedError()
}
Expand All @@ -72,20 +72,21 @@ export class AnswerModel {
* @param {unknown} _data
* @returns {unknown}
*/
// eslint-disable-next-line @typescript-eslint/no-unused-vars
static fromState(_data) {
throw new NotImplementedError()
}
}

/* eslint-disable jsdoc/valid-types */
/**
* @template Payload
* @typedef {{
* new (data: Payload): AnswerModel<Payload>,
* fromState(data: any): AnswerModel<Payload>
* errorMessages(errors: AnswerErrors): ViewErrorMessage[]
* new(data: Payload): AnswerModel<Payload>;
* fromState(data: any): AnswerModel<Payload>;
* errorMessages(errors: AnswerErrors): ViewErrorMessage[];
* }} AnswerModelClass
*/
/* eslint-enable jsdoc/valid-types */

/**
* @typedef {{[key:string]: string | undefined}} RawPayload
Expand Down
2 changes: 2 additions & 0 deletions src/server/common/model/answer/radio-button/radio-button.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { AnswerModel } from '../answer-model.js'
import { validateAnswerAgainstSchema } from '../validation.js'
import { NotImplementedError } from '../../../helpers/not-implemented-error.js'

/* eslint-disable jsdoc/require-returns-check */

/**
* @param {RadioButtonConfig} config
* @returns {Joi.Schema}
Expand Down
1 change: 1 addition & 0 deletions src/server/common/model/page/page-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ export class Page {
return {}
}

// eslint-disable-next-line jsdoc/require-returns-check
/**
* @param {AnswerModel} [_answer]
* @returns {Page }
Expand Down
1 change: 1 addition & 0 deletions src/server/common/model/page/question-page-model.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ export class QuestionPage extends Page {
return this.question
}

// eslint-disable-next-line jsdoc/require-returns-check
/**
* @param {AnswerModel} _answer
* @returns {Page | QuestionPage}
Expand Down
2 changes: 1 addition & 1 deletion src/server/common/model/section/origin/origin.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { OnOffFarmPage } from '~/src/server/origin/on-off-farm/index.js'

const validCphNumber = '12/345/6789'
const validOriginType = 'afu'
/** @type OnOffFarmData */
/** @type {OnOffFarmData} */
const validOnOffFarm = 'off'
const validAddress = {
addressLine1: 'Starfleet Headquarters',
Expand Down

0 comments on commit 57a2110

Please sign in to comment.