Skip to content

Commit

Permalink
Enable prettier as part of eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
Munter committed Jul 23, 2019
1 parent 3cc5f3e commit 3edb74f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
5 changes: 3 additions & 2 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = {
extends: ['standard', 'prettier', 'prettier/standard'],
plugins: ['import', 'mocha'],
plugins: ['import', 'mocha', 'prettier'],
env: {
mocha: true
},
Expand All @@ -18,7 +18,8 @@ const config = {
],
'mocha/no-exclusive-tests': 'error',
'mocha/no-nested-tests': 'error',
'mocha/no-identical-title': 'error'
'mocha/no-identical-title': 'error',
'prettier/prettier': 'error'
}
};

Expand Down
36 changes: 12 additions & 24 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,20 +142,16 @@ async function hyperlink(
}

const socket = (isTls ? tls : net)
.connect(
port,
hostname,
() => {
reportTest({
...connectionReport,
ok: true
});
.connect(port, hostname, () => {
reportTest({
...connectionReport,
ok: true
});

socket.destroy();
socket.destroy();

callback();
}
)
callback();
})
.on('error', error => {
const message = error.message;

Expand Down Expand Up @@ -316,9 +312,7 @@ async function hyperlink(
} else {
reportTest({
...redirectReport,
expected: `${log[0].statusCode} ${url} --> 200 ${
log[log.length - 1].redirectUri
}`,
expected: `${log[0].statusCode} ${url} --> 200 ${log[log.length - 1].redirectUri}`,
actual,
ok: false
});
Expand Down Expand Up @@ -507,9 +501,7 @@ async function hyperlink(
if (fragment) {
if (fragment === '#') {
const fragmentReport = {
name: `fragment-check ${relation.from.urlOrDescription} --> ${
relation.href
}`,
name: `fragment-check ${relation.from.urlOrDescription} --> ${relation.href}`,
operator: 'fragment-check',
expected:
'Fragment identifiers in links to different documents should not be empty',
Expand Down Expand Up @@ -786,9 +778,7 @@ async function hyperlink(
});

t.push({
name: `Connecting to ${
preconnectAssetsToCheck.length
} hosts (checking <link rel="preconnect" href="...">`
name: `Connecting to ${preconnectAssetsToCheck.length} hosts (checking <link rel="preconnect" href="...">`
});

await new Promise((resolve, reject) =>
Expand Down Expand Up @@ -821,9 +811,7 @@ async function hyperlink(
});

t.push({
name: `Looking up ${
dnsPrefetchAssetsToCheck.length
} host names (checking <link rel="dns-prefetch" href="...">`
name: `Looking up ${dnsPrefetchAssetsToCheck.length} host names (checking <link rel="dns-prefetch" href="...">`
});

await new Promise((resolve, reject) =>
Expand Down

0 comments on commit 3edb74f

Please sign in to comment.