Skip to content

Commit

Permalink
Fix remaining errors
Browse files Browse the repository at this point in the history
  • Loading branch information
DerekNonGeneric authored and sebastianbenz committed Jan 28, 2020
1 parent 1ad5d78 commit c482762
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@
],
"rules": {
"max-len": [2, 100, {
"ignoreComments": true,
"ignoreComments": true,
"ignoreRegExpLiterals": true,
"ignoreUrls": true,
"tabWidth": 2
}],
Expand Down
3 changes: 2 additions & 1 deletion examples/source/interactivity-dynamic-content/Poll/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ examples.use(cookieParser());

// eslint-disable-next-line max-len
const ALREADY_VOTED_MESSAGE =
'You have already answered this poll. If you want to run this sample again, use an incognito window.';
'You have already answered this poll. If you want to run this sample again,' +
'use an incognito window.';
const THANKS_MESSAGE = 'Thanks for answering the poll!';
const POLL_COOKIE_NAME = 'POLL_TAKEN';
const EXPIRATION_DATE = 365 * 24 * 60 * 60 * 1000; // 365 days in ms
Expand Down
5 changes: 2 additions & 3 deletions platform/lib/platform.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,11 @@ class Platform {
);
this.server.use(await subdomain.map(config.hosts.go, routers.go));
this.server.use(await subdomain.map(config.hosts.log, routers.log));
// eslint-disable-next-line new-cap
this.server.use(
await subdomain.map(
config.hosts.preview,
express
.Router()
.Router() // eslint-disable-line new-cap
.use([
routers.example.api,
routers.example.static,
Expand Down Expand Up @@ -179,8 +178,8 @@ class Platform {

_configureErrorHandlers() {
// handle errors
// eslint-disable-next-line no-unused-vars
this.server.use((err, req, res, next) => {
// eslint-disable-line no-unused-vars
if (err) {
console.error('[ERROR]', err);
res.status(500).sendFile('500.html', {root: pagePath()});
Expand Down
2 changes: 1 addition & 1 deletion platform/lib/routers/notFound.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
const {pagePath} = require('@lib/utils/project');
const {setMaxAge} = require('../utils/cacheHelpers.js');

// eslint-disable-next-line no-unused-vars
module.exports = (req, res, next) => {
// eslint-disable-line no-unused-vars
setMaxAge(res, 60 * 10); // ten minutes
if (req.headers.accept && req.headers.accept.includes('text/html')) {
res.status(404).sendFile('404.html', {root: pagePath()});
Expand Down

0 comments on commit c482762

Please sign in to comment.