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

Commit

Permalink
fix(linting): no-unused-vars
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys committed May 4, 2024
1 parent 153cfda commit bfaffbf
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions lib/read-json.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ readJson.extraSet = [
var typoWarned = {}
var cache = {}

function readJson (file, log_, strict_, cb_) {
function readJson (file) {
var log, strict, cb
for (var i = 1; i < arguments.length - 1; i++) {
if (typeof arguments[i] === 'boolean') {
Expand Down Expand Up @@ -154,7 +154,7 @@ function indexjs (file, er, log, strict, cb) {
}

readJson.extras = extras
function extras (file, data, log_, strict_, cb_) {
function extras (file, data) {
var log, strict, cb
for (var i = 2; i < arguments.length - 1; i++) {
if (typeof arguments[i] === 'boolean') {
Expand Down
4 changes: 2 additions & 2 deletions test/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ var tap = require('tap')
var readJson = require('../')

var createWarningCollector = function () {
var warn = function (msg) {
var warn = function () {
warn.warnings.push(arguments)
}
warn.warnings = []
Expand All @@ -25,7 +25,7 @@ tap.test('Bin test', function (t) {
tap.test('Bad bin test', function (t) {
var p = path.resolve(__dirname, 'fixtures/badbin.json')
var warn = createWarningCollector()
readJson(p, warn, function (er, data) {
readJson(p, warn, function () {
t.equal(warn.warnings.length, 1)
t.equal(warn.warnings[0][2], 'No bin file found at bin/typo')
t.end()
Expand Down
4 changes: 2 additions & 2 deletions test/helpful.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ var path = require('path')
var p = path.resolve(__dirname, 'fixtures/erroneous.json')

tap.test('erroneous package data', function (t) {
readJson(p, function (er, data) {
readJson(p, function (er) {
t.ok(er instanceof Error)
t.equal(er.code, 'EJSONPARSE')
t.end()
})
})

tap.test('ENOTDIR for non-directory packages', function (t) {
readJson(path.resolve(__filename, 'package.json'), function (er, data) {
readJson(path.resolve(__filename, 'package.json'), function (er) {
t.ok(er)
t.equal(er.code, 'ENOTDIR')
t.end()
Expand Down
2 changes: 1 addition & 1 deletion test/main-non-string.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var p = path.resolve(__dirname, 'fixtures/badmainnonstring.json')
tap.test('non-string main entries', function (t) {
var logmsgs = []
const warn = (...msg) => logmsgs.push(msg)
readJson(p, warn, function (er, data) {
readJson(p, warn, function (er) {
t.comment(logmsgs.map(msg => 'Warning: ' + msg.join(' ')).join('\n'))
t.match(er, new TypeError('The "main" attribute must be of type string.'))
t.end()
Expand Down

0 comments on commit bfaffbf

Please sign in to comment.