Skip to content

Commit

Permalink
Bump eslint to v9
Browse files Browse the repository at this point in the history
  • Loading branch information
evanpurkhiser committed Nov 26, 2024
1 parent a18a37d commit d50e160
Show file tree
Hide file tree
Showing 6 changed files with 985 additions and 595 deletions.
10 changes: 0 additions & 10 deletions .eslintrc.js

This file was deleted.

3 changes: 3 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {common} from '@evanpurkhiser/eslint-config';

export default [...common];
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,12 @@
"strict-event-emitter-types": "^2.0.0"
},
"devDependencies": {
"@evanpurkhiser/eslint-config": "^0.20.0",
"@evanpurkhiser/eslint-config": "^0.25.0",
"@types/jest": "^29.2.0",
"@types/stream-buffers": "^3.0.4",
"@types/webpack": "^5.28.0",
"@types/webpack-node-externals": "^2.5.3",
"eslint": "^8.45.0",
"eslint": "^9.15.0",
"eslint-plugin-jest": "^27.1.3",
"jest": "^29.7.0",
"jest-each": "^29.2.1",
Expand Down
8 changes: 3 additions & 5 deletions src/nfs/rpc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ export class RpcConnection {
this.mutex = new Mutex();
}

get connected() {
// TODO: Figure out what logic we can do here to determine if the socket is
// still open.
return true;
}
// TODO: Turn this into a getter and figure out what logic we can do here
// to determine if the socket is still open.
connected = true;

setupRequest({program, version, procedure, data}: Omit<RpcCall, 'port'>) {
const auth = new rpc.Auth({
Expand Down
28 changes: 10 additions & 18 deletions src/remotedb/fields.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,24 @@ export enum FieldType {
String = 0x26,
}

/**
* The generic interface for all field types
*/
export interface BaseField {
export abstract class BaseField {
// The constructor property (which is used to access the class from an
// instance of it) must be set to the BaseClass object so we can access the
// `.type` property.
//
// @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146
declare ['constructor']: typeof BaseField;

/**
* The raw field data
*/
data: Buffer;
declare data: Buffer;
/**
* Corce the field into a buffer. This differs from reading the data
* property in that it will include the field type header.
*/
readonly buffer: Buffer;
}
abstract buffer: Buffer;

export class BaseField {
/**
* Declares the type of field this class represents
*/
Expand All @@ -40,16 +42,6 @@ export class BaseField {
* reading the field type, returning the next number of bytes to read.
*/
static bytesToRead: number | ((reportedLength: number) => number);

// The constructor property (which is used to access the class from an
// instance of it) must be set to the BaseClass object so we can access the
// `.type` property.
//
// @see https://github.com/Microsoft/TypeScript/issues/3841#issuecomment-337560146
//
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
['constructor']: typeof BaseField;
}

export type NumberField<T extends number = number> = BaseField & {
Expand Down
Loading

0 comments on commit d50e160

Please sign in to comment.