Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix JSDOC's lint required params and returns #1279

Merged
merged 10 commits into from
Aug 22, 2024
13 changes: 10 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,19 @@ module.exports = {
'arrow-body-style': ['error', 'always'],
'import/extensions': ['error', 'always'],
strict: ['error', 'global'],
'jsdoc/require-jsdoc': ['warn', {
jonathangoulding marked this conversation as resolved.
Show resolved Hide resolved
publicOnly: true
}],
'jsdoc/require-description': 'warn',
'jsdoc/require-param': 'warn',
'jsdoc/require-returns': 'warn',
'jsdoc/require-param': ['warn', {
exemptedBy: ['private']
}],
'jsdoc/require-returns': ['warn', {
publicOnly: true
}],
'jsdoc/check-tag-names': 'warn',
'jsdoc/check-alignment': 'warn',
'jsdoc/newline-after-description': 'off', // does not work with 'use strict'
'jsdoc/newline-after-description': 'off', // does not work with ' use strict'
'jsdoc/check-indentation': 'warn',
'jsdoc/lines-before-block': 'warn',
'jsdoc/check-types': 'warn',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function go (payload, maxNumberOfDecimals, validationType) {
}

/**
* @private
* Due to limitations in Joi validation for decimals, achieving validation for numbers with fewer than 2 or 15 decimal
* places requires a custom approach. First, convert the number into a string. Then split the string into an array using
* the decimal point (`.`) as the delimiter. This results in either one item in the array (if no decimal is present) or
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/address.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/bill-licence.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/bill-run-charge-version-year.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/bill-run-volume.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/bill-run.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/bill.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/billing-account-address.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/billing-account.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/charge-category.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/charge-element.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/charge-reference.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/charge-version-note.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/charge-version.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/company-address.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/company-contact.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/company.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/contact.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/event.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const timestamp = timestampForPostgres()
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/gauging-station.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const timestamp = timestampForPostgres()
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-agreement.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-document-header.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-document-role.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-document.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-entity-role.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-entity.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-gauging-station.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-role.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-supplementary-year.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here in the database
*
* @returns {object} - Returns data from the query
*/
function defaults (data = {}) {
const defaults = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const timestamp = timestampForPostgres()
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-version-purpose.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const timestamp = timestampForPostgres()
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence-version.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const timestamp = timestampForPostgres()
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/licence.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/mod-log.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const regionCode = randomInteger(1, 9)
Expand Down
3 changes: 3 additions & 0 deletions test/support/helpers/permit-licence.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ async function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const licenceRef = data.licenceRef ? data.licenceRef : generateLicenceRef()
Expand All @@ -55,6 +57,7 @@ function defaults (data = {}) {
}

/**
* @private
* In real life, when a licence is imported from NALD into WRLS a number of records get created. A lot of it is
* duplication, but not everything from NALD is put into tables.
*
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/return-log.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const licenceRef = data.licenceRef ? data.licenceRef : generateLicenceRef()
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/return-requirement-point.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const naldPointId = data.naldPointId ? data.naldPointId : generateNaldPointId()
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/return-requirement-purpose.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const purpose = PurposeHelper.select()
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/return-requirement.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const legacyId = data.legacyId ? data.legacyId : randomInteger(100, 99999)
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/return-submission-line.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
2 changes: 2 additions & 0 deletions test/support/helpers/return-submission.helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ function add (data = {}) {
* for use in tests to avoid having to duplicate values.
*
* @param {object} [data] - Any data you want to use instead of the defaults used here or in the database
*
* @returns {object} - Returns the set defaults with the override data spread
*/
function defaults (data = {}) {
const defaults = {
Expand Down
Loading
Loading