Skip to content

Commit 0be3ec3

Browse files
committed
Merge branch 'paazmaya-244-eslint-fix'
2 parents 58b833e + bd54a39 commit 0be3ec3

File tree

25 files changed

+1876
-1877
lines changed

25 files changed

+1876
-1877
lines changed

.eslintrc.json

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"env": {
33
"browser": true,
4-
"node": true
4+
"node": false
55
},
66
"extends": "eslint:recommended",
77
"rules": {
@@ -17,7 +17,13 @@
1717
"error",
1818
"always"
1919
],
20+
"no-console": 0,
2021
"no-undef": 0,
22+
"no-unused-vars": [
23+
"error", {
24+
"args": "none"
25+
}
26+
],
2127
"no-redeclare": 0
2228
}
23-
}
29+
}

Auditor/HTMLCSAuditor.js

+90-90
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ _global.HTMLCSAuditor = new function()
107107
}//end if
108108

109109
return false;
110-
}
110+
};
111111

112112
return label;
113113
};
@@ -213,7 +213,7 @@ _global.HTMLCSAuditor = new function()
213213
closeIcon.setAttribute('title', _global.HTMLCS.getTranslation("auditor_close"));
214214
closeIcon.onmousedown = function() {
215215
self.close.call(self);
216-
}
216+
};
217217

218218
header.appendChild(closeIcon);
219219

@@ -511,7 +511,7 @@ _global.HTMLCSAuditor = new function()
511511
useStandardSelect.onchange = function() {
512512
_standard = this.options[this.selectedIndex].value;
513513
self.run(_standard, _sources, _options);
514-
}
514+
};
515515
}
516516

517517
var issueCountDiv = _doc.createElement('div');
@@ -531,7 +531,7 @@ _global.HTMLCSAuditor = new function()
531531
error: _doc.getElementById(_prefix + 'include-error').checked,
532532
warning: _doc.getElementById(_prefix + 'include-warning').checked,
533533
notice: _doc.getElementById(_prefix + 'include-notice').checked
534-
}
534+
};
535535

536536
var wrapper = _doc.getElementById(_prefix + 'wrapper');
537537
var newWrapper = self.build(_standard, _messages, _options);
@@ -560,7 +560,7 @@ _global.HTMLCSAuditor = new function()
560560
error: true,
561561
warning: true,
562562
notice: false
563-
}
563+
};
564564

565565
if ((levels.error === 0) && (levels.warning === 0)) {
566566
_options.show.notice = true;
@@ -671,20 +671,20 @@ _global.HTMLCSAuditor = new function()
671671
var typeClass = '';
672672

673673
switch (message.type) {
674-
case HTMLCS.ERROR:
675-
typeText = 'Error';
674+
case HTMLCS.ERROR:
675+
typeText = 'Error';
676676
break;
677677

678-
case HTMLCS.WARNING:
679-
typeText = 'Warning';
678+
case HTMLCS.WARNING:
679+
typeText = 'Warning';
680680
break;
681681

682-
case HTMLCS.NOTICE:
683-
typeText = 'Notice';
682+
case HTMLCS.NOTICE:
683+
typeText = 'Notice';
684684
break;
685685

686-
default:
687-
// Not defined.
686+
default:
687+
// Not defined.
688688
break;
689689
}//end switch
690690

@@ -732,7 +732,7 @@ _global.HTMLCSAuditor = new function()
732732

733733
var oldSummary = _doc.querySelectorAll('.HTMLCS-summary')[0];
734734
oldSummary.style.display = 'none';
735-
}
735+
};
736736

737737
return msg;
738738
};
@@ -750,7 +750,7 @@ _global.HTMLCSAuditor = new function()
750750
if (_options.showIssueCallback) {
751751
_options.showIssueCallback.call(this, id);
752752
}
753-
}
753+
};
754754

755755
var buildMessageDetail = function(id, message, standard) {
756756
if (standard === undefined) {
@@ -760,20 +760,20 @@ _global.HTMLCSAuditor = new function()
760760
var typeText = '';
761761

762762
switch (message.type) {
763-
case HTMLCS.ERROR:
764-
typeText = 'Error';
763+
case HTMLCS.ERROR:
764+
typeText = 'Error';
765765
break;
766766

767-
case HTMLCS.WARNING:
768-
typeText = 'Warning';
767+
case HTMLCS.WARNING:
768+
typeText = 'Warning';
769769
break;
770770

771-
case HTMLCS.NOTICE:
772-
typeText = 'Notice';
771+
case HTMLCS.NOTICE:
772+
typeText = 'Notice';
773773
break;
774774

775-
default:
776-
// Not defined.
775+
default:
776+
// Not defined.
777777
break;
778778
}//end switch
779779

@@ -1019,7 +1019,7 @@ _global.HTMLCSAuditor = new function()
10191019

10201020
var issueList = _doc.querySelectorAll('.HTMLCS-issue-list')[0];
10211021
issueList.style.marginLeft = ((_page - 1) * -300) + 'px';
1022-
}
1022+
};
10231023

10241024
next.onclick = function() {
10251025
if (_page < totalPages) {
@@ -1038,10 +1038,10 @@ _global.HTMLCSAuditor = new function()
10381038

10391039
var issueList = _doc.querySelectorAll('.HTMLCS-issue-list')[0];
10401040
issueList.style.marginLeft = ((_page - 1) * -300) + 'px';
1041-
}
1041+
};
10421042

10431043
return navDiv;
1044-
}
1044+
};
10451045

10461046
var pointToIssueElement = function(issue) {
10471047
var msg = _messages[Number(issue)];
@@ -1107,7 +1107,7 @@ _global.HTMLCSAuditor = new function()
11071107
script.onreadystatechange = null;
11081108
script.onload();
11091109
}
1110-
}
1110+
};
11111111

11121112
script.src = src;
11131113

@@ -1120,7 +1120,7 @@ _global.HTMLCSAuditor = new function()
11201120

11211121
this.setOption = function(name, value) {
11221122
_options[name] = value;
1123-
}
1123+
};
11241124

11251125
this.getIssue = function(issueNumber)
11261126
{
@@ -1138,16 +1138,16 @@ _global.HTMLCSAuditor = new function()
11381138

11391139
for (var i = 0; i < messages.length; i++) {
11401140
switch (messages[i].type) {
1141-
case HTMLCS.ERROR:
1142-
counts.error++;
1141+
case HTMLCS.ERROR:
1142+
counts.error++;
11431143
break;
11441144

1145-
case HTMLCS.WARNING:
1146-
counts.warning++;
1145+
case HTMLCS.WARNING:
1146+
counts.warning++;
11471147
break;
11481148

1149-
case HTMLCS.NOTICE:
1150-
counts.notice++;
1149+
case HTMLCS.NOTICE:
1150+
counts.notice++;
11511151
break;
11521152
}//end switch
11531153
}//end for
@@ -1169,28 +1169,28 @@ _global.HTMLCSAuditor = new function()
11691169
// Filter only the wanted error types.
11701170
var ignore = false;
11711171
switch (messages[i].type) {
1172-
case HTMLCS.ERROR:
1173-
if (_options.show.error === false) {
1174-
ignore = true;
1175-
} else {
1176-
errors++;
1177-
}
1172+
case HTMLCS.ERROR:
1173+
if (_options.show.error === false) {
1174+
ignore = true;
1175+
} else {
1176+
errors++;
1177+
}
11781178
break;
11791179

1180-
case HTMLCS.WARNING:
1181-
if (_options.show.warning === false) {
1182-
ignore = true;
1183-
} else {
1184-
warnings++;
1185-
}
1180+
case HTMLCS.WARNING:
1181+
if (_options.show.warning === false) {
1182+
ignore = true;
1183+
} else {
1184+
warnings++;
1185+
}
11861186
break;
11871187

1188-
case HTMLCS.NOTICE:
1189-
if (_options.show.notice === false) {
1190-
ignore = true;
1191-
} else {
1192-
notices++;
1193-
}
1188+
case HTMLCS.NOTICE:
1189+
if (_options.show.notice === false) {
1190+
ignore = true;
1191+
} else {
1192+
notices++;
1193+
}
11941194
break;
11951195
}//end switch
11961196

@@ -1322,7 +1322,7 @@ _global.HTMLCSAuditor = new function()
13221322
cssLink.href = _options.path + prefix + '.css';
13231323
head.appendChild(cssLink);
13241324
}
1325-
}
1325+
};
13261326

13271327
this.getStandardList = function() {
13281328
var pattern = /^HTMLCS_[^_]+$/;
@@ -1380,7 +1380,7 @@ _global.HTMLCSAuditor = new function()
13801380
var _doc = this.getParentElement();
13811381
if (_doc.ownerDocument) {
13821382
_doc = _doc.ownerDocument;
1383-
};
1383+
}
13841384

13851385
return _doc;
13861386
};
@@ -1434,7 +1434,7 @@ _global.HTMLCSAuditor = new function()
14341434

14351435
if (document.querySelectorAll('frameset').length === 0) {
14361436
source.push(document);
1437-
};
1437+
}
14381438

14391439
if (_top.frames.length > 0) {
14401440
for (var i = 0; i < _top.frames.length; i++) {
@@ -1608,7 +1608,7 @@ _global.HTMLCSAuditor = new function()
16081608
_doc.documentElement.querySelector('.HTMLCS-settings').appendChild(msgElementSource);
16091609

16101610
var msg = 'HTML_CodeSniffer has been updated to version ' + response.newVersion + '.';
1611-
msg += ' <a href="http://squizlabs.github.io/HTML_CodeSniffer/patches/' + response.newVersion + '">View the changelog</a>'
1611+
msg += ' <a href="http://squizlabs.github.io/HTML_CodeSniffer/patches/' + response.newVersion + '">View the changelog</a>';
16121612

16131613
msgElementSource.innerHTML = msg;
16141614
}//end if
@@ -2027,35 +2027,35 @@ _global.HTMLCSAuditor = new function()
20272027
var left = 0;
20282028
var bounceHeight = 20;
20292029
switch (direction) {
2030-
case 'up':
2031-
bounceHeight = (-bounceHeight);
2032-
top = rect.y2;
2033-
if ((rect.x2 - rect.x1) < 250) {
2034-
left = (this.getRectMidPnt(rect) - (this.pointerDim.width / 2));
2035-
} else {
2036-
left = rect.x1;
2037-
}
2030+
case 'up':
2031+
bounceHeight = (-bounceHeight);
2032+
top = rect.y2;
2033+
if ((rect.x2 - rect.x1) < 250) {
2034+
left = (this.getRectMidPnt(rect) - (this.pointerDim.width / 2));
2035+
} else {
2036+
left = rect.x1;
2037+
}
20382038
break;
20392039

2040-
case 'down':
2041-
default:
2042-
top = (rect.y1 - this.pointerDim.height);
2043-
if ((rect.x2 - rect.x1) < 250) {
2044-
left = (this.getRectMidPnt(rect) - (this.pointerDim.width / 2));
2045-
} else {
2046-
left = rect.x1;
2047-
}
2040+
case 'down':
2041+
default:
2042+
top = (rect.y1 - this.pointerDim.height);
2043+
if ((rect.x2 - rect.x1) < 250) {
2044+
left = (this.getRectMidPnt(rect) - (this.pointerDim.width / 2));
2045+
} else {
2046+
left = rect.x1;
2047+
}
20482048
break;
20492049

2050-
case 'left':
2051-
left = rect.x2;
2052-
top = (this.getRectMidPnt(rect, true) - (this.pointerDim.height / 2));
2050+
case 'left':
2051+
left = rect.x2;
2052+
top = (this.getRectMidPnt(rect, true) - (this.pointerDim.height / 2));
20532053
break;
20542054

2055-
case 'right':
2056-
bounceHeight = (-bounceHeight);
2057-
left = (rect.x1 - this.pointerDim.width);
2058-
top = (this.getRectMidPnt(rect, true) - (this.pointerDim.height / 2));
2055+
case 'right':
2056+
bounceHeight = (-bounceHeight);
2057+
left = (rect.x1 - this.pointerDim.width);
2058+
top = (this.getRectMidPnt(rect, true) - (this.pointerDim.height / 2));
20592059
break;
20602060

20612061
}//end switch
@@ -2111,18 +2111,18 @@ _global.HTMLCSAuditor = new function()
21112111
var maxBounce = 5;
21122112

21132113
switch (direction) {
2114-
case 'up':
2115-
currentDirection = direction + '-op';
2116-
initalPosOffset = dist;
2117-
case 'down':
2118-
style = 'top';
2114+
case 'up':
2115+
currentDirection = direction + '-op';
2116+
initalPosOffset = dist;
2117+
case 'down':
2118+
style = 'top';
21192119
break;
21202120

2121-
case 'left':
2122-
currentDirection = direction + '-op';
2123-
initalPosOffset = dist;
2124-
case 'right':
2125-
style = 'left';
2121+
case 'left':
2122+
currentDirection = direction + '-op';
2123+
initalPosOffset = dist;
2124+
case 'right':
2125+
style = 'left';
21262126
break;
21272127
}
21282128

@@ -2184,6 +2184,6 @@ _global.HTMLCSAuditor = new function()
21842184
}
21852185
}
21862186

2187-
}
2187+
};
21882188

21892189
};

0 commit comments

Comments
 (0)