Skip to content

Commit

Permalink
eslint: enable rule: @typescript-eslint/no-unused-vars (#3247)
Browse files Browse the repository at this point in the history
When enabling this rule, it's recommended to also *disable* the standard `no-unused-vars` rule.  Although `no-unused-vars` is not currently enabled, it seems helpful to explicitly disable it here.

See: https://typescript-eslint.io/rules/no-unused-vars/

Co-authored-by: alxndrsn <alxndrsn>
  • Loading branch information
alxndrsn authored Jun 18, 2024
1 parent a24a24d commit 83a0e3e
Show file tree
Hide file tree
Showing 32 changed files with 31 additions and 57 deletions.
8 changes: 7 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"plugins": ["prettier"],
"plugins": ["@typescript-eslint", "prettier"],
"parser": "@typescript-eslint/parser",
"extends": ["plugin:prettier/recommended", "prettier"],
"ignorePatterns": ["node_modules", "coverage", "packages/pg-protocol/dist/**/*", "packages/pg-query-stream/dist/**/*"],
Expand All @@ -11,5 +11,11 @@
"node": true,
"es6": true,
"mocha": true
},
"rules": {
"@typescript-eslint/no-unused-vars": ["error", {
"args": "none"
}],
"no-unused-vars": "off"
}
}
3 changes: 0 additions & 3 deletions packages/pg-protocol/src/b.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
// file for microbenchmarking

import { Writer } from './buffer-writer'
import { serialize } from './index'
import { BufferReader } from './buffer-reader'

const LOOPS = 1000
let count = 0
let start = Date.now()
const writer = new Writer()

const reader = new BufferReader()
const buffer = Buffer.from([33, 33, 33, 33, 33, 33, 33, 0])
Expand Down
11 changes: 0 additions & 11 deletions packages/pg-protocol/src/inbound-parser.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,6 @@ var parseCompleteBuffer = buffers.parseComplete()
var bindCompleteBuffer = buffers.bindComplete()
var portalSuspendedBuffer = buffers.portalSuspended()

var addRow = function (bufferList: BufferList, name: string, offset: number) {
return bufferList
.addCString(name) // field name
.addInt32(offset++) // table id
.addInt16(offset++) // attribute of column number
.addInt32(offset++) // objectId of field's data type
.addInt16(offset++) // datatype size
.addInt32(offset++) // type modifier
.addInt16(0) // format code, 0 => text
}

var row1 = {
name: 'id',
tableID: 1,
Expand Down
2 changes: 1 addition & 1 deletion packages/pg-protocol/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { BackendMessage, DatabaseError } from './messages'
import { DatabaseError } from './messages'
import { serialize } from './serializer'
import { Parser, MessageCallback } from './parser'

Expand Down
1 change: 0 additions & 1 deletion packages/pg-protocol/src/parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
NoticeMessage,
} from './messages'
import { BufferReader } from './buffer-reader'
import assert from 'assert'

// every message is prefixed with a single bye
const CODE_LENGTH = 1
Expand Down
2 changes: 2 additions & 0 deletions packages/pg-query-stream/test/async-iterator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,11 @@ if (!process.version.startsWith('v8')) {
const pool = new pg.Pool({ max: 1 })
const client = await pool.connect()

/* eslint-disable @typescript-eslint/no-unused-vars */
for await (const _ of client.query(new QueryStream('select TRUE', [], { highWaterMark: 1 }))) break
for await (const _ of client.query(new QueryStream('select TRUE', [], { highWaterMark: 1 }))) break
for await (const _ of client.query(new QueryStream('select TRUE', [], { highWaterMark: 1 }))) break
/* eslint-enable @typescript-eslint/no-unused-vars */

client.release()
await pool.end()
Expand Down
2 changes: 1 addition & 1 deletion packages/pg-query-stream/test/pauses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import helper from './helper'
import concat from 'concat-stream'
import JSONStream from 'JSONStream'
import QueryStream from '../src'
import { Transform, TransformCallback } from 'stream'
import { Transform } from 'stream'

class PauseStream extends Transform {
constructor() {
Expand Down
1 change: 0 additions & 1 deletion packages/pg/test/integration/client/appname-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ function getAppName(conf, cb) {
}

suite.test('No default appliation_name ', function (done) {
var conf = getConInfo()
getAppName({}, function (res) {
assert.strictEqual(res, '')
done()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ process.on('exit', function () {
})

var runBigQuery = function (client) {
var rows = []
var q = client.query(
client.query(
"select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as bla from person where name = $1 or 1 = 1",
[''],
function (err, result) {
Expand Down
5 changes: 2 additions & 3 deletions packages/pg/test/integration/client/error-handling-tests.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
'use strict'

var helper = require('./test-helper')
var util = require('util')

var pg = helper.pg
const Client = pg.Client
Expand Down Expand Up @@ -113,7 +112,7 @@ var ensureFuture = function (testClient, done) {
suite.test('when query is parsing', (done) => {
var client = createErorrClient()

var q = client.query({ text: 'CREATE TEMP TABLE boom(age integer); INSERT INTO boom (age) VALUES (28);' })
client.query({ text: 'CREATE TEMP TABLE boom(age integer); INSERT INTO boom (age) VALUES (28);' })

// this query wont parse since there isn't a table named bang
var query = client.query(
Expand All @@ -131,7 +130,7 @@ suite.test('when query is parsing', (done) => {
suite.test('when a query is binding', function (done) {
var client = createErorrClient()

var q = client.query({ text: 'CREATE TEMP TABLE boom(age integer); INSERT INTO boom (age) VALUES (28);' })
client.query({ text: 'CREATE TEMP TABLE boom(age integer); INSERT INTO boom (age) VALUES (28);' })

var query = client.query(
new pg.Query({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ suite.test(

// TODO should be text or sql?
try {
const results = yield client.query({
yield client.query({
text: `SELECT 'foo'::text as name; SELECT 'bar'::text as baz`,
queryMode: 'extended',
})
Expand Down
4 changes: 2 additions & 2 deletions packages/pg/test/integration/client/no-data-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const suite = new helper.Suite()
suite.test('noData message handling', function () {
var client = helper.client()

var q = client.query({
client.query({
name: 'boom',
text: 'create temp table boom(id serial, size integer)',
})
Expand All @@ -29,7 +29,7 @@ suite.test('noData message handling', function () {
values: [101],
})

var query = client.query(
client.query(
{
name: 'fetch',
text: 'select size from boom where size < $1',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ var suite = new helper.Suite()
client.on('drain', client.end.bind(client))

var queryName = 'user by age and like name'
var parseCount = 0

suite.test('first named prepared statement', function (done) {
var query = client.query(
Expand Down Expand Up @@ -89,7 +88,7 @@ var suite = new helper.Suite()
var client2 = helper.client()

suite.test('client 1 execution', function (done) {
var query = client1.query(
client1.query(
{
name: statementName,
text: statement1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ new helper.Suite().test('should return insert metadata', function () {
assert.equal(result.oid, null)
assert.equal(result.command, 'CREATE')

var q = client.query(
client.query(
"INSERT INTO zugzug(name) VALUES('more work?')",
assert.calls(function (err, result) {
assert(!err)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ test('returns results as array', function () {
values: ['hai'],
rowMode: 'array',
}
var query = client.query(
client.query(
config,
assert.success(function (result) {
assert.equal(result.rows.length, 1)
Expand Down
1 change: 1 addition & 0 deletions packages/pg/test/integration/client/simple-query-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ test('simple query interface', function () {
query.once('row', function (row) {
test('Can iterate through columns', function () {
var columnCount = 0
// eslint-disable-next-line @typescript-eslint/no-unused-vars
for (var column in row) {
columnCount++
}
Expand Down
4 changes: 1 addition & 3 deletions packages/pg/test/integration/client/type-coercion-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ var testForTypeCoercion = function (type) {
assert(!err)

type.values.forEach(function (val) {
var insertQuery = client.query(
client.query(
'insert into test_type(col) VALUES($1)',
[val],
assert.calls(function (err, result) {
Expand Down Expand Up @@ -135,8 +135,6 @@ if (helper.config.binary) {
})
}

var valueCount = 0

types.forEach(function (type) {
testForTypeCoercion(type)
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ suite.test('errors emitted on checked-out clients', (cb) => {
client.query('SELECT NOW()', function () {
pool.connect(
assert.success(function (client2, done2) {
var pidColName = 'procpid'
helper.versionGTE(
client2,
90200,
Expand Down
4 changes: 2 additions & 2 deletions packages/pg/test/integration/connection/copy-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ var assert = require('assert')

test('COPY FROM events check', function () {
helper.connect(function (con) {
var stdinStream = con.query('COPY person FROM STDIN')
con.query('COPY person FROM STDIN')
con.on('copyInResponse', function () {
con.endCopyFrom()
})
Expand All @@ -28,7 +28,7 @@ test('COPY FROM events check', function () {
})
test('COPY TO events check', function () {
helper.connect(function (con) {
var stdoutStream = con.query('COPY person TO STDOUT')
con.query('COPY person TO STDOUT')
assert.emits(con, 'copyOutResponse', function () {}, 'backend should emit copyOutResponse after COPY TO query')
assert.emits(con, 'copyData', function () {}, 'backend should emit copyData on every data row')
assert.emits(
Expand Down
1 change: 0 additions & 1 deletion packages/pg/test/integration/connection/test-helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
var net = require('net')
var helper = require('../test-helper')
var Connection = require('../../../lib/connection')
var utils = require('../../../lib/utils')
const crypto = require('../../../lib/crypto/utils')
var connect = function (callback) {
var username = helper.args.user
Expand Down
2 changes: 1 addition & 1 deletion packages/pg/test/integration/domain-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ suite.test('with domain', function (cb) {
assert.success(function (client, done) {
assert(process.domain, 'no domain exists in connect callback')
assert.equal(startingDomain, process.domain, 'domain was lost when checking out a client')
var query = client.query(
client.query(
'SELECT NOW()',
assert.success(function () {
assert(process.domain, 'no domain exists in query callback')
Expand Down
2 changes: 1 addition & 1 deletion packages/pg/test/integration/gh-issues/1542-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ suite.testAsync('BoundPool can be subclassed', async () => {
suite.test('calling pg.Pool without new throws', () => {
const Pool = helper.pg.Pool
assert.throws(() => {
const pool = Pool()
Pool()
})
})
1 change: 0 additions & 1 deletion packages/pg/test/integration/gh-issues/2064-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ suite.test('Password should not exist in util.inspect output', () => {
suite.test('Password should not exist in json.stringfy output', () => {
const pool = new helper.pg.Pool({ password })
const client = new helper.pg.Client({ password })
const depth = 20
assert(JSON.stringify(pool).indexOf(password) === -1)
assert(JSON.stringify(client).indexOf(password) === -1)
})
1 change: 0 additions & 1 deletion packages/pg/test/integration/gh-issues/2303-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ suite.test('SSL Key should not exist in util.inspect output', () => {
suite.test('SSL Key should not exist in json.stringfy output', () => {
const pool = new helper.pg.Pool({ ssl: { key: secret_value } })
const client = new helper.pg.Client({ ssl: { key: secret_value } })
const depth = 20
assert(JSON.stringify(pool).indexOf(secret_value) === -1)
assert(JSON.stringify(client).indexOf(secret_value) === -1)
})
Expand Down
2 changes: 1 addition & 1 deletion packages/pg/test/unit/client/early-disconnect-tests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
var helper = require('./test-helper')
require('./test-helper')
var net = require('net')
var pg = require('../../../lib/index.js')

Expand Down
2 changes: 0 additions & 2 deletions packages/pg/test/unit/client/prepared-statement-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,7 @@ test('bound command', function () {

var portalClient = helper.client()
var portalCon = portalClient.connection
var portalParseArg = null
portalCon.parse = function (arg) {
portalParseArg = arg
process.nextTick(function () {
portalCon.emit('parseComplete')
})
Expand Down
2 changes: 1 addition & 1 deletion packages/pg/test/unit/client/query-queue-tests.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
var helper = require('./test-helper')
require('./test-helper')
var Connection = require('../../../lib/connection')

test('drain', function () {
Expand Down
2 changes: 1 addition & 1 deletion packages/pg/test/unit/client/result-metadata-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ var testForTag = function (tagText, callback) {
var client = helper.client()
client.connection.emit('readyForQuery')

var query = client.query(
client.query(
'whatever',
assert.calls((err, result) => {
assert.ok(result != null, 'should pass something to this event')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
'use strict'
var helper = require('./test-helper')
require('./test-helper')
var Connection = require('../../../lib/connection')
var Client = require('../../../lib/client')

Expand Down
7 changes: 1 addition & 6 deletions packages/pg/test/unit/client/throw-in-type-parser-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ const emitFakeEvents = (con) => {
}

suite.test('emits error', function (done) {
var handled
var client = helper.client()
var con = client.connection
var query = client.query(new Query('whatever'))
Expand All @@ -45,14 +44,10 @@ suite.test('emits error', function (done) {
})

suite.test('calls callback with error', function (done) {
var handled

var callbackCalled = 0

var client = helper.client()
var con = client.connection
emitFakeEvents(con)
var query = client.query('whatever', function (err) {
client.query('whatever', function (err) {
assert.equal(err, typeParserError)
done()
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,6 @@ suite.test('ssl is set on client', function () {
sslrootcert: '/path/root.crt',
},
}
var Client = require('../../../lib/client')
var defaults = require('../../../lib/defaults')
defaults.ssl = true
var c = new ConnectionParameters(sourceConfig)
Expand Down
2 changes: 0 additions & 2 deletions packages/pg/test/unit/utils-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,6 @@ test('prepareValue: Uint8Array array prepared properly', function () {
})

test('prepareValue: objects with complex toPostgres prepared properly', function () {
var buf = Buffer.from('zomgcustom!')
var customType = {
toPostgres: function () {
return [1, 2]
Expand Down Expand Up @@ -214,7 +213,6 @@ test('prepareValue: objects with toPostgres receive prepareValue', function () {
})

test('prepareValue: objects with circular toPostgres rejected', function () {
var buf = Buffer.from('zomgcustom!')
var customType = {
toPostgres: function () {
return {
Expand Down

0 comments on commit 83a0e3e

Please sign in to comment.