Skip to content

Commit 750a49c

Browse files
🔧 config(lint): Upgrade xo.
1 parent a05b768 commit 750a49c

File tree

3 files changed

+692
-1673
lines changed

3 files changed

+692
-1673
lines changed

doc/scripts/header.js

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,31 @@
1-
var domReady = function(callback) {
2-
var state = document.readyState ;
3-
if ( state === 'interactive' || state === 'complete' ) {
4-
callback() ;
5-
}
6-
else {
1+
const domReady = function (callback) {
2+
const state = document.readyState;
3+
if (state === 'interactive' || state === 'complete') {
4+
callback();
5+
} else {
76
document.addEventListener('DOMContentLoaded', callback);
87
}
9-
} ;
10-
8+
};
119

12-
domReady(function(){
13-
14-
var projectname = document.createElement('a');
10+
domReady(() => {
11+
const projectname = document.createElement('a');
1512
projectname.classList.add('project-name');
1613
projectname.text = 'comparison-sorting/insertion-sort';
17-
projectname.href = './index.html' ;
14+
projectname.href = './index.html';
1815

19-
var header = document.getElementsByTagName('header')[0] ;
20-
header.insertBefore(projectname,header.firstChild);
16+
const header = document.querySelectorAll('header')[0];
17+
header.insertBefore(projectname, header.firstChild);
2118

22-
var testlink = document.querySelector('header > a[data-ice="testLink"]') ;
23-
testlink.href = 'https://coveralls.io/github/comparison-sorting/insertion-sort' ;
24-
testlink.target = '_BLANK' ;
19+
const testlink = document.querySelector('header > a[data-ice="testLink"]');
20+
testlink.href =
21+
'https://coveralls.io/github/comparison-sorting/insertion-sort';
22+
testlink.target = '_BLANK';
2523

26-
var searchBox = document.querySelector('.search-box');
27-
var input = document.querySelector('.search-input');
24+
const searchBox = document.querySelector('.search-box');
25+
const input = document.querySelector('.search-input');
2826

29-
// active search box when focus on searchBox.
30-
input.addEventListener('focus', function(){
27+
// Active search box when focus on searchBox.
28+
input.addEventListener('focus', () => {
3129
searchBox.classList.add('active');
3230
});
33-
3431
});

package.json

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"pinst": "2.1.6",
9090
"power-assert": "1.6.1",
9191
"regenerator-runtime": "0.13.7",
92-
"xo": "0.36.1"
92+
"xo": "0.42.0"
9393
},
9494
"ava": {
9595
"files": [
@@ -194,12 +194,21 @@
194194
"unicorn"
195195
],
196196
"rules": {
197+
"unicorn/prefer-node-protocol": "off",
197198
"unicorn/filename-case": [
198199
"error",
199200
{
200201
"case": "camelCase"
201202
}
202203
]
203-
}
204+
},
205+
"overrides": [
206+
{
207+
"files": [
208+
"doc/**"
209+
],
210+
"env": "browser"
211+
}
212+
]
204213
}
205214
}

0 commit comments

Comments
 (0)