Skip to content

Commit

Permalink
Infrastructure: Add eslint-html plugin
Browse files Browse the repository at this point in the history
Infrastructure: Allows linting and autofixing of the script tags inside the HTML files (pull #2109)
  • Loading branch information
nschonni committed Nov 5, 2021
1 parent 4541f87 commit f7de7ec
Show file tree
Hide file tree
Showing 25 changed files with 331 additions and 208 deletions.
15 changes: 15 additions & 0 deletions .eslintrc.json
Expand Up @@ -48,6 +48,21 @@
"rules": {
"no-console": 0
}
},
{
"files": [
"**/*.html"
],
"plugins":[
"html"
],
"globals": {
"sourceCode": true
},
"rules": {
"strict": 0,
"no-unused-vars": ["error", { "varsIgnorePattern": "SkipToConfig" }]
}
}
]
}
148 changes: 79 additions & 69 deletions aria-practices-DeletedSectionsArchive.html
Expand Up @@ -7,27 +7,29 @@
<script src="common/script/resolveReferences.js" class="remove"></script>
<script src="common/biblio.js" class="remove"></script>
<script class="remove">
/* eslint-disable */

var respecConfig = {
// Embed RDFa data in the output.
doRDFa : '1.1',
includePermalinks : true,
permalinkEdge : true,
permalinkHide : false,
doRDFa: '1.1',
includePermalinks: true,
permalinkEdge: true,
permalinkHide: false,
// Specification status (e.g., WD, LC, NOTE, etc.). If in doubt use ED.
specStatus : "ED",
specStatus: 'ED',
// crEnd: "2012-04-30",
// perEnd: "2013-07-23",
// publishDate: "2013-08-22",
noRecTrack : true,
diffTool : "http://www.aptest.com/standards/htmldiff/htmldiff.pl",
noRecTrack: true,
diffTool: 'http://www.aptest.com/standards/htmldiff/htmldiff.pl',

// The specifications short name, as in http://www.w3.org/TR/short-name/
shortName : "wai-aria-practices-1.1",
shortName: 'wai-aria-practices-1.1',

// If you wish the publication date to be other than today,
// set publishDate.
// publishDate: "2009-08-06",
copyrightStart : "2015",
copyrightStart: '2015',

// If there is a previously published draft, uncomment this
// and set its YYYY-MM-DD date and its maturity status.
Expand All @@ -38,50 +40,58 @@
// previousDiffURI: "",

// If there a publicly available Editors Draft, this is the link
edDraftURI : "http://w3c.github.io/aria-practices/",
edDraftURI: 'http://w3c.github.io/aria-practices/',

// If this is a LCWD, uncomment and set the end of its review period
// lcEnd: "2012-02-21",

// Editors, add as many as you like.
// “name” is the only required field.
editors : [ {
name : "Matt King",
mailto : "mck@fb.com",
company : "Facebook",
companyURI : "http://www.facebook.com/"
}, {
name : "James Nurthen",
mailto : "james.nurthen@oracle.com",
company : "Oracle Corporation",
companyURI : "http://www.oracle.com/"
}, {
name : "Michael Cooper",
url : 'http://www.w3.org/People/cooper/',
mailto : "cooper@w3.org",
company : "W3C",
companyURI : "http://www.w3.org/"
}, {
name : "Michiel Bijl",
mailto : "mbijl@paciellogroup.com",
company : "The Paciello Group",
companyURI : "https://www.paciellogroup.com/"
}, {
name : "Joseph Scheuhammer",
company : "Inclusive Design Research Centre, OCAD University",
companyURI : "http://idrc.ocad.ca/",
note : "Previous Editor"
}, {
name : "Lisa Pappas",
company : "SAS",
companyURI : "http://www.sas.com/",
note : "Previous Editor"
}, {
name : "Rich Schwerdtfeger",
company : "IBM Corporation",
companyURI : "http://ibm.com/",
note : "Previous Editor"
}, ],
editors: [
{
name: 'Matt King',
mailto: 'mck@fb.com',
company: 'Facebook',
companyURI: 'http://www.facebook.com/',
},
{
name: 'James Nurthen',
mailto: 'james.nurthen@oracle.com',
company: 'Oracle Corporation',
companyURI: 'http://www.oracle.com/',
},
{
name: 'Michael Cooper',
url: 'http://www.w3.org/People/cooper/',
mailto: 'cooper@w3.org',
company: 'W3C',
companyURI: 'http://www.w3.org/',
},
{
name: 'Michiel Bijl',
mailto: 'mbijl@paciellogroup.com',
company: 'The Paciello Group',
companyURI: 'https://www.paciellogroup.com/',
},
{
name: 'Joseph Scheuhammer',
company: 'Inclusive Design Research Centre, OCAD University',
companyURI: 'http://idrc.ocad.ca/',
note: 'Previous Editor',
},
{
name: 'Lisa Pappas',
company: 'SAS',
companyURI: 'http://www.sas.com/',
note: 'Previous Editor',
},
{
name: 'Rich Schwerdtfeger',
company: 'IBM Corporation',
companyURI: 'http://ibm.com/',
note: 'Previous Editor',
},
],

// Authors, add as many as you like.
// This is optional, uncomment if you have authors as well as editors.
Expand All @@ -97,23 +107,23 @@
// ],

// Spec URLs
ariaSpecURLs : {
"ED" : "http://w3c.github.io/aria/aria/aria.html",
"FPWD" : "http://www.w3.org/TR/wai-aria-1.1/",
"WD" : "http://www.w3.org/TR/wai-aria-1.1/",
"REC" : "http://www.w3.org/TR/wai-aria/"
ariaSpecURLs: {
ED: 'http://w3c.github.io/aria/aria/aria.html',
FPWD: 'http://www.w3.org/TR/wai-aria-1.1/',
WD: 'http://www.w3.org/TR/wai-aria-1.1/',
REC: 'http://www.w3.org/TR/wai-aria/',
},
accNameURLs : {
"ED" : "http://w3c.github.io/aria/accname-aam/accname-aam.html",
"WD" : "http://www.w3.org/TR/accname-aam-1.1/",
"FPWD" : "http://www.w3.org/TR/accname-aam-1.1/",
"REC" : "http://www.w3.org/TR/accname-aam-1.1/"
accNameURLs: {
ED: 'http://w3c.github.io/aria/accname-aam/accname-aam.html',
WD: 'http://www.w3.org/TR/accname-aam-1.1/',
FPWD: 'http://www.w3.org/TR/accname-aam-1.1/',
REC: 'http://www.w3.org/TR/accname-aam-1.1/',
},
coreMappingURLs : {
"ED" : "http://w3c.github.io/aria/core-aam/core-aam.html",
"WD" : "http://www.w3.org/TR/core-aam-1.1/",
"FPWD" : "http://www.w3.org/TR/core-aam-1.1/",
"REC" : "http://www.w3.org/TR/core-aam-1.1/"
coreMappingURLs: {
ED: 'http://w3c.github.io/aria/core-aam/core-aam.html',
WD: 'http://www.w3.org/TR/core-aam-1.1/',
FPWD: 'http://www.w3.org/TR/core-aam-1.1/',
REC: 'http://www.w3.org/TR/core-aam-1.1/',
},

// alternateFormats: [
Expand All @@ -134,26 +144,26 @@
// errata: 'http://www.w3.org/2010/02/rdfa/errata.html',

// name of the WG
wg : "Accessible Rich Internet Applications Working Group",
wg: 'Accessible Rich Internet Applications Working Group',

// URI of the public WG page
wgURI : "http://www.w3.org/WAI/ARIA/",
wgURI: 'http://www.w3.org/WAI/ARIA/',

// Name (without the @w3c.org) of the public mailing
// to which comments are due.
wgPublicList : "public-aria",
wgPublicList: 'public-aria',

// URI of the patent status for this WG, for Rec-track documents
// !!!! IMPORTANT !!!!
// This is important for Rec-track documents, do not copy a patent URI
// from a random document unless you know what you're doing.
// If in doubt ask your friendly neighbourhood Team Contact.
wgPatentURI : "http://www.w3.org/2004/01/pp-impl/83726/status",
maxTocLevel : 4,
wgPatentURI: 'http://www.w3.org/2004/01/pp-impl/83726/status',
maxTocLevel: 4,

localBiblio : biblio,
localBiblio: biblio,

preProcess : [ linkCrossReferences ]
preProcess: [linkCrossReferences],
};
</script>
<link href="common/css/common.css" rel="stylesheet" type="text/css" />
Expand Down
Expand Up @@ -268,7 +268,9 @@ <h3 id="sc1_label">Example 1: title of this variation of the implementation</h3>
It renders the HTML in the preceding pre element with ID 'sc1'.
If you change the ID of either the 'ex1' div or the 'sc1' pre, be sure to update the sourceCode.add function parameters.
-->
<script>sourceCode.add('sc1', 'ex1')</script>
<script>
sourceCode.add('sc1', 'ex1');
</script>

<h3 id="sc2_label">Example 2: title of this variation of the implementation</h3>
<div id="sc2_start_sep" role="separator" aria-labelledby="sc2_start_sep sc2_label" aria-label="Start of HTML for" ></div>
Expand All @@ -279,7 +281,9 @@ <h3 id="sc2_label">Example 2: title of this variation of the implementation</h3>
It renders the HTML in the preceding pre element with ID 'sc2'.
If you change the ID of either the 'ex2' div or the 'sc2' pre, be sure to update the sourceCode.add function parameters.
-->
<script>sourceCode.add('sc2', 'ex2')</script>
<script>
sourceCode.add('sc2', 'ex2');
</script>

<h3 id="sc3_label">Example 3: title of this variation of the implementation</h3>
<div id="sc3_start_sep" role="separator" aria-labelledby="sc3_start_sep sc3_label" aria-label="Start of HTML for" ></div>
Expand All @@ -290,9 +294,13 @@ <h3 id="sc3_label">Example 3: title of this variation of the implementation</h3>
It renders the HTML in the preceding pre element with ID 'sc3'.
If you change the ID of either the 'ex3' div or the 'sc3' pre, be sure to update the sourceCode.add function parameters.
-->
<script>sourceCode.add('sc3', 'ex3') </script>
<script>
sourceCode.add('sc3', 'ex3');
</script>
<!-- After all source has been added, run make to do the insert. -->
<script> sourceCode.make() </script>
<script>
sourceCode.make();
</script>
</section>
</main>
<nav>
Expand Down
8 changes: 5 additions & 3 deletions examples/coding-template/Example-Template.html
Expand Up @@ -79,12 +79,14 @@ <h2 id="ex_label">Example</h2>
<!-- Target of previous link will need to be updated when we move the guidelines into the wiki from Ian's repo. -->

<script type="text/javascript">
/* eslint-disable */

// Javascript relevant to example
var i;
var str = "text"
for(i = 0; i < str.length; i++) {
var str = 'text';
for (i = 0; i < str.length; i++) {
console.log(str[i]);
var code = "<p>Hello World!</p>";
var code = '<p>Hello World!</p>';
}
</script>
</ul>
Expand Down
16 changes: 12 additions & 4 deletions examples/grid/LayoutGrids.html
Expand Up @@ -719,21 +719,29 @@ <h3 id="sc1_label">Example 1: Simple List of Links</h3>
<div id="sc1_start_sep" role="separator" aria-labelledby="sc1_start_sep sc1_label" aria-label="Start of HTML for"></div>
<pre><code id="sc1"></code></pre>
<div id="sc1_end_sep" role="separator" aria-labelledby="sc1_end_sep sc1_label" aria-label="End of HTML for"></div>
<script>sourceCode.add('sc1', 'ex1', 'ex1_label', 'css_js_files')</script>
<script>
sourceCode.add('sc1', 'ex1', 'ex1_label', 'css_js_files');
</script>

<h3 id="sc2_label">Example 2: Pill List For Components Like a List of Message Recipients</h3>
<div id="sc2_start_sep" role="separator" aria-labelledby="sc2_start_sep sc2_label" aria-label="Start of HTML for"></div>
<pre><code id="sc2"></code></pre>
<div id="sc2_end_sep" role="separator" aria-labelledby="sc2_end_sep sc2_label" aria-label="End of HTML for"></div>
<script>sourceCode.add('sc2', 'ex2', 'ex2_label', 'css_js_files')</script>
<script>
sourceCode.add('sc2', 'ex2', 'ex2_label', 'css_js_files');
</script>

<h3 id="sc3_label">Example 3: Scrollable Search Results</h3>
<div id="sc3_start_sep" role="separator" aria-labelledby="sc3_start_sep sc3_label" aria-label="Start of HTML for"></div>
<pre><code id="sc3"></code></pre>
<div id="sc3_end_sep" role="separator" aria-labelledby="sc3_end_sep sc3_label" aria-label="End of HTML for"></div>
<script>sourceCode.add('sc3', 'ex3', 'ex3_label', 'css_js_files') </script>
<script>
sourceCode.add('sc3', 'ex3', 'ex3_label', 'css_js_files');
</script>
<!-- After all source has been added, run make to do the insert. -->
<script> sourceCode.make() </script>
<script>
sourceCode.make();
</script>
</section>
</main>
<nav>
Expand Down
16 changes: 12 additions & 4 deletions examples/grid/dataGrids.html
Expand Up @@ -819,21 +819,29 @@ <h3 id="sc1_label">Example 1: Minimal Data Grid</h3>
<div id="sc1_start_sep" role="separator" aria-labelledby="sc1_start_sep sc1_label" aria-label="Start of HTML for"></div>
<pre><code id="sc1"></code></pre>
<div id="sc1_end_sep" role="separator" aria-labelledby="sc1_end_sep sc1_label" aria-label="End of HTML for"></div>
<script>sourceCode.add('sc1', 'ex1', 'ex1_label', 'css_js_files')</script>
<script>
sourceCode.add('sc1', 'ex1', 'ex1_label', 'css_js_files');
</script>

<h3 id="sc2_label">Example 2: Sortable Data Grid With Editable Cells</h3>
<div id="sc2_start_sep" role="separator" aria-labelledby="sc2_start_sep sc2_label" aria-label="Start of HTML for"></div>
<pre><code id="sc2"></code></pre>
<div id="sc2_end_sep" role="separator" aria-labelledby="sc2_end_sep sc2_label" aria-label="End of HTML for"></div>
<script>sourceCode.add('sc2', 'ex2', 'ex2_label', 'css_js_files')</script>
<script>
sourceCode.add('sc2', 'ex2', 'ex2_label', 'css_js_files');
</script>

<h3 id="sc3_label">Example 3: Scrollable Data Grid With Column Hiding</h3>
<div id="sc3_start_sep" role="separator" aria-labelledby="sc3_start_sep sc3_label" aria-label="Start of HTML for"></div>
<pre><code id="sc3"></code></pre>
<div id="sc3_end_sep" role="separator" aria-labelledby="sc3_end_sep sc3_label" aria-label="End of HTML for"></div>
<script>sourceCode.add('sc3', 'ex3', 'ex3_label', 'css_js_files') </script>
<script>
sourceCode.add('sc3', 'ex3', 'ex3_label', 'css_js_files');
</script>
<!-- After all source has been added, run make to do the insert. -->
<script> sourceCode.make(); </script>
<script>
sourceCode.make();
</script>
</section>
</main>
<nav>
Expand Down
17 changes: 8 additions & 9 deletions examples/landmarks/HTML5.html
Expand Up @@ -154,16 +154,15 @@ <h2 id="id3">Related Documents</h2>
<script type="text/javascript" src="js/show.js"></script>
<script type="text/javascript" >
// Use the SkipTo defaults, but just showing custom configuration
var SkipToConfig =
{
"settings": {
"skipTo": {
"headings": "h1, h2",
"attachElement": "#skip-to-attach",
var SkipToConfig = {
settings: {
skipTo: {
headings: 'h1, h2',
attachElement: '#skip-to-attach',

"colorTheme": "aria"
}
}
colorTheme: 'aria',
},
},
};
</script>
<script type="text/javascript" src="js/skipto.min.js"></script>
Expand Down

0 comments on commit f7de7ec

Please sign in to comment.