Skip to content

Commit

Permalink
style: fix eslint max-len issue
Browse files Browse the repository at this point in the history
- disable max-len for regexes
  • Loading branch information
Sarhan authored and tux-tn committed Apr 24, 2022
1 parent 2dbbaa0 commit a22e76c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib/isCurrency.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import assertString from './util/assertString';

function currencyRegex(options) {
let decimal_digits = `\\d{${options.digits_after_decimal[0]}}`;
options.digits_after_decimal.forEach((digit, index) => { if (index !== 0) decimal_digits = `${decimal_digits}|\\d{${digit}}`; });
options.digits_after_decimal.forEach((digit, index) => {
if (index !== 0) decimal_digits = `${decimal_digits}|\\d{${digit}}`;
});

const symbol =
`(${options.symbol.replace(/\W/, m => `\\${m}`)})${(options.require_symbol ? '' : '?')}`,
Expand Down
1 change: 1 addition & 0 deletions src/lib/isIP.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable max-len */
import assertString from './util/assertString';
/**
11.3. Examples
Expand Down
1 change: 1 addition & 0 deletions src/lib/isRFC3339.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ const timeSecFrac = /(\.[0-9]+)?/;
const timeNumOffset = new RegExp(`[-+]${timeHour.source}:${timeMinute.source}`);
const timeOffset = new RegExp(`([zZ]|${timeNumOffset.source})`);

// eslint-disable-next-line max-len
const partialTime = new RegExp(`${timeHour.source}:${timeMinute.source}:${timeSecond.source}${timeSecFrac.source}`);

const fullDate = new RegExp(`${dateFullYear.source}-${dateMonth.source}-${dateMDay.source}`);
Expand Down

0 comments on commit a22e76c

Please sign in to comment.