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 87deb68 commit 75c0c3a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .eslintrc
Expand Up @@ -12,7 +12,7 @@
"rules": {
"array-bracket-spacing": "off",
"complexity": "off",
"func-style": "warn",
"func-style": ["error", "declaration"],
"max-lines-per-function": "warn",
"max-lines": "warn",
"max-statements-per-line": [2, { "max": 2 }],
Expand Down Expand Up @@ -107,6 +107,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
Expand Up @@ -23,10 +23,10 @@ module.exports = (function () {
return harness;
}

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

lazyLoad.only = function () {
return getHarness().only.apply(this, arguments);
Expand Down Expand Up @@ -61,7 +61,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 @@ -76,7 +76,7 @@ function createHarness(conf_) {

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

test._tests = [];
Expand Down
4 changes: 2 additions & 2 deletions lib/results.js
Expand Up @@ -174,7 +174,7 @@ 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 @@ -208,7 +208,7 @@ 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
5 changes: 3 additions & 2 deletions lib/test.js
Expand Up @@ -23,7 +23,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 @@ -44,7 +44,7 @@ var getTestArgs = function (name_, opts_, cb_) {
opts: opts,
cb: cb
};
};
}

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

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

0 comments on commit 75c0c3a

Please sign in to comment.