Skip to content
This repository was archived by the owner on Aug 15, 2024. It is now read-only.

Commit 5fcc26c

Browse files
committed
linting fixes
1 parent 4a19442 commit 5fcc26c

File tree

6 files changed

+17
-14
lines changed

6 files changed

+17
-14
lines changed

.eslintrc.json

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"es6": true
55
},
66
"parserOptions": {
7-
"sourceType": "module"
7+
"sourceType": "script"
88
},
99
"rules": {
1010
"accessor-pairs": "error",
@@ -74,10 +74,6 @@
7474
"id-blacklist": "error",
7575
"id-match": "error",
7676
"jsx-quotes": "error",
77-
"linebreak-style": [
78-
"error",
79-
"unix"
80-
],
8177
"lines-around-comment": "error",
8278
"lines-around-directive": "error",
8379
"max-depth": "error",

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ language: node_js
22
node_js:
33
- "4"
44
- "6"
5-
- "7"
5+
- "8"
66
script: npm run travis
77

88
before_install:

lib/MemoryFileSystem.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
MIT License http://www.opensource.org/licenses/mit-license.php
33
Author Tobias Koppers @sokra
44
*/
5+
56
"use strict";
67

78
const normalize = require("./normalize");

lib/join.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
"use strict";
2+
13
const normalize = require("./normalize");
24

35
const absoluteWinRegExp = /^[A-Z]:([\\\/]|$)/i;

lib/normalize.js

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1+
"use strict";
2+
13
module.exports = function normalize(path) {
24
var parts = path.split(/(\\+|\/+)/);
35
if(parts.length === 1)
46
return path;
57
var result = [];
68
var absolutePathStart = 0;
7-
for(var i = 0, sep = false; i < parts.length; i++, sep = !sep) {
9+
for(var i = 0, sep = false; i < parts.length; i += 1, sep = !sep) {
810
var part = parts[i];
911
if(i === 0 && /^([A-Z]:)?$/i.test(part)) {
1012
result.push(part);
@@ -30,7 +32,7 @@ module.exports = function normalize(path) {
3032
// i. e. "a/../b/c" => "b/c"
3133
// i. e. "/../b/c" => "/b/c"
3234
// i. e. "C:\..\a\b\c" => "C:\a\b\c"
33-
i++;
35+
i += 1;
3436
sep = !sep;
3537
result.length = absolutePathStart;
3638
break;
@@ -42,7 +44,7 @@ module.exports = function normalize(path) {
4244
if(absolutePathStart === 0) {
4345
result.length -= 3;
4446
} else {
45-
i++;
47+
i += 1;
4648
sep = !sep;
4749
result.length = 2;
4850
}
@@ -66,9 +68,9 @@ module.exports = function normalize(path) {
6668
// i. e. "C:\." => "C:\"
6769
// i. e. "C:\.\a\b\c" => "C:\a\b\c"
6870
if(absolutePathStart === 0) {
69-
result.length--;
71+
result.length -= 1;
7072
} else {
71-
i++;
73+
i += 1;
7274
sep = !sep;
7375
}
7476
break;
@@ -78,7 +80,7 @@ module.exports = function normalize(path) {
7880
// i. e. "C:\a\." => "C:\"
7981
// i. e. "a/./b/c" => "a/b/c"
8082
// i. e. "/a/./b/c" => "/a/b/c"
81-
result.length--;
83+
result.length -= 1;
8284
break;
8385
}
8486
} else if(part) {
@@ -88,4 +90,4 @@ module.exports = function normalize(path) {
8890
if(result.length === 1 && /^[A-Za-z]:$/.test(result))
8991
return result[0] + "\\";
9092
return result.join("");
91-
};
93+
};

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,9 @@
1111
],
1212
"scripts": {
1313
"test": "mocha",
14+
"lint": "eslint lib/*",
1415
"cover": "istanbul cover node_modules/mocha/bin/_mocha",
15-
"travis": "npm run cover -- --report lcovonly"
16+
"travis": "npm run cover -- --report lcovonly && npm run lint"
1617
},
1718
"engines": {
1819
"node": ">=4.3.0 <5.0.0 || >=5.10"
@@ -35,6 +36,7 @@
3536
"bl": "^1.0.0",
3637
"codecov.io": "^0.1.4",
3738
"coveralls": "^2.11.2",
39+
"eslint": "^4.0.0",
3840
"istanbul": "0.4.5",
3941
"mocha": "3.2.0",
4042
"should": "^4.0.4"

0 commit comments

Comments
 (0)