mirror of
https://github.com/danog/inline-critical.git
synced 2024-11-29 20:19:00 +01:00
Fix lint errors
This commit is contained in:
parent
5606d6439d
commit
05ce30aee6
7
cli.js
7
cli.js
@ -104,10 +104,11 @@ cli.flags = Object.entries(cli.flags).reduce((res, [key, val]) => {
|
||||
|
||||
res.ignore = (val || []).map(ignore => {
|
||||
// Check regex
|
||||
const match = ignore.match(/^\/(.*)\/([igmy]+)?$/);
|
||||
const {groups} = /^\/(?<expression>.*)\/(?<flags>[igmy]+)?$/.exec(ignore) || {};
|
||||
const {expression, flags} = groups || {};
|
||||
|
||||
if (match) {
|
||||
return new RegExp(escapeRegExp(match[1]), match[2]);
|
||||
if (groups) {
|
||||
return new RegExp(escapeRegExp(expression), flags);
|
||||
}
|
||||
|
||||
return ignore;
|
||||
|
@ -106,10 +106,10 @@ class Dom {
|
||||
}
|
||||
|
||||
if (this.noscriptPosition === 'head') {
|
||||
return result.replace(/^([\s\t]*)(<\/\s*head>)/gim, `$1$1${this.noscript.join('\n$1$1')}\n$1$2`);
|
||||
return result.replace(/^([\s\t]*)(<\/\s*head>)/gim, `$1$1${this.noscript.join('\n$1$1')}\n$1$2`); // eslint-disable-line prefer-named-capture-group
|
||||
}
|
||||
|
||||
return result.replace(/^([\s\t]*)(<\/\s*body>)/gim, `$1$1${this.noscript.join('\n$1$1')}\n$1$2`);
|
||||
return result.replace(/^([\s\t]*)(<\/\s*body>)/gim, `$1$1${this.noscript.join('\n$1$1')}\n$1$2`); // eslint-disable-line prefer-named-capture-group
|
||||
}
|
||||
|
||||
createStyleNode(css, referenceIndent = this.headIndent.indent) {
|
||||
|
Loading…
Reference in New Issue
Block a user