Skip to content

Commit 250a711

Browse files
committed
style: 💄 fix linter warnings
1 parent 8b56b29 commit 250a711

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+226
-222
lines changed

biome.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,14 @@
2727
"noParameterAssign": "off",
2828
"noCommaOperator": "off",
2929
"useSingleVarDeclarator": "off",
30-
"noUnusedTemplateLiteral": "off"
30+
"noUnusedTemplateLiteral": "off",
31+
"useDefaultParameterLast": "off"
3132
},
3233
"suspicious": {
3334
"noExplicitAny": "off",
3435
"useIsArray": "off",
35-
"noAssignInExpressions": "off"
36+
"noAssignInExpressions": "off",
37+
"noConfusingVoidType": "off"
3638
},
3739
"complexity": {
3840
"noStaticOnlyClass": "off",

src/__bench__/encode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import {TypeSystem} from '..';
44
import {CborEncoder} from '@jsonjoy.com/json-pack/lib/cbor/CborEncoder';
55
import {JsonEncoder} from '@jsonjoy.com/json-pack/lib/json/JsonEncoder';
6-
import {CompiledBinaryEncoder} from '../codegen/types';
6+
import type {CompiledBinaryEncoder} from '../codegen/types';
77
import {EncodingFormat} from '@jsonjoy.com/json-pack/lib/constants';
88
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';
99

src/__demos__/samples.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {CustomValidator, s} from '../../json-type';
1+
import {type CustomValidator, s} from '../../json-type';
22

33
export const customValidators: CustomValidator[] = [
44
{

src/codegen/binary/__tests__/CborEncoderCodegenContext.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {TypeSystem} from '../../../system';
1+
import type {TypeSystem} from '../../../system';
22
import {CborEncoder} from '@jsonjoy.com/json-pack/lib/cbor/CborEncoder';
33
import {CborDecoder} from '@jsonjoy.com/json-pack/lib/cbor/CborDecoder';
4-
import {Type} from '../../../type';
4+
import type {Type} from '../../../type';
55
import {testBinaryCodegen} from './testBinaryCodegen';
66
import {EncodingFormat} from '@jsonjoy.com/json-pack/lib/constants';
77
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';

src/codegen/binary/__tests__/JsonEncoderCodegenContext.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import {TypeSystem} from '../../../system';
2-
import {Type} from '../../../type';
1+
import type {TypeSystem} from '../../../system';
2+
import type {Type} from '../../../type';
33
import {testBinaryCodegen} from './testBinaryCodegen';
44
import {EncodingFormat} from '@jsonjoy.com/json-pack/lib/constants';
55
import {JsonEncoder} from '@jsonjoy.com/json-pack/lib/json/JsonEncoder';

src/codegen/binary/__tests__/MessagePackEncoderCodegenContext.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import {TypeSystem} from '../../../system';
1+
import type {TypeSystem} from '../../../system';
22
import {MsgPackEncoder} from '@jsonjoy.com/json-pack/lib/msgpack/MsgPackEncoder';
33
import {MsgPackDecoder} from '@jsonjoy.com/json-pack/lib/msgpack/MsgPackDecoder';
4-
import {Type} from '../../../type';
4+
import type {Type} from '../../../type';
55
import {testBinaryCodegen} from './testBinaryCodegen';
66
import {EncodingFormat} from '@jsonjoy.com/json-pack/lib/constants';
77
import {Writer} from '@jsonjoy.com/util/lib/buffers/Writer';

src/codegen/binary/__tests__/testBinaryCodegen.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import {TypeSystem} from '../../../system';
2-
import {Type} from '../../../type';
2+
import type {Type} from '../../../type';
33

44
export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, value: unknown) => void) => {
55
describe('"any" type', () => {
@@ -195,25 +195,25 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
195195
const system = new TypeSystem();
196196
const t = system.t;
197197
const type = t.obj;
198-
const value: {} = {};
198+
const value: any = {};
199199
expect(transcode(system, type, value)).toStrictEqual(value);
200200
});
201201

202202
test('can encode empty object, which has optional fields', () => {
203203
const system = new TypeSystem();
204204
const t = system.t;
205205
const type = t.Object(t.propOpt('field1', t.str));
206-
const value1: {} = {};
206+
const value1: any = {};
207207
expect(transcode(system, type, value1)).toStrictEqual(value1);
208-
const value2: {} = {field1: 'abc'};
208+
const value2: any = {field1: 'abc'};
209209
expect(transcode(system, type, value2)).toStrictEqual(value2);
210210
});
211211

212212
test('can encode fixed size object', () => {
213213
const system = new TypeSystem();
214214
const t = system.t;
215215
const type = t.Object(t.prop('field1', t.str), t.prop('field2', t.num), t.prop('bool', t.bool));
216-
const value: {} = {
216+
const value: any = {
217217
field1: 'abc',
218218
field2: 123,
219219
bool: true,
@@ -225,7 +225,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
225225
const system = new TypeSystem();
226226
const t = system.t;
227227
const type = t.Object(t.prop('id', t.str), t.propOpt('name', t.str));
228-
const value: {} = {
228+
const value: any = {
229229
id: 'xxxxx',
230230
name: 'Go Lang',
231231
};
@@ -241,7 +241,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
241241
t.prop('age', t.num),
242242
t.propOpt('address', t.str),
243243
);
244-
const value: {} = {
244+
const value: any = {
245245
id: 'xxxxx',
246246
name: 'Go Lang',
247247
age: 30,
@@ -256,7 +256,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
256256
const type = t
257257
.Object(t.prop('id', t.str), t.propOpt('name', t.str), t.prop('age', t.num), t.propOpt('address', t.str))
258258
.options({encodeUnknownFields: true});
259-
const value: {} = {
259+
const value: any = {
260260
id: 'xxxxx',
261261
name: 'Go Lang',
262262
____unknownField: 123,
@@ -320,7 +320,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
320320
const type = t
321321
.Object(t.propOpt('id', t.str), t.propOpt('name', t.str), t.propOpt('address', t.str))
322322
.options({encodeUnknownFields: true});
323-
let value: {} = {
323+
let value: any = {
324324
id: 'xxxxx',
325325
name: 'Go Lang',
326326
____unknownField: 123,
@@ -347,7 +347,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
347347
const type = t
348348
.Object(t.propOpt('id', t.str), t.propOpt('name', t.str), t.propOpt('address', t.str))
349349
.options({encodeUnknownFields: false});
350-
let value: {} = {
350+
let value: any = {
351351
id: 'xxxxx',
352352
name: 'Go Lang',
353353
address: '123 Main St',
@@ -374,31 +374,31 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
374374
const system = new TypeSystem();
375375
const t = system.t;
376376
const type = t.map;
377-
const value: {} = {};
377+
const value: any = {};
378378
expect(transcode(system, type, value)).toStrictEqual(value);
379379
});
380380

381381
test('can encode empty map with one key', () => {
382382
const system = new TypeSystem();
383383
const t = system.t;
384384
const type = t.map;
385-
const value: {} = {a: 'asdf'};
385+
const value: any = {a: 'asdf'};
386386
expect(transcode(system, type, value)).toStrictEqual(value);
387387
});
388388

389389
test('can encode typed map with two keys', () => {
390390
const system = new TypeSystem();
391391
const t = system.t;
392392
const type = t.Map(t.bool);
393-
const value: {} = {x: true, y: false};
393+
const value: any = {x: true, y: false};
394394
expect(transcode(system, type, value)).toStrictEqual(value);
395395
});
396396

397397
test('can encode nested maps', () => {
398398
const system = new TypeSystem();
399399
const t = system.t;
400400
const type = t.Map(t.Map(t.bool));
401-
const value: {} = {a: {x: true, y: false}};
401+
const value: any = {a: {x: true, y: false}};
402402
expect(transcode(system, type, value)).toStrictEqual(value);
403403
});
404404
});

src/codegen/json/__tests__/json.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Schema, s} from '../../../schema';
1+
import {type Schema, s} from '../../../schema';
22
import {TypeSystem} from '../../../system';
33

44
const exec = (schema: Schema, json: unknown, expected: unknown = json) => {

src/codegen/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import {BinaryJsonEncoder} from '@jsonjoy.com/json-pack/lib/types';
1+
import type {BinaryJsonEncoder} from '@jsonjoy.com/json-pack/lib/types';
22

33
export type CompiledBinaryEncoder = (value: unknown, encoder: BinaryJsonEncoder) => void;

src/codegen/validator/ValidatorCodegenContext.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ export class ValidatorCodegenContext {
8989
}
9090
return out + "]'";
9191
}
92-
case 'object':
92+
// case 'object':
9393
default: {
9494
let out =
9595
'{code: ' +

0 commit comments

Comments
 (0)