Fix Flipper lints #10

Summary:
Grey -> gray. "Cancelled" seems quite common in APIs though, so I disabled that.
A few promise cleanups

Reviewed By: aigoncharov

Differential Revision: D31323610

fbshipit-source-id: c8863d995936f451c24eb408fe5c26677187f089
This commit is contained in:
Pascal Hartig
2021-10-01 08:07:16 -07:00
committed by Facebook GitHub Bot
parent fe3eda024b
commit 4aa7439fbf
8 changed files with 19 additions and 15 deletions

View File

@@ -104,7 +104,7 @@ module.exports = {
'flipper/no-relative-imports-across-packages': [2], 'flipper/no-relative-imports-across-packages': [2],
'flipper/no-electron-remote-imports': [1], 'flipper/no-electron-remote-imports': [1],
'flipper/no-console-error-without-context': [1], 'flipper/no-console-error-without-context': [1],
'communist-spelling/communist-spelling': [1], 'communist-spelling/communist-spelling': [1, {allow: ['cancelled']}],
// promise rules, see https://github.com/xjamundx/eslint-plugin-promise for details on each of them // promise rules, see https://github.com/xjamundx/eslint-plugin-promise for details on each of them
'promise/catch-or-return': 'warn', 'promise/catch-or-return': 'warn',

View File

@@ -14,7 +14,7 @@ import {Property} from 'csstype';
import React from 'react'; import React from 'react';
const defaultOptions = { const defaultOptions = {
backgroundColor: colors.blueGrey, backgroundColor: colors.blueGray,
position: 'below', position: 'below',
color: colors.white, color: colors.white,
showTail: true, showTail: true,

View File

@@ -87,15 +87,15 @@ export const colors = {
dark90: '#191919', // Dark 90 Nav Bar, Tab Bar, Cards - Nav bar, tab bar, cards dark90: '#191919', // Dark 90 Nav Bar, Tab Bar, Cards - Nav bar, tab bar, cards
dark95: '#0d0d0d', // Dark 95 Background Wash - Background Wash dark95: '#0d0d0d', // Dark 95 Background Wash - Background Wash
// FIG Spectrum // FIG Spectrum
blueGrey: '#5f6673', // Blue Grey blueGray: '#5f6673', // Blue Grey
blueGreyDark3: '#23272f', // Blue Grey - Dark 3 blueGrayDark3: '#23272f', // Blue Grey - Dark 3
blueGreyDark2: '#303846', // Blue Grey - Dark 2 blueGrayDark2: '#303846', // Blue Grey - Dark 2
blueGreyDark1: '#4f5766', // Blue Grey - Dark 1 blueGrayDark1: '#4f5766', // Blue Grey - Dark 1
blueGreyTint15: '#777d88', // Blue Grey - Tint 15 blueGrayTint15: '#777d88', // Blue Grey - Tint 15
blueGreyTint30: '#8f949d', // Blue Grey - Tint 30 blueGrayTint30: '#8f949d', // Blue Grey - Tint 30
blueGreyTint50: '#afb3b9', // Blue Grey - Tint 50 blueGrayTint50: '#afb3b9', // Blue Grey - Tint 50
blueGreyTint70: '#cfd1d5', // Blue Grey - Tint 70 blueGrayTint70: '#cfd1d5', // Blue Grey - Tint 70
blueGreyTint90: '#eff0f1', // Blue Grey - Tint 90 blueGrayTint90: '#eff0f1', // Blue Grey - Tint 90
slate: '#b9cad2', // Slate slate: '#b9cad2', // Slate
slateDark3: '#688694', // Slate - Dark 3 slateDark3: '#688694', // Slate - Dark 3
slateDark2: '#89a1ac', // Slate - Dark 2 slateDark2: '#89a1ac', // Slate - Dark 2

View File

@@ -389,6 +389,7 @@ function createBasePluginResult(
deactivate: () => pluginInstance.deactivate(), deactivate: () => pluginInstance.deactivate(),
exportStateAsync: () => exportStateAsync: () =>
pluginInstance.exportState(createStubIdler(), () => {}), pluginInstance.exportState(createStubIdler(), () => {}),
// eslint-disable-next-line node/no-sync
exportState: () => pluginInstance.exportStateSync(), exportState: () => pluginInstance.exportStateSync(),
triggerDeepLink: async (deepLink: unknown) => { triggerDeepLink: async (deepLink: unknown) => {
pluginInstance.triggerDeepLink(deepLink); pluginInstance.triggerDeepLink(deepLink);

View File

@@ -172,6 +172,7 @@ export function wrapInteractionHandler<T extends Function>(
const initialEnd = Date.now(); const initialEnd = Date.now();
if (typeof res?.then === 'function' && typeof res?.catch === 'function') { if (typeof res?.then === 'function' && typeof res?.catch === 'function') {
// async / promise // async / promise
// eslint-disable-next-line promise/catch-or-return
res.then( res.then(
() => r(initialEnd), () => r(initialEnd),
(error: any) => r(initialEnd, error), (error: any) => r(initialEnd, error),

View File

@@ -7,6 +7,8 @@
* @format * @format
*/ */
/* eslint-disable promise/catch-or-return */
import {render, fireEvent} from '@testing-library/react'; import {render, fireEvent} from '@testing-library/react';
import {TestUtils} from '../../'; import {TestUtils} from '../../';
import {sleep} from '../../utils/sleep'; import {sleep} from '../../utils/sleep';

View File

@@ -27,7 +27,7 @@ export const presetColors = Object.values({
blue: '#4267b2', // Blue - Active-state nav glyphs, nav bars, links, buttons blue: '#4267b2', // Blue - Active-state nav glyphs, nav bars, links, buttons
green: '#42b72a', // Green - Confirmation, success, commerce and status green: '#42b72a', // Green - Confirmation, success, commerce and status
red: '#FC3A4B', // Red - Badges, error states red: '#FC3A4B', // Red - Badges, error states
blueGrey: '#5f6673', // Blue Grey blueGray: '#5f6673', // Blue Grey
slate: '#b9cad2', // Slate slate: '#b9cad2', // Slate
aluminum: '#a3cedf', // Aluminum aluminum: '#a3cedf', // Aluminum
seaFoam: '#54c7ec', // Sea Foam seaFoam: '#54c7ec', // Sea Foam

View File

@@ -37,7 +37,7 @@ const ScreenshotContainer = styled.div({
width: 200, width: 200,
minWidth: 200, minWidth: 200,
overflow: 'hidden', overflow: 'hidden',
borderLeft: `1px ${colors.blueGreyTint90} solid`, borderLeft: `1px ${colors.blueGrayTint90} solid`,
position: 'relative', position: 'relative',
height: '100%', height: '100%',
borderRadius: 10, borderRadius: 10,
@@ -61,7 +61,7 @@ const NavigationDataContainer = styled.div({
const Footer = styled.div({ const Footer = styled.div({
width: '100%', width: '100%',
padding: '10px', padding: '10px',
borderTop: `1px ${colors.blueGreyTint90} solid`, borderTop: `1px ${colors.blueGrayTint90} solid`,
display: 'flex', display: 'flex',
alignItems: 'center', alignItems: 'center',
}); });
@@ -92,7 +92,7 @@ const Header = styled.div({
userSelect: 'text', userSelect: 'text',
cursor: 'text', cursor: 'text',
padding: 10, padding: 10,
borderBottom: `1px ${colors.blueGreyTint90} solid`, borderBottom: `1px ${colors.blueGrayTint90} solid`,
display: 'flex', display: 'flex',
}); });