Browse Source

Task/resolve @typescript-eslint/prefer-regexp-exec ESLint rule (#5885)

* fix(lint): remove @typescript-eslint/prefer-regexp-exec override

* fix(lint): resolve eslint errors
pull/5860/merge
Kenrick Tandrian 23 hours ago
committed by GitHub
parent
commit
b705b8f07b
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      apps/api/src/services/i18n/i18n.service.ts
  2. 3
      eslint.config.cjs
  3. 2
      libs/common/src/lib/helper.ts

2
apps/api/src/services/i18n/i18n.service.ts

@ -65,7 +65,7 @@ export class I18nService {
}
private parseLanguageCode(aFileName: string) {
const match = aFileName.match(/\.([a-zA-Z]+)\.xlf$/);
const match = /\.([a-zA-Z]+)\.xlf$/.exec(aFileName);
return match ? match[1] : DEFAULT_LANGUAGE_CODE;
}

3
eslint.config.cjs

@ -189,8 +189,7 @@ module.exports = [
// The following rules are part of @typescript-eslint/stylistic-type-checked
// and can be remove once solved
'@typescript-eslint/prefer-nullish-coalescing': 'warn', // TODO: Requires strictNullChecks: true
'@typescript-eslint/prefer-regexp-exec': 'warn'
'@typescript-eslint/prefer-nullish-coalescing': 'warn' // TODO: Requires strictNullChecks: true
}
}))
];

2
libs/common/src/lib/helper.ts

@ -375,7 +375,7 @@ export function parseDate(date: string): Date {
// Transform 'yyyyMMdd' format to supported format by parse function
if (date?.length === 8) {
const match = date.match(/^(\d{4})(\d{2})(\d{2})$/);
const match = /^(\d{4})(\d{2})(\d{2})$/.exec(date);
if (match) {
const [, year, month, day] = match;

Loading…
Cancel
Save