Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lettertwo committed Feb 25, 2023
1 parent 6642678 commit 446d6a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/core/fs/src/CopyOnWriteToMemoryFS.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import type {
Dirent,
} from './types';
import type {FilePath} from '@parcel/types';
import type {Readable, Writable} from 'stream';

import {registerSerializableClass} from '@parcel/core';
import packageJSON from '../package.json';
Expand Down Expand Up @@ -132,6 +131,7 @@ export class CopyOnWriteToMemoryFS extends OverlayFS {
this.deleted.delete(to);
}

// eslint-disable-next-line require-await
async exists(filePath: FilePath): Promise<boolean> {
return this.existsSync(filePath);
}
Expand Down Expand Up @@ -166,6 +166,7 @@ export class CopyOnWriteToMemoryFS extends OverlayFS {
}
}

// eslint-disable-next-line require-await
async readdir(
dir: FilePath,
opts?: ReaddirOptions,
Expand Down Expand Up @@ -204,6 +205,7 @@ export class CopyOnWriteToMemoryFS extends OverlayFS {
return Array.from(entries.values());
}

/* eslint-disable require-await */
// $FlowFixMe[method-unbinding]
async readFile(
filePath: FilePath,
Expand All @@ -212,17 +214,20 @@ export class CopyOnWriteToMemoryFS extends OverlayFS {
Promise<Buffer | string> {
return this.readFileSync(filePath, encoding);
}
/* eslint-enable require-await */

// $FlowFixMe[method-unbinding]
readFileSync(filePath: FilePath, encoding: ?Encoding): Buffer | string {
filePath = this.realpathSync(filePath);
return super.readFileSync(filePath, encoding);
}

/* eslint-disable require-await */
// $FlowFixMe[method-unbinding]
async realpath(filePath: FilePath): Promise<FilePath> {
return this.realpathSync(filePath);
}
/* eslint-enable require-await */

// $FlowFixMe[method-unbinding]
realpathSync(filePath: FilePath): FilePath {
Expand All @@ -243,11 +248,13 @@ export class CopyOnWriteToMemoryFS extends OverlayFS {
}
}

/* eslint-disable require-await */
// $FlowFixMe[method-unbinding]
async stat(filePath: FilePath): // $FlowFixMe
Promise<Stats> {
return this.statSync(filePath);
}
/* eslint-enable require-await */

// $FlowFixMe[method-unbinding]
statSync(filePath: FilePath): Stats {
Expand Down

0 comments on commit 446d6a4

Please sign in to comment.