Skip to content

Commit 8320f5e

Browse files
atian25JacksonTian
authored andcommitted
fix: eslint
1 parent 5521edb commit 8320f5e

File tree

7 files changed

+9
-22
lines changed

7 files changed

+9
-22
lines changed

app/controller/rss.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ const Controller = require('egg').Controller;
55
const convert = require('data2xml')();
66

77
function utf8ForXml(inputStr) {
8+
// FIXME: no-control-regex
9+
/* eslint-disable no-control-regex */
810
return inputStr.replace(/[^\x09\x0A\x0D\x20-\xFF\x85\xA0-\uD7FF\uE000-\uFDCF\uFDE0-\uFFFD]/gm, '');
911
}
1012

app/controller/topic.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
'use strict';
22

33
const Controller = require('egg').Controller;
4+
const _ = require('lodash');
45

56
class TopicController extends Controller {
67

app/extend/helper.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,5 @@
1-
/* !
2-
* nodeclub - common/render_helpers.js
3-
* Copyright(c) 2013 fengmk2 <[email protected]>
4-
* MIT Licensed
5-
*/
6-
71
'use strict';
82

9-
/**
10-
* Module dependencies.
11-
*/
12-
133
const MarkdownIt = require('markdown-it');
144
const validator = require('validator');
155
const jsxss = require('xss');
@@ -54,7 +44,7 @@ md.renderer.rules.code_block = (tokens, idx /* , options */) => {
5444
};
5545

5646
const myxss = new jsxss.FilterXSS({
57-
onIgnoreTagAttr(tag, name, value, isWhiteAttr) {
47+
onIgnoreTagAttr(tag, name, value) {
5848
// 让 prettyprint 可以工作
5949
if (tag === 'pre' && name === 'class') {
6050
return name + '="' + jsxss.escapeAttrValue(value) + '"';

app/router.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,9 @@
44
* @param {Egg.Application} app - egg application
55
*/
66
module.exports = app => {
7-
const { router, controller, config } = app;
7+
const { router, controller } = app;
88

9-
const {
10-
site, sign, user, auth, topic,
11-
reply, rss, search, page } = controller;
9+
const { site, sign, user, topic, rss, search, page } = controller;
1210

1311
// home page
1412
router.get('/', site.index);

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
"egg-view-ejs": "^2.0.0",
1717
"loader": "^2.1.1",
1818
"loader-koa": "^2.0.0",
19+
"lodash": "^4.17.5",
1920
"markdown-it": "^8.4.1",
2021
"uuid": "^3.2.1",
2122
"validator": "^9.4.1",

test/app/controller/site.test.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
'use strict';
22

3-
const { app, assert } = require('egg-mock/bootstrap');
3+
const { app } = require('egg-mock/bootstrap');
44

55
describe('test/app/controller/site.test.js', () => {
6-
// it('should assert', async function () {
7-
// const pkg = require('../../../package.json');
8-
// assert(app.config.keys.startsWith(pkg.name));
9-
// });
10-
116
it('should GET /sitemap.xml', async () => {
127
await app.httpRequest()
138
.get('/sitemap.xml')

test/app/controller/topic.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
'use strict';
22

3-
const { app, assert } = require('egg-mock/bootstrap');
3+
const { app } = require('egg-mock/bootstrap');
44

55
describe('test/app/controller/topic.test.js', () => {
66
it('should GET /topic/:tid ok', async () => {

0 commit comments

Comments
 (0)