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

Override "Missing JSDoc comment" rule for controllers #1292

Merged
merged 3 commits into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@
module.exports = {
extends: 'standard', // Maintain Standard.js rules
ignorePatterns: ['docs/*'],
overrides: [
{
files: ['*.controller.js'],
rules: {
'jsdoc/require-jsdoc': 'off'
}
}
],
parserOptions: {
sourceType: 'script'
},
Expand Down
4 changes: 1 addition & 3 deletions app/controllers/billing-accounts.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ async function changeAddress (request, h) {
return h.response(result).code(201)
}

/**
* Takes an error from a validator and returns a suitable Boom error
*/
// Takes an error from a validator and returns a suitable Boom error
function _formattedValidationError (error) {
return Boom.badRequest(error.details[0].message)
}
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/jobs.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ const notFoundStatusCode = 404
* Triggers export of all relevant tables to CSV and then uploads them to S3
*
* > Has to be called something other than 'export' because export is a reserved word
* @param _request - the hapi request object
* @param h - the hapi response object
*
* @returns {Promise<object>} - A promise that resolves to an HTTP response object with a 204 status code
*/
Expand Down
4 changes: 2 additions & 2 deletions app/lib/base-notifier.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class BaseNotifierLib {
*
* @param {string} message - Message to add to the log (INFO)
* @param {object} [data={}] - An object containing any values to be logged, for example, a bill run ID to be included
* with the log message. Defaults to an empty object
* with the log message. Defaults to an empty object
*/
omg (message, data = {}) {
this._logger.info(this._formatLogPacket(data), message)
Expand Down Expand Up @@ -78,7 +78,7 @@ class BaseNotifierLib {
* @param {object} [data={}] - An object containing any values to be logged and sent in the notification to Errbit,
* for example, a bill run ID. Defaults to an empty object
* @param {Error} [error=null] - An instance of the error to be logged and sent to Errbit. If no error is provided one
* will be created using `message` as the error message
* will be created using `message` as the error message
*/
omfg (message, data = {}, error = null) {
// This deals with anyone calling omfg() with `omfg('It broke', null, error)` which would cause things to break
Expand Down
2 changes: 1 addition & 1 deletion app/lib/legacy-db-snake-case-mappers.lib.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const { camelCase, knexIdentifierMappers, snakeCase } = require('objection/lib/u
* it passes control to the out-of-the-box solution.
*
* @param {object} opt - Object containing options used by
* {@link https://vincit.github.io/objection.js/api/objection/#knexsnakecasemappers|knexsnakecasemappers()}
* {@link https://vincit.github.io/objection.js/api/objection/#knexsnakecasemappers|knexsnakecasemappers()}
*
* @returns object containing Knex postProcessResponse() and wrapIdentifier() hooks
*/
Expand Down
Loading