mark unused vars as errors

Reviewed By: lblasa

Differential Revision: D50500690

fbshipit-source-id: 6f739fe25c232ecfe842337af4399681e85f6a13
This commit is contained in:
Anton Kastritskiy
2023-10-20 12:44:58 -07:00
committed by Facebook GitHub Bot
parent 4834fda6fa
commit 663380e721
14 changed files with 11 additions and 28 deletions

View File

@@ -204,7 +204,7 @@ module.exports = {
'no-dupe-class-members': 0, 'no-dupe-class-members': 0,
'@typescript-eslint/no-redeclare': 1, '@typescript-eslint/no-redeclare': 1,
'@typescript-eslint/no-unused-vars': [ '@typescript-eslint/no-unused-vars': [
1, 2,
{ {
ignoreRestSiblings: true, ignoreRestSiblings: true,
varsIgnorePattern: '^_', varsIgnorePattern: '^_',

View File

@@ -22,7 +22,6 @@ import {
checkPortInUse, checkPortInUse,
getAuthToken, getAuthToken,
getEnvironmentInfo, getEnvironmentInfo,
hasAuthToken,
setupPrefetcher, setupPrefetcher,
startFlipperServer, startFlipperServer,
startServer, startServer,

View File

@@ -7,7 +7,7 @@
* @format * @format
*/ */
import React, {CSSProperties, forwardRef} from 'react'; import React from 'react';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { import {
normalizePadding, normalizePadding,

View File

@@ -16,7 +16,6 @@ import React, {
} from 'react'; } from 'react';
import {Badge, Tooltip, Typography, Button} from 'antd'; import {Badge, Tooltip, Typography, Button} from 'antd';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import {keyframes} from '@emotion/css';
import reactElementToJSXString from 'react-element-to-jsx-string'; import reactElementToJSXString from 'react-element-to-jsx-string';
import {SandyPluginContext} from '../plugin/PluginContext'; import {SandyPluginContext} from '../plugin/PluginContext';
import {createState} from 'flipper-plugin-core'; import {createState} from 'flipper-plugin-core';

View File

@@ -7,15 +7,9 @@
* @format * @format
*/ */
import React, {CSSProperties, forwardRef} from 'react'; import React, {CSSProperties} from 'react';
import styled from '@emotion/styled'; import styled from '@emotion/styled';
import { import {normalizeSpace, Spacing, theme} from './theme';
normalizePadding,
normalizeSpace,
PaddingProps,
Spacing,
theme,
} from './theme';
import type {SplitLayoutProps} from './Layout'; import type {SplitLayoutProps} from './Layout';
import {Sidebar} from './Sidebar'; import {Sidebar} from './Sidebar';

View File

@@ -27,7 +27,7 @@ export const ERR_NO_IDB_OR_XCODE_AVAILABLE =
export const ERR_PHYSICAL_DEVICE_LOGS_WITHOUT_IDB = export const ERR_PHYSICAL_DEVICE_LOGS_WITHOUT_IDB =
'Cannot provide logs from a physical device without idb.'; 'Cannot provide logs from a physical device without idb.';
// eslint-disable-next-line @typescript-eslint/naming-convention // eslint-disable-next-line @typescript-eslint/naming-convention, @typescript-eslint/no-unused-vars
type iOSSimulatorDevice = { type iOSSimulatorDevice = {
state: 'Booted' | 'Shutdown' | 'Shutting Down'; state: 'Booted' | 'Shutdown' | 'Shutting Down';
availability?: string; availability?: string;

View File

@@ -7,10 +7,7 @@
* @format * @format
*/ */
import os from 'os';
import xdgBasedir from 'xdg-basedir';
import net from 'net'; import net from 'net';
import fs from 'fs-extra';
import fetch from 'node-fetch'; import fetch from 'node-fetch';
import {EnvironmentInfo} from 'flipper-common'; import {EnvironmentInfo} from 'flipper-common';
import semver from 'semver'; import semver from 'semver';

View File

@@ -7,6 +7,8 @@
* @format * @format
*/ */
// otherwise there is an error with `declare global`
// eslint-disable-next-line @typescript-eslint/no-unused-vars
import type {RenderHost} from 'flipper-ui-core'; import type {RenderHost} from 'flipper-ui-core';
declare global { declare global {

View File

@@ -19,7 +19,7 @@ import {useCallback} from 'react';
import {useDispatch, useSelector} from 'react-redux'; import {useDispatch, useSelector} from 'react-redux';
import {PluginDefinition} from '../plugin'; import {PluginDefinition} from '../plugin';
import {startPluginDownload} from '../reducers/pluginDownloads'; import {startPluginDownload} from '../reducers/pluginDownloads';
import {loadPlugin, switchPlugin} from '../reducers/pluginManager'; import {switchPlugin} from '../reducers/pluginManager';
import { import {
getActiveClient, getActiveClient,
getPluginDownloadStatusMap, getPluginDownloadStatusMap,

View File

@@ -27,13 +27,6 @@ type Props = {
color: Color; color: Color;
}; };
const DefaultColor: Color = {
r: 255,
g: 255,
b: 255,
a: 1,
};
const CenteredContentContainer = styled.div(AutoMarginStyle); const CenteredContentContainer = styled.div(AutoMarginStyle);
const ObjectContainer = styled.div(ObjectContainerStyle); const ObjectContainer = styled.div(ObjectContainerStyle);
const NumberValue = styled.span(NumberAttributeValueStyle); const NumberValue = styled.span(NumberAttributeValueStyle);

View File

@@ -437,7 +437,7 @@ async function buildServerRelease() {
await fs.mkdirp(path.join(dir, 'static', 'defaultPlugins')); await fs.mkdirp(path.join(dir, 'static', 'defaultPlugins'));
await prepareDefaultPlugins(argv.channel === 'insiders'); await prepareDefaultPlugins(argv.channel === 'insiders');
await compileServerMain(false); await compileServerMain();
await copyStaticResources(dir, versionNumber); await copyStaticResources(dir, versionNumber);
await linkLocalDeps(dir); await linkLocalDeps(dir);
await downloadIcons(path.join(dir, 'static')); await downloadIcons(path.join(dir, 'static'));

View File

@@ -279,7 +279,7 @@ export function genMercurialRevision(): Promise<string | null> {
.catch(() => null); .catch(() => null);
} }
export async function compileServerMain(dev: boolean) { export async function compileServerMain() {
console.log('⚙️ Compiling server sources...'); console.log('⚙️ Compiling server sources...');
await exec(`cd ${serverDir} && yarn build`); await exec(`cd ${serverDir} && yarn build`);
console.log('✅ Compiled server sources.'); console.log('✅ Compiled server sources.');

View File

@@ -102,7 +102,7 @@ async function copyStaticResources() {
async function restartServer() { async function restartServer() {
try { try {
await compileServerMain(true); await compileServerMain();
await launchServer(true, ++startCount === 1); // only open on the first time await launchServer(true, ++startCount === 1); // only open on the first time
} catch (e) { } catch (e) {
console.error( console.error(

View File

@@ -16,7 +16,6 @@ import {EOL} from 'os';
import pmap from 'p-map'; import pmap from 'p-map';
import {rootDir} from './paths'; import {rootDir} from './paths';
import yargs from 'yargs'; import yargs from 'yargs';
import {isPluginJson} from 'flipper-common';
const argv = yargs const argv = yargs
.usage('yarn tsc-plugins [args]') .usage('yarn tsc-plugins [args]')