Skip to content

Commit

Permalink
make XO happy
Browse files Browse the repository at this point in the history
Locking the version as 0.17.0 requires Node.js 4
  • Loading branch information
sindresorhus committed Oct 14, 2016
1 parent c258d03 commit dae3a44
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 25 deletions.
2 changes: 1 addition & 1 deletion bench/run.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ if (process.argv.length === 2) {
}
currentArgs.push(arg);
});
if (currentArgs.length) {
if (currentArgs.length > 0) {
list.push({
args: currentArgs,
shouldFail: shouldFail
Expand Down
2 changes: 1 addition & 1 deletion lib/babel-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var defaultPresets = lazy(function () {

return [
require('babel-preset-stage-2'),
require(esPreset)
require(esPreset) // eslint-disable-line import/no-dynamic-require
];
});

Expand Down
2 changes: 1 addition & 1 deletion lib/process-adapter.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ if (debug.enabled) {
process.argv.push('--sorted');
}

require('time-require');
require('time-require'); // eslint-disable-line import/no-unassigned-import
}

var sourceMapCache = Object.create(null);
Expand Down
6 changes: 3 additions & 3 deletions lib/reporters/mini.js
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ MiniReporter.prototype._update = function (data) {
lastLine = lastLine.substring(lastLine.length - (lastLine.length % columns));

// Don't delete the last log line if it's completely empty.
if (lastLine.length) {
if (lastLine.length > 0) {
ct++;
}

Expand All @@ -270,7 +270,7 @@ MiniReporter.prototype._update = function (data) {
// Rewrite the last log line.
str += lastLine;

if (str.length) {
if (str.length > 0) {
this.stream.write(str);
}

Expand All @@ -282,7 +282,7 @@ MiniReporter.prototype._update = function (data) {

var currentStatus = this.currentStatus;

if (currentStatus.length) {
if (currentStatus.length > 0) {
lastLine = this.lastLineTracker.lastLine();
// We need a newline at the end of the last log line, before the status message.
// However, if the last log line is the exact width of the terminal a newline is implied,
Expand Down
3 changes: 2 additions & 1 deletion lib/test-worker.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use strict';
/* eslint-disable import/order */
var process = require('./process-adapter');

var opts = process.opts;
var testPath = opts.file;

Expand Down Expand Up @@ -29,7 +30,7 @@ process.installPrecompilerHook();
var dependencies = [];
process.installDependencyTracking(dependencies, testPath);

require(testPath);
require(testPath); // eslint-disable-line import/no-dynamic-require

process.on('unhandledRejection', throwsHelper);

Expand Down
2 changes: 1 addition & 1 deletion lib/throws-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var path = require('path');
var chalk = require('chalk');
var globals = require('./globals');

module.exports = function throwsHelper(error) {
module.exports = function (error) {
if (!error || !error._avaThrowsHelperData) {
return;
}
Expand Down
16 changes: 3 additions & 13 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -184,22 +184,12 @@
"source-map-fixtures": "^2.1.0",
"tap": "^7.1.2",
"touch": "^1.0.0",
"xo": "*",
"xo": "^0.16.0",
"zen-observable": "^0.3.0"
},
"xo": {
"rules": {
"import/newline-after-import": 0
},
"overrides": [
{
"files": [
"test/**/*.js"
],
"rules": {
"max-lines": 0
}
}
]
"import/newline-after-import": "off"
}
}
}
2 changes: 1 addition & 1 deletion test/assert.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ test('.deepEqual()', function (t) {
});

t.throws(function () {
assert.deepEqual(function a() {}, function a() {});
assert.deepEqual(function () {}, function () {});
});

t.doesNotThrow(function () {
Expand Down
2 changes: 1 addition & 1 deletion test/runner.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ test('tests must be declared synchronously', function (t) {
test('runner emits a "test" event', function (t) {
var runner = new Runner();

runner.test(function foo(a) {
runner.test('foo', function (a) {
a.pass();
});

Expand Down
2 changes: 1 addition & 1 deletion test/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ test('callback is required', function (t) {
});

test('infer name from function', function (t) {
var result = ava(function foo(a) {
var result = ava(function foo(a) { // eslint-disable-line func-names
a.pass();
}).run();

Expand Down
2 changes: 1 addition & 1 deletion test/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var setImmediate = require('../lib/globals').setImmediate;

// Helper to make using beforeEach less arduous.
function makeGroup(test) {
return function group(desc, fn) {
return function (desc, fn) {
test(desc, function (t) {
var beforeEach = function (fn) {
t.beforeEach(function (done) {
Expand Down

0 comments on commit dae3a44

Please sign in to comment.