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

Enhance the padding-line lint rules #1146

Merged
merged 4 commits into from
Jun 28, 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
10 changes: 7 additions & 3 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,16 @@ module.exports = {
'@stylistic/js/padding-line-between-statements': [
'error',
{ blankLine: 'always', prev: '*', next: 'block' },
{ blankLine: 'always', prev: '*', next: 'expression' },
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: 'block', next: '*' },
{ blankLine: 'always', prev: 'block', next: 'function' },
{ blankLine: 'always', prev: 'expression', next: '*' },
{ blankLine: 'always', prev: 'function', next: '*' }
{ blankLine: 'always', prev: 'function', next: '*' },
// blank lines after every sequence of variable declarations
{ blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
// blank lines after all directive prologues e.g. 'use strict'
{ blankLine: 'always', prev: 'directive', next: '*' },
{ blankLine: 'any', prev: 'directive', next: 'directive' }
],
'arrow-body-style': ['error', 'always'],
'import/extensions': ['error', 'always'],
Expand Down
1 change: 1 addition & 0 deletions app/controllers/root.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
function index (_request, _h) {
return { status: 'alive' }
}

module.exports = {
index
}
1 change: 1 addition & 0 deletions app/presenters/base.presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ function titleCase (value) {

words.forEach((word) => {
const titleCasedWord = word.charAt(0).toUpperCase() + word.slice(1)

titleCasedWords.push(titleCasedWord)
})

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ function go (billRun, filterIssues, filterLicenceHolderNumber, filterLicenceStat
const issues = filterIssues ? _prepareIssues(filterIssues) : filterIssues

const filter = { issues, licenceHolderNumber: filterLicenceHolderNumber, licenceStatus: filterLicenceStatus }

// this opens the filter on the page if any filter data has been received so the user can see the applied filters
filter.openFilter = (filterIssues || filterLicenceHolderNumber || filterLicenceStatus) !== undefined

Expand Down
2 changes: 2 additions & 0 deletions app/presenters/licences/set-up.presenter.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,12 @@ function _endsSixYearsAgo (endDate) {
const timeStamp = { hour: 23, minutes: 59, seconds: 59, ms: 999 }

const yesterday = new Date()

yesterday.setDate(yesterday.getDate() - 1)
yesterday.setHours(timeStamp.hour, timeStamp.minutes, timeStamp.seconds, timeStamp.ms)

const sixYearsFromYesterday = new Date(yesterday.getTime())

sixYearsFromYesterday.setFullYear(yesterday.getFullYear() - sixYears)

return endDate.date < sixYearsFromYesterday
Expand Down
Loading