Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update linter peer dependencies #2168

Merged
merged 20 commits into from
Feb 7, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10,629 changes: 4,681 additions & 5,948 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,25 +21,25 @@
"@types/create-hash": "^1.2.2",
"@types/lodash": "^4.14.136",
"@types/mocha": "^9.0.0",
"@types/node": "^17.0.14",
"@types/node": "^18.11.15",
"@types/puppeteer": "5.4.6",
"@types/ws": "^8.2.0",
"@typescript-eslint/eslint-plugin": "^4.30.0",
"@typescript-eslint/parser": "^4.0.0",
"@xrplf/eslint-config": "^1.6.0",
"@typescript-eslint/eslint-plugin": "^5.28.0",
"@typescript-eslint/parser": "^5.0.0",
"@xrplf/eslint-config": "^1.9.0",
"@xrplf/prettier-config": "^1.5.0",
JST5000 marked this conversation as resolved.
Show resolved Hide resolved
"assert": "^2.0.0",
"buffer": "^6.0.2",
"chai": "^4.3.4",
"copyfiles": "^2.4.1",
"crypto-browserify": "^3.12.0",
"ejs": "^3.0.1",
"eslint": "^7.5.0",
"eslint": "^8.18.0",
"eslint-plugin-array-func": "^3.1.7",
"eslint-plugin-consistent-default-export-name": "^0.0.15",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-import": "^2.24.1",
"eslint-plugin-jsdoc": "^37.1.0",
"eslint-plugin-jsdoc": "^39.3.3",
"eslint-plugin-mocha": "^10.0.3",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier": "^4.0.0",
Expand Down
1 change: 1 addition & 0 deletions packages/ripple-address-codec/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ module.exports = {
'jsdoc/require-throws': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/require-param': 'off',
'jsdoc/check-examples': 'off',
JST5000 marked this conversation as resolved.
Show resolved Hide resolved
'tsdoc/syntax': 'off',
},
}
9 changes: 5 additions & 4 deletions packages/ripple-binary-codec/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module.exports = {
'jsdoc/require-description-complete-sentence': 'off',
'jsdoc/require-jsdoc': 'off',
'jsdoc/check-tag-names': 'off',
'jsdoc/check-examples': 'off',
'jsdoc/require-returns': 'off',
'jsdoc/require-hyphen-before-param-description': 'off',
'jsdoc/require-description': 'off',
Expand All @@ -103,19 +104,19 @@ module.exports = {
'max-lines-per-function': 'off',
'require-unicode-regexp': 'off',
'no-undef-init': 'off',
'curly': 'off',
'eqeqeq': 'off',
curly: 'off',
eqeqeq: 'off',
'no-console': 'off',
'max-classes-per-file': 'off',
'operator-assignment': 'off',
'class-methods-use-this': 'off',
'no-else-return': 'off',
'yoda': 'off',
yoda: 'off',
'max-depth': 'off',
'multiline-comment-style': 'off',
'one-var': 'off',
'no-negated-condition': 'off',
'radix': 'off',
radix: 'off',
'no-nested-ternary': 'off',
'no-useless-concat': 'off',
'object-shorthand': 'off',
Expand Down
1 change: 1 addition & 0 deletions packages/ripple-keypairs/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ module.exports = {
'jsdoc/require-returns': 'off',
'jsdoc/require-description-complete-sentence': 'off',
'jsdoc/check-tag-names': 'off',
'jsdoc/check-examples': 'off',
'jsdoc/no-types': 'off',
'tsdoc/syntax': 'off',
'import/order': 'off',
Expand Down
46 changes: 30 additions & 16 deletions packages/xrpl/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions packages/xrpl/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"https-proxy-agent": false
},
"dependencies": {
"@types/node": "^18.11.15",
"bignumber.js": "^9.0.0",
"bip32": "^2.0.6",
"bip39": "^3.0.4",
Expand Down
18 changes: 9 additions & 9 deletions packages/xrpl/src/Wallet/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,6 @@ class Wallet {
public readonly classicAddress: string
public readonly seed?: string

/**
* Alias for wallet.classicAddress.
*
* @returns The wallet's classic address.
*/
public get address(): string {
return this.classicAddress
}

/**
* Creates a new Wallet.
*
Expand All @@ -120,6 +111,15 @@ class Wallet {
this.seed = opts.seed
}

/**
* Alias for wallet.classicAddress.
*
* @returns The wallet's classic address.
*/
public get address(): string {
return this.classicAddress
}

/**
* Generates a new Wallet using a generated seed.
*
Expand Down
18 changes: 9 additions & 9 deletions packages/xrpl/src/client/WSWrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,15 @@ export default class WSWrapper extends EventEmitter {
}
}

/**
* Get the ready state of the websocket.
*
* @returns The Websocket's ready state.
*/
public get readyState(): number {
return this.ws.readyState
}

/**
* Closes the websocket.
*/
Expand All @@ -86,13 +95,4 @@ export default class WSWrapper extends EventEmitter {
public send(message: string): void {
this.ws.send(message)
}

/**
* Get the ready state of the websocket.
*
* @returns The Websocket's ready state.
*/
public get readyState(): number {
return this.ws.readyState
}
}
38 changes: 19 additions & 19 deletions packages/xrpl/src/client/connection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,24 @@ export class Connection extends EventEmitter {
}
}

/**
* Gets the state of the websocket.
*
* @returns The Websocket's ready state.
*/
private get state(): WebsocketState {
return this.ws ? this.ws.readyState : WebSocket.CLOSED
}

/**
* Returns whether the server should be connected.
*
* @returns Whether the server should be connected.
*/
private get shouldBeConnected(): boolean {
return this.ws !== null
}

/**
* Returns whether the websocket is connected.
*
Expand Down Expand Up @@ -360,7 +378,7 @@ export class Connection extends EventEmitter {
return this.url ?? ''
}

// eslint-disable-next-line @typescript-eslint/no-empty-function -- Does nothing on default
// eslint-disable-next-line @typescript-eslint/no-empty-function, class-methods-use-this -- Does nothing on default
public readonly trace: (id: string, message: string) => void = () => {}

/**
Expand Down Expand Up @@ -403,24 +421,6 @@ export class Connection extends EventEmitter {
}
}

/**
* Gets the state of the websocket.
*
* @returns The Websocket's ready state.
*/
private get state(): WebsocketState {
return this.ws ? this.ws.readyState : WebSocket.CLOSED
}

/**
* Returns whether the server should be connected.
*
* @returns Whether the server should be connected.
*/
private get shouldBeConnected(): boolean {
return this.ws !== null
}

/**
* Handler for what to do once the connection to the server is open.
*
Expand Down
1 change: 1 addition & 0 deletions packages/xrpl/src/client/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable jsdoc/require-jsdoc -- Request has many aliases, but they don't need unique docs */
/* eslint-disable @typescript-eslint/member-ordering -- TODO: remove when instance methods aren't members */
/* eslint-disable max-lines -- Client is a large file w/ lots of imports/exports */
import * as assert from 'assert'
Expand Down
1 change: 1 addition & 0 deletions packages/xrpl/src/models/transactions/checkCash.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/no-unnecessary-condition -- JavaScript users can always pass in undefined */
JST5000 marked this conversation as resolved.
Show resolved Hide resolved
/* eslint-disable complexity -- Necessary for validateCheckCash */
import { ValidationError } from '../../errors'
import { Amount } from '../common'
Expand Down
40 changes: 20 additions & 20 deletions packages/xrpl/src/utils/hashes/SHAMap/InnerNode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ class InnerNode extends Node {
this.empty = true
}

/**
* Get the hash of a LeafNode.
*
* @returns Hash of the LeafNode.
*/
public get hash(): string {
if (this.empty) {
return HEX_ZERO
}
let hex = ''
for (let iter = 0; iter <= SLOT_MAX; iter++) {
const child = this.leaves[iter]
const hash: string = child == null ? HEX_ZERO : child.hash
hex += hash
}

const prefix = HashPrefix.INNER_NODE.toString(HEX)
return sha512Half(prefix + hex)
}

/**
* Adds an item to the InnerNode.
*
Expand Down Expand Up @@ -99,26 +119,6 @@ class InnerNode extends Node {
}
return this.leaves[slot]
}

/**
* Get the hash of a LeafNode.
*
* @returns Hash of the LeafNode.
*/
public get hash(): string {
if (this.empty) {
return HEX_ZERO
}
let hex = ''
for (let iter = 0; iter <= SLOT_MAX; iter++) {
const child = this.leaves[iter]
const hash: string = child == null ? HEX_ZERO : child.hash
hex += hash
}

const prefix = HashPrefix.INNER_NODE.toString(HEX)
return sha512Half(prefix + hex)
}
}

export default InnerNode
Loading