Skip to content
This repository was archived by the owner on Nov 22, 2020. It is now read-only.

Commit e9dc493

Browse files
committed
[auto] Lint source code
1 parent 3dea4e6 commit e9dc493

File tree

6 files changed

+24
-28
lines changed

6 files changed

+24
-28
lines changed

Diff for: src/App.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,13 @@ export default {
112112
113113
mounted() {
114114
if (this.darkMode) this.$el.classList.add('dark');
115-
if (!konami) {
115+
if (!konami)
116116
konami = new Konami(() => {
117117
this.konami = true;
118118
this.poop();
119119
this.$el.classList.add('konami');
120120
konami.disable();
121121
});
122-
}
123122
},
124123
};
125124
</script>

Diff for: src/components/docs/Loader.vue

+3-4
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,9 @@ export default {
8989
for (const t of docs.typedefs) docs.links[t.name] = { name: 'docs-typedef', params: { typedef: t.name } };
9090
9191
// Workaround for the single use of inter-source see also linking
92-
if (this.source.id === 'commando') {
92+
if (this.source.id === 'commando')
9393
docs.links.Message = { name: 'docs-class', params: { source: 'main', tag: 'master', class: 'Message' } };
94-
}
94+
9595
9696
docs.global = this.source.global;
9797
docs.source = this.source.source;
@@ -108,11 +108,10 @@ export default {
108108
if (!docs.classes.some(c => c.name === route.params.class)) this.goHome();
109109
} else if (route.name === 'docs-typedef') {
110110
if (!docs.typedefs.some(t => t.name === route.params.typedef)) this.goHome();
111-
} else if (route.name === 'docs-file') {
111+
} else if (route.name === 'docs-file')
112112
if (!docs.custom[route.params.category] || !docs.custom[route.params.category].files[route.params.file]) {
113113
this.goHome();
114114
}
115-
}
116115
}
117116
}).catch(err => {
118117
console.error('Error while loading', startSource, startTag, err);

Diff for: src/components/docs/Sidebar.vue

+1-2
Original file line numberDiff line numberDiff line change
@@ -99,9 +99,8 @@ export default {
9999
100100
$route(to) {
101101
if (this.visible) this.visible = false;
102-
if (!to.query.scrollTo && (window.pageYOffset || document.documentElement.scrollTop) > 300) {
102+
if (!to.query.scrollTo && (window.pageYOffset || document.documentElement.scrollTop) > 300)
103103
window.scrollTo(0, 90);
104-
}
105104
},
106105
},
107106
};

Diff for: src/components/pages/Documentation.vue

+5-6
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ export default {
3838
3939
handleRoute(route) {
4040
// Set the source, or redirect to a default route
41-
if (route.params.source && this.sources[route.params.source]) {
41+
if (route.params.source && this.sources[route.params.source])
4242
this.setSource(route.params.source);
43-
} else {
43+
else {
4444
this.$router.replace({ name: 'docs-file', params: {
4545
source: MainSource.id,
4646
tag: MainSource.defaultTag,
@@ -51,9 +51,9 @@ export default {
5151
}
5252
5353
// Set the tag, or redirect to a default route
54-
if (route.params.tag) {
54+
if (route.params.tag)
5555
this.setTag(route.params.tag);
56-
} else {
56+
else {
5757
this.$router.replace({ name: 'docs-file', params: {
5858
source: this.source.id,
5959
tag: this.source.recentTag || this.source.defaultTag,
@@ -64,14 +64,13 @@ export default {
6464
}
6565
6666
// Redirect to a default route
67-
if (!route.params.file && !route.params.class && !route.params.typedef && route.name !== 'docs-search') {
67+
if (!route.params.file && !route.params.class && !route.params.typedef && route.name !== 'docs-search')
6868
this.$router.replace({ name: 'docs-file', params: {
6969
source: this.source.id,
7070
tag: this.tag,
7171
category: this.source.defaultFile.category,
7272
file: this.source.defaultFile.id,
7373
} });
74-
}
7574
},
7675
7776
toggleDarkMode() {

Diff for: src/data/DocsSource.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -37,20 +37,20 @@ export default class DocsSource {
3737
this.tags = [this.defaultTag];
3838
localStorage[`source-${this.id}`] = JSON.stringify({ branches, tags });
3939

40-
for (const branch of branches) {
40+
for (const branch of branches)
4141
if (branch.name !== this.defaultTag && this.branchFilter(branch.name)) this.tags.push(branch.name);
42-
}
42+
4343

4444
// Build a list of the latest patch versions
4545
const latestPatches = {};
46-
for (const tag of tags) {
46+
for (const tag of tags)
4747
if (semver.valid(tag.name)) {
4848
const majorMinor = `${semver.major(tag.name)}.${semver.minor(tag.name)}`;
4949
const patch = semver.patch(tag.name);
5050
if (patch < latestPatches[majorMinor]) continue;
5151
latestPatches[majorMinor] = patch;
5252
}
53-
}
53+
5454

5555
// Build the list of tags
5656
for (const tag of tags) {

Diff for: src/util.js

+10-10
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { resolve as resolveURL } from 'url';
33

44
// Highlights an element with highlight.js, delaying until it's loaded
55
export function hljs(el) {
6-
if (window.hljs) {
6+
if (window.hljs)
77
window.hljs.highlightBlock(el);
8-
} else {
8+
else {
99
let attempts = 0;
1010
const interval = setInterval(() => {
1111
if (window.hljs) {
@@ -32,7 +32,7 @@ export function parseLink(link, docs) {
3232

3333
// Type link
3434
const split = link.split(/(\.|#)/);
35-
if (docs.links[split[0]]) {
35+
if (docs.links[split[0]])
3636
return {
3737
text: text || link,
3838
link: typeof docs.links[split[0]] === 'object' ? {
@@ -41,15 +41,15 @@ export function parseLink(link, docs) {
4141
query: { scrollTo: split[1] ? `${split[1] === '.' ? 's-' : ''}${split[2]}` : undefined },
4242
} : docs.links[split[0]],
4343
};
44-
}
44+
4545

4646
// Any link
47-
if (link.match(/^https?:\/\//i)) {
47+
if (link.match(/^https?:\/\//i))
4848
return {
4949
text: text || link,
5050
link: link,
5151
};
52-
}
52+
5353

5454
// Plain text
5555
return { text: text || link };
@@ -75,13 +75,13 @@ export function convertLinks(text, docs, router, route) {
7575
parsed.link.params.source = route.params.source;
7676
parsed.link.params.tag = route.params.tag;
7777
link = router.resolve(parsed.link).href;
78-
} else {
78+
} else
7979
link = parsed.link;
80-
}
80+
8181
newText += `[${parsed.text}](${link})`;
82-
} else {
82+
} else
8383
newText += parsed.text;
84-
}
84+
8585

8686
start = match.index + match[0].length;
8787
}

0 commit comments

Comments
 (0)