Skip to content

Commit d7854cd

Browse files
committed
Make linter happy
Signed-off-by: Yukai Huang <yukaihuangtw@gmail.com>
1 parent ad5be66 commit d7854cd

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

public/js/lib/editor/markdown-lint/index.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1+
/* global CodeMirror */
12
import markdownlint from 'markdownlint'
23

34
// load CM lint plugin explicitly
4-
import 'script-loader!@hackmd/codemirror/addon/lint/lint'
5+
import '@hackmd/codemirror/addon/lint/lint'
56
import './lint.css'
67

7-
(function(mod) {
8-
mod(CodeMirror);
9-
})(function(CodeMirror) {
10-
function validator(text) {
8+
(function (mod) {
9+
mod(CodeMirror)
10+
})(function (CodeMirror) {
11+
function validator (text) {
1112
return lint(text).map(error => {
1213
const {
1314
ruleNames,
@@ -17,7 +18,7 @@ import './lint.css'
1718
} = error
1819
const lineNumber = ln - 1
1920

20-
let start = 0, end = -1
21+
let start = 0; let end = -1
2122
if (errorRange) {
2223
[start, end] = errorRange.map(r => r - 1)
2324
}

webpack.common.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -464,6 +464,11 @@ module.exports = {
464464
loader: 'url-loader',
465465
options: { limit: '10000', mimetype: 'image/gif' }
466466
}]
467+
}, {
468+
test: /@hackmd\/codemirror\/addon\/lint\/lint/,
469+
use: [{
470+
loader: 'script-loader'
471+
}]
467472
}]
468473
},
469474
node: {

0 commit comments

Comments
 (0)