Skip to content

Commit

Permalink
fixup: eslintrc, type of func alias
Browse files Browse the repository at this point in the history
  • Loading branch information
taichunmin committed Jun 5, 2024
1 parent b76fca2 commit 0059a48
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 31 deletions.
25 changes: 13 additions & 12 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,14 @@ module.exports = {
plugins: ['eslint-plugin-tsdoc'],
extends: ['love'],
rules: {
'@typescript-eslint/no-unsafe-argument': 0, // 0 = off, 1 = warn, 2 = error
'@typescript-eslint/non-nullable-type-assertion-style': 0, // 0 = off, 1 = warn, 2 = error
'@typescript-eslint/return-await': 0, // 0 = off, 1 = warn, 2 = error
'@typescript-eslint/strict-boolean-expressions': 0, // 0 = off, 1 = warn, 2 = error
'@typescript-eslint/unbound-method': 0, // 0 = off, 1 = warn, 2 = error
'multiline-ternary': 0, // 0 = off, 1 = warn, 2 = error
'no-return-await': 0, // 0 = off, 1 = warn, 2 = error
'tsdoc/syntax': ['warn', {
ignoreUndefinedTags: true,
}], // 0 = off, 1 = warn, 2 = error
'@typescript-eslint/no-unsafe-argument': 'off',
'@typescript-eslint/non-nullable-type-assertion-style': 'off',
'@typescript-eslint/return-await': 'off',
'@typescript-eslint/strict-boolean-expressions': 'off',
'@typescript-eslint/unbound-method': 'off',
'multiline-ternary': 'off',
'no-return-await': 'off',
'tsdoc/syntax': 'warn',
'comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
Expand All @@ -25,9 +23,12 @@ module.exports = {
}],
'@typescript-eslint/comma-dangle': ['error', {
arrays: 'always-multiline',
objects: 'always-multiline',
imports: 'always-multiline',
enums: 'always-multiline',
exports: 'always-multiline',
generics: 'always-multiline',
imports: 'always-multiline',
objects: 'always-multiline',
tuples: 'always-multiline',
functions: 'only-multiline',
}],
},
Expand Down
38 changes: 19 additions & 19 deletions lib/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1500,7 +1500,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readBigUInt64BE}.
* @group Method Aliases
*/
get readBigUint64BE (): Buffer['readBigUInt64BE'] { return this.readBigUInt64BE }
get readBigUint64BE (): this['readBigUInt64BE'] { return this.readBigUInt64BE }

/**
* Reads an unsigned, little-endian 64-bit integer from `buf` at the specified `offset`.
Expand All @@ -1523,7 +1523,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readBigUInt64LE}.
* @group Method Aliases
*/
get readBigUint64LE (): Buffer['readBigUInt64LE'] { return this.readBigUInt64LE }
get readBigUint64LE (): this['readBigUInt64LE'] { return this.readBigUInt64LE }

/**
* Reads a 64-bit, big-endian double from `buf` at the specified `offset`.
Expand Down Expand Up @@ -1739,7 +1739,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readUInt8}.
* @group Method Aliases
*/
get readUint8 (): Buffer['readUInt8'] { return this.readUInt8 }
get readUint8 (): this['readUInt8'] { return this.readUInt8 }

/**
* Reads an unsigned, big-endian 16-bit integer from `buf` at the specified `offset`.
Expand All @@ -1763,7 +1763,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readUInt16BE}.
* @group Method Aliases
*/
get readUint16BE (): Buffer['readUInt16BE'] { return this.readUInt16BE }
get readUint16BE (): this['readUInt16BE'] { return this.readUInt16BE }

/**
* Reads an unsigned, little-endian 16-bit integer from `buf` at the specified `offset`.
Expand All @@ -1787,7 +1787,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readUInt16LE}.
* @group Method Aliases
*/
get readUint16LE (): Buffer['readUInt16LE'] { return this.readUInt16LE }
get readUint16LE (): this['readUInt16LE'] { return this.readUInt16LE }

/**
* Reads an unsigned, big-endian 32-bit integer from `buf` at the specified `offset`.
Expand All @@ -1810,7 +1810,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readUInt32BE}.
* @group Method Aliases
*/
get readUint32BE (): Buffer['readUInt32BE'] { return this.readUInt32BE }
get readUint32BE (): this['readUInt32BE'] { return this.readUInt32BE }

/**
* Reads an unsigned, little-endian 32-bit integer from `buf` at the specified `offset`.
Expand All @@ -1833,7 +1833,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readUInt32LE}.
* @group Method Aliases
*/
get readUint32LE (): Buffer['readUInt32LE'] { return this.readUInt32LE }
get readUint32LE (): this['readUInt32LE'] { return this.readUInt32LE }

/**
* Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting up to 48 bits of accuracy.
Expand Down Expand Up @@ -1861,7 +1861,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readUIntBE}.
* @group Method Aliases
*/
get readUintBE (): Buffer['readUIntBE'] { return this.readUIntBE }
get readUintBE (): this['readUIntBE'] { return this.readUIntBE }

/**
* Reads `byteLength` number of bytes from `buf` at the specified `offset` and interprets the result as an unsigned big-endian integer supporting up to 48 bits of accuracy.
Expand Down Expand Up @@ -1889,7 +1889,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.readUIntLE}.
* @group Method Aliases
*/
get readUintLE (): Buffer['readUIntLE'] { return this.readUIntLE }
get readUintLE (): this['readUIntLE'] { return this.readUIntLE }

/**
* Reads a 16-bit, big-endian float from `buf` at the specified `offset`.
Expand Down Expand Up @@ -2400,7 +2400,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeBigUInt64BE}.
* @group Method Aliases
*/
get writeBigUint64BE (): Buffer['writeBigUInt64BE'] { return this.writeBigUInt64BE }
get writeBigUint64BE (): this['writeBigUInt64BE'] { return this.writeBigUInt64BE }

/**
* Writes `value` to `buf` at the specified `offset` as little-endian.
Expand All @@ -2426,7 +2426,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeBigUInt64LE}.
* @group Method Aliases
*/
get writeBigUint64LE (): Buffer['writeBigUInt64LE'] { return this.writeBigUInt64LE }
get writeBigUint64LE (): this['writeBigUInt64LE'] { return this.writeBigUInt64LE }

/**
* Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a JavaScript number. Behavior is undefined when `value` is anything other than a JavaScript number.
Expand Down Expand Up @@ -2724,7 +2724,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeUInt8}.
* @group Method Aliases
*/
get writeUint8 (): Buffer['writeUInt8'] { return this.writeUInt8 }
get writeUint8 (): this['writeUInt8'] { return this.writeUInt8 }

/**
* Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is anything other than an unsigned 16-bit integer.
Expand All @@ -2751,7 +2751,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeUInt16BE}.
* @group Method Aliases
*/
get writeUint16BE (): Buffer['writeUInt16BE'] { return this.writeUInt16BE }
get writeUint16BE (): this['writeUInt16BE'] { return this.writeUInt16BE }

/**
* Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 16-bit integer. Behavior is undefined when `value` is anything other than an unsigned 16-bit integer.
Expand All @@ -2778,7 +2778,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeUInt16LE}.
* @group Method Aliases
*/
get writeUint16LE (): Buffer['writeUInt16LE'] { return this.writeUInt16LE }
get writeUint16LE (): this['writeUInt16LE'] { return this.writeUInt16LE }

/**
* Writes `value` to `buf` at the specified `offset` as big-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is anything other than an unsigned 32-bit integer.
Expand All @@ -2804,7 +2804,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeUInt32BE}.
* @group Method Aliases
*/
get writeUint32BE (): Buffer['writeUInt32BE'] { return this.writeUInt32BE }
get writeUint32BE (): this['writeUInt32BE'] { return this.writeUInt32BE }

/**
* Writes `value` to `buf` at the specified `offset` as little-endian. The `value` must be a valid unsigned 32-bit integer. Behavior is undefined when `value` is anything other than an unsigned 32-bit integer.
Expand All @@ -2830,7 +2830,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeUInt32LE}.
* @group Method Aliases
*/
get writeUint32LE (): Buffer['writeUInt32LE'] { return this.writeUInt32LE }
get writeUint32LE (): this['writeUInt32LE'] { return this.writeUInt32LE }

/**
* Writes `byteLength` bytes of `value` to `buf` at the specified `offset` as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when `value` is anything other than an unsigned integer.
Expand Down Expand Up @@ -2862,7 +2862,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeUIntBE}.
* @group Method Aliases
*/
get writeUintBE (): Buffer['writeUIntBE'] { return this.writeUIntBE }
get writeUintBE (): this['writeUIntBE'] { return this.writeUIntBE }

/**
* Writes `byteLength` bytes of `value` to `buf` at the specified `offset` as little-endian. Supports up to 48 bits of accuracy. Behavior is undefined when `value` is anything other than an unsigned integer.
Expand Down Expand Up @@ -2894,7 +2894,7 @@ export class Buffer extends Uint8Array {
* Alias of {@link Buffer.writeUIntLE}.
* @group Method Aliases
*/
get writeUintLE (): Buffer['writeUIntLE'] { return this.writeUIntLE }
get writeUintLE (): this['writeUIntLE'] { return this.writeUIntLE }

/**
* Treats `buf` as a [most-significant bit](https://en.wikipedia.org/wiki/Most_significant_bit) array and write a bit at the specified bit offset.
Expand Down Expand Up @@ -3336,7 +3336,7 @@ enum Encoding {
latin1 = 'latin1',
ucs2 = 'ucs2',
utf16le = 'utf16le',
utf8 = 'utf8'
utf8 = 'utf8',
}
type KeyOfEncoding = keyof typeof Encoding

Expand Down

0 comments on commit 0059a48

Please sign in to comment.