Skip to content

Commit

Permalink
📚 docs: Lint documentation script.
Browse files Browse the repository at this point in the history
Also remove useless ignore key in xo config.
  • Loading branch information
make-github-pseudonymous-again committed Mar 25, 2021
1 parent 0f0301d commit cc3e12a
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
40 changes: 18 additions & 22 deletions doc/scripts/header.js
Original file line number Diff line number Diff line change
@@ -1,34 +1,30 @@
var domReady = function(callback) {
var state = document.readyState ;
if ( state === 'interactive' || state === 'complete' ) {
callback() ;
}
else {
const domReady = function (callback) {
const state = document.readyState;
if (state === 'interactive' || state === 'complete') {
callback();
} else {
document.addEventListener('DOMContentLoaded', callback);
}
} ;

};

domReady(function(){

var projectname = document.createElement('a');
domReady(() => {
const projectname = document.createElement('a');
projectname.classList.add('project-name');
projectname.text = 'aureooms/js-pairs';
projectname.href = './index.html' ;
projectname.href = './index.html';

var header = document.getElementsByTagName('header')[0] ;
header.insertBefore(projectname,header.firstChild);
const header = document.querySelectorAll('header')[0];
header.insertBefore(projectname, header.firstChild);

var testlink = document.querySelector('header > a[data-ice="testLink"]') ;
testlink.href = 'https://coveralls.io/github/aureooms/js-pairs' ;
testlink.target = '_BLANK' ;
const testlink = document.querySelector('header > a[data-ice="testLink"]');
testlink.href = 'https://coveralls.io/github/aureooms/js-pairs';
testlink.target = '_BLANK';

var searchBox = document.querySelector('.search-box');
var input = document.querySelector('.search-input');
const searchBox = document.querySelector('.search-box');
const input = document.querySelector('.search-input');

// active search box when focus on searchBox.
input.addEventListener('focus', function(){
// Active search box when focus on searchBox.
input.addEventListener('focus', () => {
searchBox.classList.add('active');
});

});
14 changes: 9 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,19 @@
},
"xo": {
"prettier": true,
"ignore": [
"lib",
"doc"
],
"plugins": [
"unicorn"
],
"rules": {
"unicorn/filename-case": "off"
}
},
"overrides": [
{
"files": [
"doc/**"
],
"env": "browser"
}
]
}
}

0 comments on commit cc3e12a

Please sign in to comment.