Skip to content

Commit f6a283e

Browse files
authored
Merge pull request #702 from izaera/lint-senna
style(senna): fix linting errors
2 parents ad7396b + 2497480 commit f6a283e

File tree

19 files changed

+305
-275
lines changed

19 files changed

+305
-275
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/**
2+
* SPDX-FileCopyrightText: © 2021 Liferay, Inc. <https://liferay.com>
3+
* SPDX-License-Identifier: BSD-3-Clause
4+
*/
5+
6+
module.exports = {
7+
globals: {
8+
senna: true,
9+
},
10+
rules: {
11+
'no-console': 'off',
12+
},
13+
};

maintenance/projects/senna/examples/form/server.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@ var upload = multer();
1414

1515
app.use(express.static('../../'));
1616

17-
app.post('/post', upload.array(), (req, res, next) => {
17+
app.post('/post', upload.array(), (req, res, _next) => {
1818
var content = '<div id="result1">';
1919
content += JSON.stringify(req.body, 5);
2020
content += '</div>';
2121
res.end(content);
2222
});
2323

24-
app.post('/post-get', upload.array(), (req, res, next) => {
24+
app.post('/post-get', upload.array(), (_req, res, _next) => {
2525
res.redirect('/examples/form/redirect.html');
2626
});
2727

maintenance/projects/senna/examples/ga/tracker.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
55

6+
/* global ga */
7+
68
// https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications
79

810
document.addEventListener('DOMContentLoaded', () => {

maintenance/projects/senna/examples/gallery/js/dynamic.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ document.addEventListener('DOMContentLoaded', () => {
5656
return getContent('06', '07', '08');
5757
case '/examples/gallery/img/08.jpg':
5858
return getContent('07', '08', '01');
59+
default:
60+
return undefined;
5961
}
6062
}
6163
};

maintenance/projects/senna/src/app/App.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
55

6+
/* eslint-disable no-console */
7+
68
'use strict';
79

810
import {array, async, isDefAndNotNull, isString, object} from 'metal';
@@ -1272,7 +1274,11 @@ class App extends EventEmitter {
12721274

12731275
return nextScreen
12741276
.load(path)
1275-
.then(() => (this.screens[path] = nextScreen))
1277+
.then(() => {
1278+
this.screens[path] = nextScreen;
1279+
1280+
return this.screens[path];
1281+
})
12761282
.catch((reason) => {
12771283
this.handleNavigateError_(path, nextScreen, reason);
12781284
throw reason;

maintenance/projects/senna/src/app/AppDataAttributeHandler.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
55

6+
/* eslint-disable no-console */
7+
68
'use strict';
79

810
import {Disposable, getUid, isDefAndNotNull, isElement, object} from 'metal';

maintenance/projects/senna/src/screen/HtmlScreen.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ class HtmlScreen extends RequestScreen {
117117
*/
118118
copyNodeAttributesFromContent_(content, node) {
119119
content = content.replace(/[<]\s*html/gi, '<senna');
120-
content = content.replace(/\/html\s*\>/gi, '/senna>');
120+
content = content.replace(/\/html\s*>/gi, '/senna>');
121121
let placeholder;
122122
if (UA.isIe) {
123123
const tempNode = globals.document

maintenance/projects/senna/src/screen/RequestScreen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ class RequestScreen extends Screen {
274274
reason.requestError = true;
275275
reason.requestPrematureTermination = true;
276276
break;
277+
default:
278+
break;
277279
}
278280
throw reason;
279281
});

maintenance/projects/senna/src/screen/Screen.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
55

6+
/* eslint-disable no-console */
7+
68
'use strict';
79

810
import {getUid} from 'metal';

maintenance/projects/senna/test/.eslintrc.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
* SPDX-License-Identifier: BSD-3-Clause
44
*/
55

6-
const path = require('path');
7-
86
module.exports = {
97
env: {
108
mocha: true,
@@ -13,4 +11,7 @@ module.exports = {
1311
assert: true,
1412
sinon: true,
1513
},
14+
rules: {
15+
'no-console': 'off',
16+
},
1617
};

0 commit comments

Comments
 (0)