-
Notifications
You must be signed in to change notification settings - Fork 60
Conversation
stevenvergenz
commented
Nov 13, 2019
- Update Typescript dependency to version 3.7.
- Replace the deprecated tslint with the new eslint.
- Port existing tslint rules to eslint (to the extent possible).
- Move some NPM tasks to VSCode tasks (no loss in NPM functionality).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! 👍👍👍
A few minor comments.
@@ -62,6 +62,7 @@ export default class StatsTest extends Test { | |||
const plainStats = stats as any; | |||
let pp = ''; | |||
for (const k in plainStats) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These three lines could be simplified to
for (const k of plainStats)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually that doesn't work for objects. https://stackoverflow.com/questions/8312459/iterate-through-object-properties
@@ -39,7 +39,7 @@ export default class UserTest extends Test { | |||
private formatProperties(props: { [key: string]: string }): string { | |||
let output = ""; | |||
for (const k in props) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also could be simplified to
for (const v of props)
@@ -15,7 +15,7 @@ export default function readPath(src: any, dst: any, ...path: string[]) { | |||
field = path.shift(); | |||
validateJsonFieldName(field); | |||
if (path.length) { | |||
if (!dst.hasOwnProperty(field)) { | |||
if (!Object.prototype.hasOwnProperty.call(dst, field)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Curious, what was the issue here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hasOwnProperty
could be an assigned property of the object, instead of being the built-in method.
What I was expecting: Convert In reply to: 554121429 [](ancestors = 554121429) Refers to: packages/sdk/src/adapters/multipeer/client.ts:61 in a304995. [](commit_id = a304995, deletion_comment = True) |