diff --git a/packages/cli/src/commands/index.ts b/packages/cli/src/commands/index.ts index 3fb425892..18800a4ab 100644 --- a/packages/cli/src/commands/index.ts +++ b/packages/cli/src/commands/index.ts @@ -15,8 +15,7 @@ import install from './install/install'; // eslint-disable-line // @ts-ignore - JS file import uninstall from './install/uninstall'; // eslint-disable-line import upgrade from './upgrade/upgrade'; -// @ts-ignore - JS file -import info from './info/info'; // eslint-disable-line +import info from './info/info'; // @ts-ignore - JS file import config from './config/config'; // eslint-disable-line // @ts-ignore - JS file diff --git a/packages/cli/src/commands/info/__tests__/info.test.js b/packages/cli/src/commands/info/__tests__/info.test.ts similarity index 81% rename from packages/cli/src/commands/info/__tests__/info.test.js rename to packages/cli/src/commands/info/__tests__/info.test.ts index bea3af2c9..6635182e7 100644 --- a/packages/cli/src/commands/info/__tests__/info.test.js +++ b/packages/cli/src/commands/info/__tests__/info.test.ts @@ -1,6 +1,7 @@ // @flow import info from '../info'; import {logger} from '@react-native-community/cli-tools'; +// eslint-disable-next-line import/namespace, import/default import loadConfig from '../../../tools/config'; jest.mock('../../../tools/config'); @@ -12,11 +13,11 @@ beforeEach(() => { const config = loadConfig(); test('prints output without arguments', async () => { - await info.func([], config, {}); + await info.func([], config); expect(logger.info).toHaveBeenCalledWith( 'Fetching system and libraries information...', ); - const output = (logger.log: any).mock.calls[0][0]; + const output = (logger.log as jest.Mock).mock.calls[0][0]; // Checking on output that should be present on all OSes. // TODO: move to e2e tests and adjust expectations to include npm packages expect(output).toContain('System:'); diff --git a/packages/cli/src/commands/info/info.js b/packages/cli/src/commands/info/info.ts similarity index 85% rename from packages/cli/src/commands/info/info.js rename to packages/cli/src/commands/info/info.ts index 149f87459..2763de0dc 100644 --- a/packages/cli/src/commands/info/info.js +++ b/packages/cli/src/commands/info/info.ts @@ -3,20 +3,16 @@ * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - * - * @flow */ +// @ts-ignore untyped import envinfo from 'envinfo'; import {logger} from '@react-native-community/cli-tools'; -import type {ConfigT} from 'types'; +import {Config} from '@react-native-community/cli-types'; +// @ts-ignore - JS file import releaseChecker from '../../tools/releaseChecker'; -const info = async function getInfo( - argv: Array, - ctx: ConfigT, - options: {}, -) { +const info = async function getInfo(_argv: Array, ctx: Config) { try { logger.info('Fetching system and libraries information...'); const output = await envinfo.run({