mirror of
https://github.com/danog/inline-critical.git
synced 2024-11-30 04:29:07 +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 => {
|
res.ignore = (val || []).map(ignore => {
|
||||||
// Check regex
|
// Check regex
|
||||||
const match = ignore.match(/^\/(.*)\/([igmy]+)?$/);
|
const {groups} = /^\/(?<expression>.*)\/(?<flags>[igmy]+)?$/.exec(ignore) || {};
|
||||||
|
const {expression, flags} = groups || {};
|
||||||
|
|
||||||
if (match) {
|
if (groups) {
|
||||||
return new RegExp(escapeRegExp(match[1]), match[2]);
|
return new RegExp(escapeRegExp(expression), flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return ignore;
|
return ignore;
|
||||||
|
@ -106,10 +106,10 @@ class Dom {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (this.noscriptPosition === 'head') {
|
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) {
|
createStyleNode(css, referenceIndent = this.headIndent.indent) {
|
||||||
|
Loading…
Reference in New Issue
Block a user