Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style(senna): fix linting errors #702

Merged
merged 5 commits into from
Oct 20, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions maintenance/projects/senna/examples/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/**
* SPDX-FileCopyrightText: © 2021 Liferay, Inc. <https://liferay.com>
* SPDX-License-Identifier: BSD-3-Clause
*/

module.exports = {
globals: {
senna: true,
},
rules: {
'no-console': 'off',
},
};
4 changes: 2 additions & 2 deletions maintenance/projects/senna/examples/form/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@ var upload = multer();

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

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

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

Expand Down
2 changes: 2 additions & 0 deletions maintenance/projects/senna/examples/ga/tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

/* global ga */

// https://developers.google.com/analytics/devguides/collection/analyticsjs/single-page-applications

document.addEventListener('DOMContentLoaded', () => {
Expand Down
2 changes: 2 additions & 0 deletions maintenance/projects/senna/examples/gallery/js/dynamic.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ document.addEventListener('DOMContentLoaded', () => {
return getContent('06', '07', '08');
case '/examples/gallery/img/08.jpg':
return getContent('07', '08', '01');
default:
return undefined;
}
}
};
Expand Down
8 changes: 7 additions & 1 deletion maintenance/projects/senna/src/app/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

/* eslint-disable no-console */

'use strict';

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

return nextScreen
.load(path)
.then(() => (this.screens[path] = nextScreen))
.then(() => {
this.screens[path] = nextScreen;

return this.screens[path];
})
.catch((reason) => {
this.handleNavigateError_(path, nextScreen, reason);
throw reason;
Expand Down
2 changes: 2 additions & 0 deletions maintenance/projects/senna/src/app/AppDataAttributeHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

/* eslint-disable no-console */

'use strict';

import {Disposable, getUid, isDefAndNotNull, isElement, object} from 'metal';
Expand Down
2 changes: 1 addition & 1 deletion maintenance/projects/senna/src/screen/HtmlScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ class HtmlScreen extends RequestScreen {
*/
copyNodeAttributesFromContent_(content, node) {
content = content.replace(/[<]\s*html/gi, '<senna');
content = content.replace(/\/html\s*\>/gi, '/senna>');
content = content.replace(/\/html\s*>/gi, '/senna>');
let placeholder;
if (UA.isIe) {
const tempNode = globals.document
Expand Down
2 changes: 2 additions & 0 deletions maintenance/projects/senna/src/screen/RequestScreen.js
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,8 @@ class RequestScreen extends Screen {
reason.requestError = true;
reason.requestPrematureTermination = true;
break;
default:
break;
}
throw reason;
});
Expand Down
2 changes: 2 additions & 0 deletions maintenance/projects/senna/src/screen/Screen.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

/* eslint-disable no-console */

'use strict';

import {getUid} from 'metal';
Expand Down
5 changes: 3 additions & 2 deletions maintenance/projects/senna/test/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
* SPDX-License-Identifier: BSD-3-Clause
*/

const path = require('path');

module.exports = {
env: {
mocha: true,
Expand All @@ -13,4 +11,7 @@ module.exports = {
assert: true,
sinon: true,
},
rules: {
'no-console': 'off',
},
};
Loading