cityssm / general-licence-manager

Require template literals instead of string concatenation JS-0246
Anti-pattern
Minor
a month ago3 months old
Unexpected string concatenation
114  const licenceNumberIndex = Number.parseInt(licenceNumber.split('-')[1]) + 1
115
116  return (
117    currentYear.toString() +118    '-' +119    licenceNumberIndex.toString().padStart(digits, '0')120  )
121}
122
Unexpected string concatenation
108    .get(licenceNumberLength) as string
109
110  if (!licenceNumber) {
111    return currentYear.toString() + '-' + '1'.padStart(digits, '0')112  }
113
114  const licenceNumberIndex = Number.parseInt(licenceNumber.split('-')[1]) + 1
Unexpected string concatenation
 77    ) + 1
 78
 79  return (
 80    categorySlug + '-' + licenceNumberIndex.toString().padStart(digits, '0') 81  )
 82}
 83
Unexpected string concatenation
 67        .get(licenceNumberLength) as string)
 68
 69  if (!licenceNumber) {
 70    return categorySlug + '-' + '1'.padStart(digits, '0') 71  }
 72
 73  const licenceNumberIndex =
Unexpected string concatenation
 42  const licenceNumberLength = categorySlug.length + 1 + digits
 43
 44  database.function('userFn_matchesFormat', (licenceNumber: string): 0 | 1 => {
 45    return licenceNumber.startsWith(categorySlug + '-') ? 1 : 0 46  })
 47
 48  database.function('userFn_digits', (licenceNumber: string): string => {