Skip to content

Commit fe0b973

Browse files
👕 refactor: Lint.
1 parent 63431a8 commit fe0b973

File tree

5 files changed

+319
-882
lines changed

5 files changed

+319
-882
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 = 'functional-data-structure/persistent-stack';
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/functional-data-structure/persistent-stack' ;
24-
testlink.target = '_BLANK' ;
19+
const testlink = document.querySelector('header > a[data-ice="testLink"]');
20+
testlink.href =
21+
'https://coveralls.io/github/functional-data-structure/persistent-stack';
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: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
"pinst": "2.1.6",
9292
"power-assert": "1.6.1",
9393
"regenerator-runtime": "0.13.7",
94-
"xo": "0.36.1"
94+
"xo": "0.42.0"
9595
},
9696
"ava": {
9797
"files": [
@@ -197,6 +197,14 @@
197197
],
198198
"rules": {
199199
"unicorn/filename-case": "off"
200-
}
200+
},
201+
"overrides": [
202+
{
203+
"files": [
204+
"doc/**"
205+
],
206+
"env": "browser"
207+
}
208+
]
201209
}
202210
}

src/withMethods.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ PersistentStack.prototype.push = function (value) {
77
};
88

99
PersistentStack.prototype[Symbol.iterator] = function* () {
10+
// eslint-disable-next-line unicorn/no-this-assignment
1011
let current = this;
1112
while (!current.isEmpty()) {
1213
yield current.peek();

src/withoutMethods.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ function Node(value, next) {
77
}
88

99
Node.prototype[Symbol.iterator] = function* () {
10+
// eslint-disable-next-line unicorn/no-this-assignment
1011
let current = this;
1112
while (current !== null) {
1213
yield current.value;

0 commit comments

Comments
 (0)