Skip to content

Commit 83a0e3e

Browse files
authored
eslint: enable rule: @typescript-eslint/no-unused-vars (#3247)
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>
1 parent a24a24d commit 83a0e3e

32 files changed

+31
-57
lines changed

.eslintrc

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"plugins": ["prettier"],
2+
"plugins": ["@typescript-eslint", "prettier"],
33
"parser": "@typescript-eslint/parser",
44
"extends": ["plugin:prettier/recommended", "prettier"],
55
"ignorePatterns": ["node_modules", "coverage", "packages/pg-protocol/dist/**/*", "packages/pg-query-stream/dist/**/*"],
@@ -11,5 +11,11 @@
1111
"node": true,
1212
"es6": true,
1313
"mocha": true
14+
},
15+
"rules": {
16+
"@typescript-eslint/no-unused-vars": ["error", {
17+
"args": "none"
18+
}],
19+
"no-unused-vars": "off"
1420
}
1521
}

packages/pg-protocol/src/b.ts

-3
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
// file for microbenchmarking
22

3-
import { Writer } from './buffer-writer'
4-
import { serialize } from './index'
53
import { BufferReader } from './buffer-reader'
64

75
const LOOPS = 1000
86
let count = 0
97
let start = Date.now()
10-
const writer = new Writer()
118

129
const reader = new BufferReader()
1310
const buffer = Buffer.from([33, 33, 33, 33, 33, 33, 33, 0])

packages/pg-protocol/src/inbound-parser.test.ts

-11
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,6 @@ var parseCompleteBuffer = buffers.parseComplete()
1414
var bindCompleteBuffer = buffers.bindComplete()
1515
var portalSuspendedBuffer = buffers.portalSuspended()
1616

17-
var addRow = function (bufferList: BufferList, name: string, offset: number) {
18-
return bufferList
19-
.addCString(name) // field name
20-
.addInt32(offset++) // table id
21-
.addInt16(offset++) // attribute of column number
22-
.addInt32(offset++) // objectId of field's data type
23-
.addInt16(offset++) // datatype size
24-
.addInt32(offset++) // type modifier
25-
.addInt16(0) // format code, 0 => text
26-
}
27-
2817
var row1 = {
2918
name: 'id',
3019
tableID: 1,

packages/pg-protocol/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { BackendMessage, DatabaseError } from './messages'
1+
import { DatabaseError } from './messages'
22
import { serialize } from './serializer'
33
import { Parser, MessageCallback } from './parser'
44

packages/pg-protocol/src/parser.ts

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ import {
2727
NoticeMessage,
2828
} from './messages'
2929
import { BufferReader } from './buffer-reader'
30-
import assert from 'assert'
3130

3231
// every message is prefixed with a single bye
3332
const CODE_LENGTH = 1

packages/pg-query-stream/test/async-iterator.ts

+2
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,11 @@ if (!process.version.startsWith('v8')) {
122122
const pool = new pg.Pool({ max: 1 })
123123
const client = await pool.connect()
124124

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

129131
client.release()
130132
await pool.end()

packages/pg-query-stream/test/pauses.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import helper from './helper'
22
import concat from 'concat-stream'
33
import JSONStream from 'JSONStream'
44
import QueryStream from '../src'
5-
import { Transform, TransformCallback } from 'stream'
5+
import { Transform } from 'stream'
66

77
class PauseStream extends Transform {
88
constructor() {

packages/pg/test/integration/client/appname-tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ function getAppName(conf, cb) {
2727
}
2828

2929
suite.test('No default appliation_name ', function (done) {
30-
var conf = getConInfo()
3130
getAppName({}, function (res) {
3231
assert.strictEqual(res, '')
3332
done()

packages/pg/test/integration/client/big-simple-query-tests.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ process.on('exit', function () {
9292
})
9393

9494
var runBigQuery = function (client) {
95-
var rows = []
96-
var q = client.query(
95+
client.query(
9796
"select 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa' as bla from person where name = $1 or 1 = 1",
9897
[''],
9998
function (err, result) {

packages/pg/test/integration/client/error-handling-tests.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
'use strict'
22

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

65
var pg = helper.pg
76
const Client = pg.Client
@@ -113,7 +112,7 @@ var ensureFuture = function (testClient, done) {
113112
suite.test('when query is parsing', (done) => {
114113
var client = createErorrClient()
115114

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

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

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

136135
var query = client.query(
137136
new pg.Query({

packages/pg/test/integration/client/multiple-results-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ suite.test(
3333

3434
// TODO should be text or sql?
3535
try {
36-
const results = yield client.query({
36+
yield client.query({
3737
text: `SELECT 'foo'::text as name; SELECT 'bar'::text as baz`,
3838
queryMode: 'extended',
3939
})

packages/pg/test/integration/client/no-data-tests.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const suite = new helper.Suite()
55
suite.test('noData message handling', function () {
66
var client = helper.client()
77

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

32-
var query = client.query(
32+
client.query(
3333
{
3434
name: 'fetch',
3535
text: 'select size from boom where size < $1',

packages/pg/test/integration/client/prepared-statement-tests.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ var suite = new helper.Suite()
99
client.on('drain', client.end.bind(client))
1010

1111
var queryName = 'user by age and like name'
12-
var parseCount = 0
1312

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

9190
suite.test('client 1 execution', function (done) {
92-
var query = client1.query(
91+
client1.query(
9392
{
9493
name: statementName,
9594
text: statement1,

packages/pg/test/integration/client/result-metadata-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ new helper.Suite().test('should return insert metadata', function () {
1919
assert.equal(result.oid, null)
2020
assert.equal(result.command, 'CREATE')
2121

22-
var q = client.query(
22+
client.query(
2323
"INSERT INTO zugzug(name) VALUES('more work?')",
2424
assert.calls(function (err, result) {
2525
assert(!err)

packages/pg/test/integration/client/results-as-array-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ test('returns results as array', function () {
2323
values: ['hai'],
2424
rowMode: 'array',
2525
}
26-
var query = client.query(
26+
client.query(
2727
config,
2828
assert.success(function (result) {
2929
assert.equal(result.rows.length, 1)

packages/pg/test/integration/client/simple-query-tests.js

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ test('simple query interface', function () {
1818
query.once('row', function (row) {
1919
test('Can iterate through columns', function () {
2020
var columnCount = 0
21+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
2122
for (var column in row) {
2223
columnCount++
2324
}

packages/pg/test/integration/client/type-coercion-tests.js

+1-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ var testForTypeCoercion = function (type) {
1414
assert(!err)
1515

1616
type.values.forEach(function (val) {
17-
var insertQuery = client.query(
17+
client.query(
1818
'insert into test_type(col) VALUES($1)',
1919
[val],
2020
assert.calls(function (err, result) {
@@ -135,8 +135,6 @@ if (helper.config.binary) {
135135
})
136136
}
137137

138-
var valueCount = 0
139-
140138
types.forEach(function (type) {
141139
testForTypeCoercion(type)
142140
})

packages/pg/test/integration/connection-pool/error-tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ suite.test('errors emitted on checked-out clients', (cb) => {
1818
client.query('SELECT NOW()', function () {
1919
pool.connect(
2020
assert.success(function (client2, done2) {
21-
var pidColName = 'procpid'
2221
helper.versionGTE(
2322
client2,
2423
90200,

packages/pg/test/integration/connection/copy-tests.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ var assert = require('assert')
44

55
test('COPY FROM events check', function () {
66
helper.connect(function (con) {
7-
var stdinStream = con.query('COPY person FROM STDIN')
7+
con.query('COPY person FROM STDIN')
88
con.on('copyInResponse', function () {
99
con.endCopyFrom()
1010
})
@@ -28,7 +28,7 @@ test('COPY FROM events check', function () {
2828
})
2929
test('COPY TO events check', function () {
3030
helper.connect(function (con) {
31-
var stdoutStream = con.query('COPY person TO STDOUT')
31+
con.query('COPY person TO STDOUT')
3232
assert.emits(con, 'copyOutResponse', function () {}, 'backend should emit copyOutResponse after COPY TO query')
3333
assert.emits(con, 'copyData', function () {}, 'backend should emit copyData on every data row')
3434
assert.emits(

packages/pg/test/integration/connection/test-helper.js

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
var net = require('net')
33
var helper = require('../test-helper')
44
var Connection = require('../../../lib/connection')
5-
var utils = require('../../../lib/utils')
65
const crypto = require('../../../lib/crypto/utils')
76
var connect = function (callback) {
87
var username = helper.args.user

packages/pg/test/integration/domain-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ suite.test('with domain', function (cb) {
2929
assert.success(function (client, done) {
3030
assert(process.domain, 'no domain exists in connect callback')
3131
assert.equal(startingDomain, process.domain, 'domain was lost when checking out a client')
32-
var query = client.query(
32+
client.query(
3333
'SELECT NOW()',
3434
assert.success(function () {
3535
assert(process.domain, 'no domain exists in query callback')

packages/pg/test/integration/gh-issues/1542-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ suite.testAsync('BoundPool can be subclassed', async () => {
1717
suite.test('calling pg.Pool without new throws', () => {
1818
const Pool = helper.pg.Pool
1919
assert.throws(() => {
20-
const pool = Pool()
20+
Pool()
2121
})
2222
})

packages/pg/test/integration/gh-issues/2064-tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ suite.test('Password should not exist in util.inspect output', () => {
2525
suite.test('Password should not exist in json.stringfy output', () => {
2626
const pool = new helper.pg.Pool({ password })
2727
const client = new helper.pg.Client({ password })
28-
const depth = 20
2928
assert(JSON.stringify(pool).indexOf(password) === -1)
3029
assert(JSON.stringify(client).indexOf(password) === -1)
3130
})

packages/pg/test/integration/gh-issues/2303-tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ suite.test('SSL Key should not exist in util.inspect output', () => {
2525
suite.test('SSL Key should not exist in json.stringfy output', () => {
2626
const pool = new helper.pg.Pool({ ssl: { key: secret_value } })
2727
const client = new helper.pg.Client({ ssl: { key: secret_value } })
28-
const depth = 20
2928
assert(JSON.stringify(pool).indexOf(secret_value) === -1)
3029
assert(JSON.stringify(client).indexOf(secret_value) === -1)
3130
})

packages/pg/test/unit/client/early-disconnect-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var helper = require('./test-helper')
2+
require('./test-helper')
33
var net = require('net')
44
var pg = require('../../../lib/index.js')
55

packages/pg/test/unit/client/prepared-statement-tests.js

-2
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@ test('bound command', function () {
9090

9191
var portalClient = helper.client()
9292
var portalCon = portalClient.connection
93-
var portalParseArg = null
9493
portalCon.parse = function (arg) {
95-
portalParseArg = arg
9694
process.nextTick(function () {
9795
portalCon.emit('parseComplete')
9896
})

packages/pg/test/unit/client/query-queue-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var helper = require('./test-helper')
2+
require('./test-helper')
33
var Connection = require('../../../lib/connection')
44

55
test('drain', function () {

packages/pg/test/unit/client/result-metadata-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ var testForTag = function (tagText, callback) {
66
var client = helper.client()
77
client.connection.emit('readyForQuery')
88

9-
var query = client.query(
9+
client.query(
1010
'whatever',
1111
assert.calls((err, result) => {
1212
assert.ok(result != null, 'should pass something to this event')

packages/pg/test/unit/client/stream-and-query-error-interaction-tests.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
'use strict'
2-
var helper = require('./test-helper')
2+
require('./test-helper')
33
var Connection = require('../../../lib/connection')
44
var Client = require('../../../lib/client')
55

packages/pg/test/unit/client/throw-in-type-parser-tests.js

+1-6
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ const emitFakeEvents = (con) => {
3232
}
3333

3434
suite.test('emits error', function (done) {
35-
var handled
3635
var client = helper.client()
3736
var con = client.connection
3837
var query = client.query(new Query('whatever'))
@@ -45,14 +44,10 @@ suite.test('emits error', function (done) {
4544
})
4645

4746
suite.test('calls callback with error', function (done) {
48-
var handled
49-
50-
var callbackCalled = 0
51-
5247
var client = helper.client()
5348
var con = client.connection
5449
emitFakeEvents(con)
55-
var query = client.query('whatever', function (err) {
50+
client.query('whatever', function (err) {
5651
assert.equal(err, typeParserError)
5752
done()
5853
})

packages/pg/test/unit/connection-parameters/creation-tests.js

-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ suite.test('ssl is set on client', function () {
344344
sslrootcert: '/path/root.crt',
345345
},
346346
}
347-
var Client = require('../../../lib/client')
348347
var defaults = require('../../../lib/defaults')
349348
defaults.ssl = true
350349
var c = new ConnectionParameters(sourceConfig)

packages/pg/test/unit/utils-tests.js

-2
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,6 @@ test('prepareValue: Uint8Array array prepared properly', function () {
183183
})
184184

185185
test('prepareValue: objects with complex toPostgres prepared properly', function () {
186-
var buf = Buffer.from('zomgcustom!')
187186
var customType = {
188187
toPostgres: function () {
189188
return [1, 2]
@@ -214,7 +213,6 @@ test('prepareValue: objects with toPostgres receive prepareValue', function () {
214213
})
215214

216215
test('prepareValue: objects with circular toPostgres rejected', function () {
217-
var buf = Buffer.from('zomgcustom!')
218216
var customType = {
219217
toPostgres: function () {
220218
return {

0 commit comments

Comments
 (0)