Skip to content

Commit d0f8231

Browse files
committed
fix: updated js-lint to 0.2.6, fixed some linting warnings, added a linting ignore for no-loss-of-precision for utils.test.ts
1 parent 7531003 commit d0f8231

File tree

4 files changed

+13
-11
lines changed

4 files changed

+13
-11
lines changed

package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
"uuid": "^8.3.2"
4040
},
4141
"devDependencies": {
42-
"@matrixai/lint": "^0.2.4",
42+
"@matrixai/lint": "^0.2.6",
4343
"@swc/core": "^1.3.62",
4444
"@swc/jest": "^0.2.29",
4545
"@types/jest": "^29.5.2",

src/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ function fromMultibase(idString: string): Id | undefined {
168168
let buffer: Uint8Array;
169169
try {
170170
buffer = codec.decode(idString);
171-
} catch (e) {
171+
} catch {
172172
return;
173173
}
174174
return IdInternal.create(buffer);

tests/utils.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,15 @@ describe('utils', () => {
9494
test('fixed point conversion', () => {
9595
// To 3 decimal places
9696
// we should expect .102 to be the resulting fractional
97+
// eslint-disable-next-line no-loss-of-precision
9798
const fp1 = 1633860855.1015312;
9899
const fixed1 = utils.toFixedPoint(fp1, 12, 3);
99100
expect(fixed1[1]).toBe(417);
100101
const fp1_ = utils.fromFixedPoint(fixed1, 12, 3);
101102
expect(fp1_).toBe(utils.roundPrecise(fp1, 3));
102103
// Also to 3 decimal places
103104
// expecting 0.101 now
105+
// eslint-disable-next-line no-loss-of-precision
104106
const fp2 = 1633860855.1014312;
105107
const fixed2 = utils.toFixedPoint(fp2, 12, 3);
106108
expect(fixed2[1]).toBe(413);

0 commit comments

Comments
 (0)