Skip to content

Commit

Permalink
[eslint] enable func-style
Browse files Browse the repository at this point in the history
  • Loading branch information
ljharb committed Sep 19, 2022
1 parent f8a8a7f commit 98b9623
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"rules": {
"array-bracket-spacing": "off",
"complexity": "off",
"func-style": "warn",
"func-style": ["error", "declaration"],
"no-magic-numbers": "off",
"max-lines": "warn",
"max-lines-per-function": "warn",
Expand Down Expand Up @@ -105,6 +105,7 @@
"allowKeywords": true,
"allowPattern": "throws"
}],
"func-style": "off",
"id-length": "off",
"max-len": "off",
"max-lines-per-function": "off",
Expand Down
8 changes: 4 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ module.exports = (function () {
return harness;
}

var lazyLoad = function () {
function lazyLoad() {
// eslint-disable-next-line no-invalid-this
return getHarness().apply(this, arguments);
};
}

lazyLoad.wait = function () {
wait = true;
Expand Down Expand Up @@ -72,7 +72,7 @@ function createHarness(conf_) {
results.once('done', function () { results.close(); });
}

var test = function (name, conf, cb) {
function test(name, conf, cb) {
var t = new Test(name, conf, cb);
test._tests.push(t);

Expand All @@ -87,7 +87,7 @@ function createHarness(conf_) {

results.push(t);
return t;
};
}
test._results = results;

test._tests = [];
Expand Down
6 changes: 4 additions & 2 deletions lib/results.js
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ Results.prototype.only = function (t) {

Results.prototype._watch = function (t) {
var self = this;
var write = function (s) { self._stream.queue(s); };
function write(s) { self._stream.queue(s); }

t.once('prerun', function () {
var premsg = '';
if (t._skip) {
Expand Down Expand Up @@ -214,7 +215,8 @@ Results.prototype.close = function () {
var self = this;
if (self.closed) { self._stream.emit('error', new Error('ALREADY CLOSED')); }
self.closed = true;
var write = function (s) { self._stream.queue(s); };

function write(s) { self._stream.queue(s); }

write('\n1..' + self.count + '\n');
write('# tests ' + self.count + '\n');
Expand Down
6 changes: 3 additions & 3 deletions lib/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var safeSetTimeout = setTimeout;
var safeClearTimeout = clearTimeout;

// eslint-disable-next-line no-unused-vars
var getTestArgs = function (name_, opts_, cb_) {
function getTestArgs(name_, opts_, cb_) {
var name = '(anonymous)';
var opts = {};
var cb;
Expand All @@ -54,7 +54,7 @@ var getTestArgs = function (name_, opts_, cb_) {
opts: opts,
cb: cb
};
};
}

function Test(name_, opts_, cb_) {
if (!(this instanceof Test)) {
Expand Down Expand Up @@ -427,7 +427,7 @@ Test.prototype.skip = function skip(msg, extra) {
});
};

var testAssert = function assert(value, msg, extra) {
var testAssert = function assert(value, msg, extra) { // eslint-disable-line func-style
this._assert(value, {
message: defined(msg, 'should be truthy'),
operator: 'ok',
Expand Down

0 comments on commit 98b9623

Please sign in to comment.