Skip to content

Commit 8c8b9f4

Browse files
authored
Merge pull request #2 from lume/fix-lint
fix: fix lint errors
2 parents 9e3c5e4 + 8f2010d commit 8c8b9f4

File tree

10 files changed

+32
-32
lines changed

10 files changed

+32
-32
lines changed

packages/docsify-server-renderer/index.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,32 @@
11
import { readFileSync } from 'fs';
22
import { resolve, basename } from 'path';
3+
import resolvePathname from 'resolve-pathname';
4+
import fetch from 'node-fetch';
5+
import debug from 'debug';
6+
import DOMPurify from 'dompurify';
37
import { AbstractHistory } from '../../src/core/router/history/abstract';
48
import { Compiler } from '../../src/core/render/compiler';
59
import { isAbsolutePath } from '../../src/core/router/util';
610
import * as tpl from '../../src/core/render/tpl';
711
import { prerenderEmbed } from '../../src/core/render/embed';
8-
import resolvePathname from 'resolve-pathname';
9-
import fetch from 'node-fetch';
10-
import debug from 'debug';
11-
import DOMPurify from 'dompurify';
1212

1313
function cwd(...args) {
1414
return resolve(process.cwd(), ...args);
1515
}
1616

1717
// Borrowed from https://j11y.io/snippets/getting-a-fully-qualified-url.
18-
function qualifyURL(url){
19-
var img = document.createElement('img');
20-
img.src = url; // set string url
21-
url = img.src; // get qualified url
22-
img.src = ''; // prevent the server request
23-
return url;
18+
function qualifyURL(url) {
19+
const img = document.createElement('img');
20+
img.src = url; // set string url
21+
url = img.src; // get qualified url
22+
img.src = ''; // prevent the server request
23+
return url;
2424
}
2525

2626
function isExternal(url) {
27-
url = qualifyURL(url)
28-
url = new URL(url)
29-
return url.origin !== location.origin
27+
url = qualifyURL(url);
28+
url = new URL(url);
29+
return url.origin !== location.origin;
3030
}
3131

3232
function mainTpl(config) {

src/core/event/scroll.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1+
import Tweezer from 'tweezer.js';
12
import { isMobile } from '../util/env';
23
import * as dom from '../util/dom';
34
import config from '../config';
4-
import Tweezer from 'tweezer.js';
55

66
const nav = {};
77
let hoverOver = false;

src/core/fetch/index.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,18 @@ function loadNested(path, qs, file, next, vm, first) {
2121
}
2222

2323
// Borrowed from https://j11y.io/snippets/getting-a-fully-qualified-url.
24-
function qualifyURL(url){
25-
var img = document.createElement('img');
26-
img.src = url; // set string url
27-
url = img.src; // get qualified url
28-
img.src = ''; // prevent the server request
29-
return url;
24+
function qualifyURL(url) {
25+
const img = document.createElement('img');
26+
img.src = url; // set string url
27+
url = img.src; // get qualified url
28+
img.src = ''; // prevent the server request
29+
return url;
3030
}
3131

3232
function isExternal(url) {
33-
url = qualifyURL(url)
34-
url = new URL(url)
35-
return url.origin !== location.origin
33+
url = qualifyURL(url);
34+
url = new URL(url);
35+
return url.origin !== location.origin;
3636
}
3737

3838
export function fetchMixin(proto) {

src/core/global-api.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1+
import prism from 'prismjs';
2+
import marked from 'marked';
13
import * as util from './util';
24
import * as dom from './util/dom';
35
import { Compiler } from './render/compiler';
46
import { slugify } from './render/slugify';
57
import { get } from './fetch/ajax';
6-
import prism from 'prismjs';
7-
import marked from 'marked';
88

99
export default function() {
1010
window.Docsify = {

src/core/render/compiler.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import marked from 'marked';
12
import { isAbsolutePath, getPath, getParentPath } from '../router/util';
23
import { isFn, merge, cached, isPrimitive } from '../util/core';
34
import { tree as treeTpl } from './tpl';
@@ -11,7 +12,6 @@ import { paragraphCompiler } from './compiler/paragraph';
1112
import { taskListCompiler } from './compiler/taskList';
1213
import { taskListItemCompiler } from './compiler/taskListItem';
1314
import { linkCompiler } from './compiler/link';
14-
import marked from 'marked';
1515

1616
const cachedLinks = {};
1717

src/core/render/embed.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import stripIndent from 'strip-indent';
12
import { get } from '../fetch/ajax';
23
import { merge } from '../util/core';
3-
import stripIndent from 'strip-indent';
44

55
const cached = {};
66

src/core/render/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* eslint-disable no-unused-vars */
2+
import DOMPurify from 'dompurify';
3+
import tinydate from 'tinydate';
24
import * as dom from '../util/dom';
35
import cssVars from '../util/polyfill/css-vars';
46
import { callHook } from '../init/lifecycle';
@@ -10,8 +12,6 @@ import { scrollActiveSidebar } from '../event/scroll';
1012
import { Compiler } from './compiler';
1113
import * as tpl from './tpl';
1214
import { prerenderEmbed } from './embed';
13-
import DOMPurify from 'dompurify';
14-
import tinydate from 'tinydate';
1515

1616
function executeScript() {
1717
const script = dom

test/unit/base.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
require = require('esm')(
33
module /* , options */
44
); /* eslint-disable-line no-global-assign */
5-
const { History } = require('../../src/core/router/history/base');
65
const { expect } = require('chai');
6+
const { History } = require('../../src/core/router/history/base');
77

88
class MockHistory extends History {
99
parse(path) {

test/unit/render.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
const { init, expectSameDom } = require('../_helper');
21
const { expect } = require('chai');
2+
const { init, expectSameDom } = require('../_helper');
33

44
describe('render', function() {
55
it('important content (tips)', async function() {

test/unit/util.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
require = require('esm')(
33
module /* , options */
44
); /* eslint-disable-line no-global-assign */
5-
const { resolvePath } = require('../../src/core/router/util');
65
const { expect } = require('chai');
6+
const { resolvePath } = require('../../src/core/router/util');
77

88
describe('router/util', function() {
99
it('resolvePath', async function() {

0 commit comments

Comments
 (0)