Skip to content

Commit 61a2d45

Browse files
committed
Linting
1 parent a2d67fb commit 61a2d45

File tree

18 files changed

+56
-47
lines changed

18 files changed

+56
-47
lines changed

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-env node */
12
module.exports = {
23
root: true,
34
env: {
@@ -9,6 +10,7 @@ module.exports = {
910
ecmaVersion: "latest",
1011
},
1112
extends: [
13+
"eslint:recommended",
1214
"plugin:@cspell/recommended",
1315
"plugin:security/recommended-legacy",
1416

@@ -18,7 +20,9 @@ module.exports = {
1820

1921
//! Prettier should always be the last configuration in the extends array.
2022
],
21-
rules: {},
23+
rules: {
24+
"no-unused-vars": ["error", { argsIgnorePattern: "^_" }], // Ignore variables whose names begin with an underscore.
25+
},
2226
overrides: [
2327
/*
2428
* Userscript files.

April_Fools_CSS/April_Fools_CSS.user.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,15 @@ if (window.top === window) {
9191
interval + duration + 10,
9292
);
9393

94-
for (var aprilFool in aprilFools) {
94+
for (var aprilFoolText in aprilFools) {
9595
GM_addStyle(
9696
".aprilfool" +
97-
aprilFool +
97+
aprilFoolText +
9898
" " +
99-
aprilFools[aprilFool].replace("{duration}", duration / 1000),
99+
aprilFools[aprilFoolText].replace(
100+
"{duration}",
101+
duration / 1000,
102+
),
100103
);
101104
}
102105
}

Dakar_Extender/208433.user.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
// ==/UserScript==
1414

1515
// cSpell:ignore dakar
16+
/* global $ */
1617

1718
(function () {
1819
var countryCode = "NLD";

Github_Comment_Enhancer/Github_Comment_Enhancer.user.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
/* eslint security/detect-object-injection: "off" */
2626
/* eslint security/detect-unsafe-regex: "off" */
2727
/* eslint security/detect-non-literal-regexp: "off" */
28-
/* global unsafeWindow */
2928

3029
(function (unsafeWindow) {
3130
String.format = function (string) {

Github_Commit_Diff/Github_Commit_Diff.user.js

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@
3030
/\/compare\//.test(location.href)) &&
3131
(e = document.getElementById("toc"))
3232
) {
33-
var r = e.querySelector(".GithubCommitDiffButton");
33+
let r = e.querySelector(".GithubCommitDiffButton");
3434
if (r) {
3535
r.parentElement.removeChild(r);
3636
}
3737

38-
var b = e.querySelector(".toc-diff-stats");
38+
let b = e.querySelector(".toc-diff-stats");
3939

4040
const s = document.createElementNS(
4141
"http://www.w3.org/2000/svg",
@@ -57,7 +57,7 @@
5757
);
5858
s.appendChild(p);
5959

60-
var a = document.createElement("a");
60+
let a = document.createElement("a");
6161
a.classList.add("btn", "btn-sm", "tooltipped", "tooltipped-n");
6262
a.setAttribute("href", getPatchOrDiffHref("diff"));
6363
a.setAttribute("rel", "nofollow");
@@ -68,7 +68,7 @@
6868
a.appendChild(s);
6969
a.appendChild(document.createTextNode(" Diff"));
7070

71-
var g = document.createElement("div");
71+
let g = document.createElement("div");
7272
g.classList.add("GithubCommitDiffButton", "float-right");
7373
g.style.margin = "0 10px 0 0"; // Give us some room
7474
g.appendChild(a);
@@ -89,7 +89,7 @@
8989
"#files_bucket .pr-toolbar .diffbar > .float-right",
9090
))
9191
) {
92-
var r = e.querySelector(".GithubCommitDiffButton");
92+
let r = e.querySelector(".GithubCommitDiffButton");
9393
if (r) {
9494
r.parentElement.removeChild(r);
9595
}
@@ -114,7 +114,7 @@
114114
);
115115
s.appendChild(p);
116116

117-
var a = document.createElement("a");
117+
let a = document.createElement("a");
118118
a.classList.add(
119119
"btn",
120120
"btn-sm",
@@ -131,7 +131,7 @@
131131
a.appendChild(s);
132132
a.appendChild(document.createTextNode(" Diff"));
133133

134-
var g = document.createElement("div");
134+
let g = document.createElement("div");
135135
g.classList.add("GithubCommitDiffButton", "diffbar-item");
136136
g.appendChild(a);
137137

Github_Commit_Whitespace/Github_Commit_Whitespace.user.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,16 +28,16 @@
2828
/\/compare\//.test(location.href)) &&
2929
(e = document.getElementById("toc"))
3030
) {
31-
var r = e.querySelector(".GithubCommitWhitespaceButton");
31+
let r = e.querySelector(".GithubCommitWhitespaceButton");
3232
if (r) {
3333
r.parentElement.removeChild(r);
3434
}
3535

36-
var on = /w=/.test(location.search); // Any occurrence results in enabling
36+
let on = /w=/.test(location.search); // Any occurrence results in enabling
3737

38-
var b = e.querySelector(".toc-diff-stats");
38+
let b = e.querySelector(".toc-diff-stats");
3939

40-
var a = document.createElement("a");
40+
let a = document.createElement("a");
4141
a.classList.add("btn", "btn-sm", "tooltipped", "tooltipped-n");
4242
if (on) {
4343
a.classList.add("selected");
@@ -50,7 +50,7 @@
5050
);
5151
a.appendChild(document.createTextNode("\u2423"));
5252

53-
var g = document.createElement("div");
53+
let g = document.createElement("div");
5454
g.classList.add("GithubCommitWhitespaceButton", "float-right");
5555
g.style.margin = "0 10px 0 0"; // Give us some room
5656
g.appendChild(a);
@@ -62,14 +62,14 @@
6262
"#files_bucket .pr-toolbar .diffbar > .pr-review-tools",
6363
))
6464
) {
65-
var r = e.querySelector(".GithubCommitWhitespaceButton");
65+
let r = e.querySelector(".GithubCommitWhitespaceButton");
6666
if (r) {
6767
r.parentElement.removeChild(r);
6868
}
6969

70-
var on = /w=/.test(location.search); // Any occurrence result in enabling
70+
let on = /w=/.test(location.search); // Any occurrence result in enabling
7171

72-
var a = document.createElement("a");
72+
let a = document.createElement("a");
7373
a.classList.add(
7474
"btn",
7575
"btn-sm",
@@ -85,7 +85,7 @@
8585
);
8686
a.appendChild(document.createTextNode("\u2423"));
8787

88-
var g = document.createElement("div");
88+
let g = document.createElement("div");
8989
g.classList.add("GithubCommitWhitespaceButton", "diffbar-item");
9090
g.appendChild(a);
9191

Github_Gist_Share/157850.user.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@
195195
const menu = new Menu(nav);
196196

197197
// Twitter
198+
// eslint-disable-next-line no-constant-condition
198199
if (true) {
199200
const stats = [];
200201
if (data.files > 1) {

Github_JSON_Dependencies_Linker/Github_JSON_Dependencies_Linker.user.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
// cSpell:ignore linkify, Sindre Sorhus
2727
/* eslint security/detect-object-injection: "off" */
28-
/* global GM_xmlhttpRequest */
2928

3029
(function () {
3130
var blobElm = document.querySelector(".highlight"),
@@ -182,18 +181,18 @@
182181
modules[dependencyKey].forEach(function (module) {
183182
if (isAtom && dependencyKey === "packageDependencies") {
184183
// Atom needs to be before NPM.
185-
var url = "https://atom.io/packages/" + module;
184+
let url = "https://atom.io/packages/" + module;
186185
linkify(module, url);
187186
} else if (isNPM) {
188-
var url = "https://www.npmjs.org/package/" + module;
187+
let url = "https://www.npmjs.org/package/" + module;
189188
linkify(module, url);
190189
} else if (isBower) {
191190
GM_xmlhttpRequest({
192191
method: "GET",
193192
url: "http://bower.herokuapp.com/packages/" + module,
194193
onload: function (response) {
195194
var data = JSON.parse(response.responseText);
196-
var re = /github\.com\/([\w\-\.]+)\/([\w\-\.]+)/i;
195+
var re = /github\.com\/([\w\-.]+)\/([\w\-.]+)/i;
197196
var parsedUrl = re.exec(data.url.replace(/\.git$/, ""));
198197
if (parsedUrl) {
199198
var user = parsedUrl[1];

Github_Reply_Comments/Github_Reply_Comments.user.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
// cSpell:ignore textareas, previewable, tooltipped
2626
/* eslint security/detect-object-injection: "off" */
27+
/* global TurndownService,turndownPluginGfm,turndownPluginGithubCodeSnippet */
2728

2829
(function () {
2930
String.format = function (string) {

Multiple_Windows_Live_IDs/Multiple_Windows_Live_IDs.user.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222

2323
// cSpell:ignore MWLID, maincontent, phholder, transform
2424
/* eslint security/detect-object-injection: "off" */
25-
/* global GM_getValue,GM_setValue */
2625

2726
(function () {
2827
var autoLogin = true;

0 commit comments

Comments
 (0)