Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
enabled and improved linting
Browse files Browse the repository at this point in the history
  • Loading branch information
igorklopov committed Aug 28, 2016
1 parent 4d0b381 commit 379aa02
Show file tree
Hide file tree
Showing 14 changed files with 482 additions and 201 deletions.
6 changes: 0 additions & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,4 @@
/build/node
/examples/06-http-server-w-assets/assets
/examples/26-sails
/lib-es5
/node_modules
/node_repository
/runtime
/test/test-50-many-arrow-functions/test-x-index.js
/test/test-50-many-callbacks/test-x-index.js
/test/test-50-no-super-in-constructor/test-x-index.js
4 changes: 2 additions & 2 deletions lib/detector.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
/* eslint-disable max-depth */
/* eslint-disable operator-linebreak */

'use strict';
'use strict'; // eslint-disable-line strict

const assert = require('assert');
const common = require('../runtime/common.js');
Expand Down Expand Up @@ -221,7 +221,7 @@ function reconstruct (node) {
while (true) {
v2 = v.replace(/\[ /g, '[')
.replace(/ \]/g, ']')
.replace(/ /g, ' ')
.replace(/ {2}/g, ' ');
if (v2 === v) break;
v = v2;
}
Expand Down
2 changes: 1 addition & 1 deletion lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function fabricatorForTarget (target) {
return { nodeRange, platform: hostPlatform, arch: hostArch };
}

export async function exec (argv2) {
export async function exec (argv2) { // eslint-disable-line complexity

const argv = minimist(argv2, {
string: [ '_', 'c', 'config', 'l', 'loglevel', 'o',
Expand Down
28 changes: 12 additions & 16 deletions lib/walker.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,12 @@ const another = function (p, base) {
p = p.slice(1);
negate = true;
}
if (!path.isAbsolute(p))
if (!path.isAbsolute(p)) {
p = path.join(base, p);
if (negate)
}
if (negate) {
p = '!' + p;
}
return p;
};

Expand All @@ -123,9 +125,7 @@ Walker.prototype.activateConfig = function (tuple) {
scripts = [ scripts ];
}
scripts = collect(
scripts.map(p => {
return another(p, base);
})
scripts.map(p => another(p, base))
);
scripts.some(script => {
const stat = fs.statSync(script);
Expand All @@ -145,9 +145,7 @@ Walker.prototype.activateConfig = function (tuple) {
assets = [ assets ];
}
assets = collect(
assets.map(p => {
return another(p, base);
})
assets.map(p => another(p, base))
);
assets.some(asset => {
const stat = fs.statSync(asset);
Expand All @@ -165,15 +163,13 @@ Walker.prototype.activateConfig = function (tuple) {
let files = config.files;

if (files) {
files = files.map(file => {
files = files.map(file =>
// npm/node_modules/fstream-npm/fstream-npm.js
// Packer.prototype.readRules
return file.replace(/\/+$/, '') + '/**'
})
file.replace(/\/+$/, '') + '/**'
);
files = collect(
files.map(p => {
return another(p, base);
})
files.map(p => another(p, base))
);
files.some(file => {
const stat = fs.statSync(file);
Expand Down Expand Up @@ -252,7 +248,7 @@ Walker.prototype.stepPatch = function (record) {
record.body = body;

}
};
}

};

Expand Down Expand Up @@ -477,7 +473,7 @@ Walker.prototype.stepDerivatives = async function (record, derivatives) {
assert(false, 'walker: unknown aliasType ' + derivative.aliasType);
}

};
}

};

Expand Down
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
"extends": "klopov",
"parser": "babel-eslint",
"rules": {
"max-depth": "off",
"no-var": "off",
"one-var": "off",
"padded-blocks": "off",
"vars-on-top": "off"
Expand Down
2 changes: 2 additions & 0 deletions test/test-50-common/main.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/usr/bin/env node

/* eslint-disable no-multi-spaces */

'use strict';

const assert = require('assert');
Expand Down
Loading

0 comments on commit 379aa02

Please sign in to comment.