Skip to content

Commit

Permalink
Fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodepalo committed Aug 7, 2023
1 parent 6d828a5 commit df02408
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
15 changes: 8 additions & 7 deletions src/hooks/use-input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@ const useInput = (inputHandler: Handler, options: Options = {}) => {
return;
}

const handleReadable = () => {
let data: string | null;
while ((data = stdin.read()) !== null) {
handleData(data);
}
};

const handleData = (data: string) => {
const keypress = parseKeypress(data);

Expand Down Expand Up @@ -196,6 +189,14 @@ const useInput = (inputHandler: Handler, options: Options = {}) => {
}
};

const handleReadable = () => {
let data;
// eslint-disable-next-line @typescript-eslint/ban-types
while ((data = stdin.read() as string | null) !== null) {
handleData(data);
}
};

stdin?.on('readable', handleReadable);

return () => {
Expand Down
3 changes: 2 additions & 1 deletion test/focus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import EventEmitter from 'node:events';
import React, {useEffect} from 'react';
import delay from 'delay';
import test from 'ava';
import {spy, stub, SinonStub} from 'sinon';
import {spy, stub} from 'sinon';

Check failure on line 5 in test/focus.tsx

View workflow job for this annotation

GitHub Actions / Node.js 14

'/home/runner/work/ink/ink/node_modules/sinon/pkg/sinon-esm.js' imported multiple times.

Check failure on line 5 in test/focus.tsx

View workflow job for this annotation

GitHub Actions / Node.js 18

'/home/runner/work/ink/ink/node_modules/sinon/pkg/sinon-esm.js' imported multiple times.
import type {SinonStub} from 'sinon';

Check failure on line 6 in test/focus.tsx

View workflow job for this annotation

GitHub Actions / Node.js 14

'/home/runner/work/ink/ink/node_modules/sinon/pkg/sinon-esm.js' imported multiple times.

Check failure on line 6 in test/focus.tsx

View workflow job for this annotation

GitHub Actions / Node.js 18

'/home/runner/work/ink/ink/node_modules/sinon/pkg/sinon-esm.js' imported multiple times.
import {render, Box, Text, useFocus, useFocusManager} from '../src/index.js';
import createStdout from './helpers/create-stdout.js';

Expand Down

0 comments on commit df02408

Please sign in to comment.