Skip to content

Commit 9c4924e

Browse files
committed
Removed most unused variables, and some kept in comments
1 parent eb2b22b commit 9c4924e

13 files changed

Lines changed: 23 additions & 24 deletions

File tree

.eslintrc.json

Lines changed: 8 additions & 2 deletions
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+
}

Contrib/PhantomJS/runner.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* exported HTMLCS_RUNNER */
12
var HTMLCS_RUNNER = _global.HTMLCS_RUNNER = new function() {
23
this.run = function(standard, callback) {
34
var self = this;
@@ -60,4 +61,4 @@ var HTMLCS_RUNNER = _global.HTMLCS_RUNNER = new function() {
6061
console.log('[HTMLCS] ' + typeName + '|' + msg.code + '|' + nodeName + '|' + elementId + '|' + msg.msg + '|' + html);
6162
};
6263

63-
};
64+
};

Contrib/PhantomJS/test.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
let data = '';
1+
var data = '';
22

33
process.stdin.resume();
44
process.stdin.setEncoding('utf8');
@@ -15,8 +15,8 @@ function toHTML(obj) {
1515
}
1616

1717
process.stdin.on('end', function() {
18-
let issues = JSON.parse(data);
19-
let html = `<table>
18+
var issues = JSON.parse(data);
19+
var html = `<table>
2020
<thead>
2121
<tr>
2222
<th>Code</th>

Standards/Section508/Sniffs/A.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ _global.HTMLCS_Section508_Sniffs_A = {
241241

242242
for (var el = 0; el < elements.length; el++) {
243243
var element = elements[el];
244-
var nodeName = element.nodeName.toLowerCase();
245244

246245
var childObject = element.querySelector('object');
247246

Standards/Section508/Sniffs/B.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ _global.HTMLCS_Section508_Sniffs_B = {
3939
*/
4040
process: function(element, top)
4141
{
42-
var nodeName = element.nodeName.toLowerCase();
4342
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'For multimedia containing video, ensure a synchronised audio description or text alternative for the video portion is provided.', 'Video');
4443
HTMLCS.addMessage(HTMLCS.NOTICE, element, 'For multimedia containing synchronised audio and video, ensure synchronised captions are provided for the audio portion.', 'Captions');
4544

Standards/Section508/Sniffs/L.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,16 +71,17 @@ _global.HTMLCS_Section508_Sniffs_L = {
7171

7272
for (var el = 0; el < elements.length; el++) {
7373
var element = elements[el];
74-
75-
var nameFound = false;
7674
var hrefFound = false;
7775
var content = HTMLCS.util.getElementTextContent(element);
7876

77+
/*
78+
var nameFound = false;
7979
if ((element.hasAttribute('title') === true) && (/^\s*$/.test(element.getAttribute('title')) === false)) {
8080
nameFound = true;
8181
} else if (/^\s*$/.test(content) === false) {
8282
nameFound = true;
8383
}
84+
*/
8485

8586
if ((element.hasAttribute('href') === true) && (/^\s*$/.test(element.getAttribute('href')) === false)) {
8687
hrefFound = true;

Standards/Section508/Sniffs/O.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ _global.HTMLCS_Section508_Sniffs_O = {
6868
}
6969
}
7070
} catch (ex) {
71+
// Ignore error
7172
}//end try
7273
}//end if
7374
}

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_1/1_1_1.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,6 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_1_1_1_1 = {
384384

385385
for (var el = 0; el < elements.length; el++) {
386386
var element = elements[el];
387-
var nodeName = element.nodeName.toLowerCase();
388387

389388
var childObject = element.querySelector('object');
390389

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_3/1_3_1.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
219219

220220
// Firstly, work out whether it needs a label.
221221
var needsLabel = false;
222-
var labelPos = 'left';
223222
var inputType = inputType.toLowerCase();
224223
if ((inputType === 'select' || inputType === 'textarea')) {
225224
needsLabel = true;
@@ -755,11 +754,11 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
755754
}
756755

757756
for (var i = 0; i < items.length; i++) {
758-
if (/^[\-*]\s+/.test(items[0]) === true) {
757+
if (/^[-*]\s+/.test(items[0]) === true) {
759758
// Test for "- " or "* " cases.
760759
HTMLCS.addMessage(HTMLCS.WARNING, element, _global.HTMLCS.getTranslation("1_3_1_H48.1"), 'H48.1');
761760
break;
762-
} if (/^\d+[:\/\-.]?\s+/.test(items[0]) === true) {
761+
} if (/^\d+[:/\-.]?\s+/.test(items[0]) === true) {
763762
// Test for "1 " cases (or "1. ", "1: ", "1- ").
764763
HTMLCS.addMessage(HTMLCS.WARNING, element, _global.HTMLCS.getTranslation("1_3_1_H48.2"), 'H48.2');
765764
break;
@@ -775,7 +774,6 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
775774
for (var i = 0; i < headings.length; i++) {
776775
var headingNum = parseInt(headings[i].nodeName.substr(1, 1));
777776
if (headingNum - lastHeading > 1) {
778-
var exampleMsg = 'should be an h' + (lastHeading + 1) + ' to be properly nested';
779777
if (lastHeading === 0) {
780778
// If last heading is empty, we are at document top and we are
781779
// expecting a H1, generally speaking.
@@ -813,7 +811,6 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_3_1_3_1 = {
813811
*/
814812
testUnstructuredNavLinks: function(element)
815813
{
816-
var nodeName = element.nodeName.toLowerCase();
817814
var linksLength = 0;
818815

819816
var childNodes = element.childNodes;

Standards/WCAG2AAA/Sniffs/Principle1/Guideline1_4/1_4_3.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ _global.HTMLCS_WCAG2AAA_Sniffs_Principle1_Guideline1_4_1_4_3 = {
4545
var required = failures[i].required;
4646
var recommend = failures[i].recommendation;
4747
var hasBgImg = failures[i].hasBgImage || false;
48-
var bgColour = failures[i].bgColour || false;
4948
var isAbsolute = failures[i].isAbsolute || false;
5049
var hasAlpha = failures[i].hasAlpha || false;
5150

0 commit comments

Comments
 (0)