Skip to content

Commit

Permalink
Bump prettier and eslint (+ reformat whole project)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunolemos committed Jun 23, 2021
1 parent 2435eb2 commit df0bcf2
Show file tree
Hide file tree
Showing 81 changed files with 947 additions and 511 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module.exports = {
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:prettier/recommended',
'prettier/@typescript-eslint',
'prettier',
],
parser: '@typescript-eslint/parser',
parserOptions: {
Expand Down
14 changes: 7 additions & 7 deletions landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,16 @@
"@types/react-stripe-elements": "1.3.5",
"@types/stripe-v3": "3.1.9",
"@types/styled-jsx": "2.2.8",
"@typescript-eslint/eslint-plugin": "4.9.1",
"@typescript-eslint/parser": "4.9.1",
"eslint": "7.15.0",
"eslint-config-nextjs": "1.0.6",
"eslint-config-prettier": "7.0.0",
"eslint-plugin-prettier": "3.2.0",
"@typescript-eslint/eslint-plugin": "4.28.0",
"@typescript-eslint/parser": "4.28.0",
"eslint": "7.29.0",
"eslint-config-nextjs": "1.0.7",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"mkdirp": "1.0.4",
"node-fetch": "2.6.1",
"now": "21.0.1",
"prettier": "2.2.1",
"prettier": "2.3.1",
"shx": "0.3.3",
"ts-node": "9.1.1",
"typescript": "4.3.4"
Expand Down
13 changes: 7 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,19 +39,20 @@
},
"devDependencies": {
"@primer/octicons-v2": "canary",
"@typescript-eslint/eslint-plugin": "4.9.0",
"@typescript-eslint/parser": "4.9.0",
"@typescript-eslint/eslint-plugin": "4.28.0",
"@typescript-eslint/parser": "4.28.0",
"concurrently": "5.3.0",
"cross-env": "7.0.3",
"eslint": "7.15.0",
"eslint-config-prettier": "7.0.0",
"eslint-plugin-prettier": "3.2.0",
"eslint": "7.29.0",
"eslint-config-prettier": "8.3.0",
"eslint-plugin-prettier": "3.4.0",
"eslint-plugin-react": "7.24.0",
"husky": "4.3.4",
"lint-staged": "10.5.3",
"now": "21.0.1",
"patch-package": "6.2.2",
"postinstall-prepare": "1.0.1",
"prettier": "2.2.1",
"prettier": "2.3.1",
"shx": "0.3.3",
"typescript": "4.3.4"
},
Expand Down
7 changes: 4 additions & 3 deletions packages/components/src/components/AppGlobalStyles.web.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ export const AppGlobalStyles = React.memo(() => {

const styles = getStyles({ theme })

return useMemo(() => <style key="app-global-styles-inner">{styles}</style>, [
styles,
])
return useMemo(
() => <style key="app-global-styles-inner">{styles}</style>,
[styles],
)
})

AppGlobalStyles.displayName = 'AppGlobalStyles'
2 changes: 1 addition & 1 deletion packages/components/src/components/animated/helpers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Animated } from 'react-native'

export function createAnimatedComponent<
T extends React.ComponentClass<any, any>
T extends React.ComponentClass<any, any>,
>(component: T) {
return Animated.createAnimatedComponent(component)
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { createSpringAnimatedComponent } from './helpers'

export type SpringAnimatedActivityIndicatorProps = ActivityIndicatorProps

export const SpringAnimatedActivityIndicator = createSpringAnimatedComponent(
ActivityIndicator,
)
export const SpringAnimatedActivityIndicator =
createSpringAnimatedComponent(ActivityIndicator)
SpringAnimatedActivityIndicator.displayName = 'SpringAnimatedActivityIndicator'
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { createSpringAnimatedComponent } from './helpers'

export type SpringAnimatedImageWithLoadingProps = ImageWithLoadingProps

export const SpringAnimatedImageWithLoading = createSpringAnimatedComponent(
ImageWithLoading,
)
export const SpringAnimatedImageWithLoading =
createSpringAnimatedComponent(ImageWithLoading)
SpringAnimatedImageWithLoading.displayName = 'SpringAnimatedImageWithLoading'
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ import { createSpringAnimatedComponent } from './helpers'

export type SpringAnimatedSafeAreaViewProps = ViewProps

export const SpringAnimatedSafeAreaView = createSpringAnimatedComponent(
SafeAreaView,
)
export const SpringAnimatedSafeAreaView =
createSpringAnimatedComponent(SafeAreaView)
SpringAnimatedSafeAreaView.displayName = 'SpringAnimatedSafeAreaView'

export type SpringAnimatedSafeAreaView = SafeAreaView
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import { createSpringAnimatedComponent } from './helpers'

export type SpringAnimatedTouchableOpacityProps = TouchableOpacityProps

export const SpringAnimatedTouchableOpacity = createSpringAnimatedComponent(
TouchableOpacity,
)
export const SpringAnimatedTouchableOpacity =
createSpringAnimatedComponent(TouchableOpacity)
SpringAnimatedTouchableOpacity.displayName = 'SpringAnimatedTouchableOpacity'
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ export function createSpringAnimatedComponent<T extends ElementType<any>>(
component: T,
) {
// TODO: Fix type definition
return (animated(component) as unknown) as any // eslint-disable-line
return animated(component) as unknown as any // eslint-disable-line
}
30 changes: 15 additions & 15 deletions packages/components/src/components/cards/BaseCard.shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -948,9 +948,8 @@ function _getCardPropsForItem(
})()

const repoURL = repo.html_url || getRepoUrlFromOtherUrl(repo.url)
const { owner: repoOwnerName, repo: repoName } = getOwnerAndRepo(
repoFullName,
)
const { owner: repoOwnerName, repo: repoName } =
getOwnerAndRepo(repoFullName)

const reasonMetadata = getNotificationReasonMetadata(notification.reason)

Expand Down Expand Up @@ -1159,18 +1158,19 @@ function _getCardPropsForItem(
}

const _memoizedGetCardPropsForItemFnByColumnId = betterMemoize(
(_columnId: string) => (
type: ColumnSubscription['type'],
item: EnhancedItem,
ownerIsKnown: boolean,
plan: UserPlan | null | undefined,
repoIsKnown: boolean,
) =>
_getCardPropsForItem(type, item, {
ownerIsKnown,
plan,
repoIsKnown,
}),
(_columnId: string) =>
(
type: ColumnSubscription['type'],
item: EnhancedItem,
ownerIsKnown: boolean,
plan: UserPlan | null | undefined,
repoIsKnown: boolean,
) =>
_getCardPropsForItem(type, item, {
ownerIsKnown,
plan,
repoIsKnown,
}),
undefined,
10,
)
Expand Down
10 changes: 2 additions & 8 deletions packages/components/src/components/cards/CardsFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,8 @@ export interface CardsFooterProps {
}

export const CardsFooter = React.memo((props: CardsFooterProps) => {
const {
clearedAt,
columnId,
fetchNextPage,
isEmpty,
refresh,
topSpacing,
} = props
const { clearedAt, columnId, fetchNextPage, isEmpty, refresh, topSpacing } =
props

const dispatch = useDispatch()
const { sizename } = useAppLayout()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ export interface CardsOwnerFilterBarProps {
const ownersCacheByColumnId = new Map<string, Set<string>>()
const lastUsernameCacheByColumnId = new Map<string, string | undefined>()

export const cardsOwnerFilterBarTotalHeight = cardsGenericOwnerFilterBarTotalHeight
export const cardsOwnerFilterBarTotalHeight =
cardsGenericOwnerFilterBarTotalHeight

export const CardsOwnerFilterBar = React.memo(
(props: CardsOwnerFilterBarProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ const ScrollViewComponent = Platform.select<
() => ScrollViewWithOverlayProps['ScrollViewComponent']
>({
android: () => {
const GestureHandlerScrollView = require('react-native-gesture-handler')
.ScrollView
const GestureHandlerScrollView =
require('react-native-gesture-handler').ScrollView
return (p: ScrollViewProps) => (
<GestureHandlerScrollView {...p} nestedScrollEnabled />
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export interface CardsWatchingOwnerFilterBarProps {
key: string
}

export const cardsWatchingOwnerFilterBarTotalHeight = cardsGenericOwnerFilterBarTotalHeight
export const cardsWatchingOwnerFilterBarTotalHeight =
cardsGenericOwnerFilterBarTotalHeight

export const CardsWatchingOwnerFilterBar = React.memo(
(props: CardsWatchingOwnerFilterBarProps) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,8 @@ export interface GenericMessageWithButtonViewProps {

export const GenericMessageWithButtonView = React.memo(
(props: GenericMessageWithButtonViewProps) => {
const {
buttonView,
emoji,
footer,
fullCenter,
style,
subtitle,
title,
} = props
const { buttonView, emoji, footer, fullCenter, style, subtitle, title } =
props

const emojiImageURL = emoji ? getEmojiImageURL(emoji) : null

Expand Down
11 changes: 4 additions & 7 deletions packages/components/src/components/cards/SwipeableCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ export function SwipeableCard(props: CardWithLinkProps) {
)
}

const Content = useMemo(() => <CardWithLink {...props} isInsideSwipeable />, [
columnId,
item,
ownerIsKnown,
repoIsKnown,
type,
])
const Content = useMemo(
() => <CardWithLink {...props} isInsideSwipeable />,
[columnId, item, ownerIsKnown, repoIsKnown, type],
)

return (
<SwipeableRow
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ const renderScrollComponent = Platform.select<
() => FlatListProps<any>['renderScrollComponent']
>({
android: () => {
const GestureHandlerScrollView = require('react-native-gesture-handler')
.ScrollView
const GestureHandlerScrollView =
require('react-native-gesture-handler').ScrollView
return (p: any) => <GestureHandlerScrollView {...p} nestedScrollEnabled />
},
default: () => undefined,
Expand Down
22 changes: 10 additions & 12 deletions packages/components/src/components/columns/ColumnFilters.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,9 +133,10 @@ export const ColumnFilters = React.memo((props: ColumnFiltersProps) => {
ownerFilters,
ownerFiltersWithRepos,
repoFilters,
} = useMemo(() => getOwnerAndRepoFormattedFilter(column && column.filters), [
column && column.filters,
])
} = useMemo(
() => getOwnerAndRepoFormattedFilter(column && column.filters),
[column && column.filters],
)

const ownerOrRepoFilteredItemsMetadata = useMemo(
() =>
Expand Down Expand Up @@ -1401,12 +1402,10 @@ export const ColumnFilters = React.memo((props: ColumnFiltersProps) => {
const isRepoFilterStrict =
filterRecordWithThisValueCount(repoFilters, true) >= 1

const ownerFilterHasForcedValue = filterRecordHasAnyForcedValue(
ownerFilters,
)
const repoFilterHasForcedValue = filterRecordHasAnyForcedValue(
repoFilters,
)
const ownerFilterHasForcedValue =
filterRecordHasAnyForcedValue(ownerFilters)
const repoFilterHasForcedValue =
filterRecordHasAnyForcedValue(repoFilters)

const owners = _.sortBy(
Object.keys(
Expand Down Expand Up @@ -1473,9 +1472,8 @@ export const ColumnFilters = React.memo((props: ColumnFiltersProps) => {
defaultBooleanValue,
) >= 1

const thisOwnerRepoFilterHasForcedValue = filterRecordHasAnyForcedValue(
thisOwnerRepoFilters,
)
const thisOwnerRepoFilterHasForcedValue =
filterRecordHasAnyForcedValue(thisOwnerRepoFilters)

return (
<Fragment key={`owner-option-fragment-${owner}`}>
Expand Down
5 changes: 2 additions & 3 deletions packages/components/src/components/columns/ColumnHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,9 +93,8 @@ export function ColumnHeader(props: ColumnHeaderProps) {
const bannerMessage = useReduxState(selectors.bannerMessageSelector)
const plan = useReduxState(selectors.currentUserPlanSelector)
const { column } = useColumn(columnId || '')
const {
enablePushNotifications: enableDesktopPushNotifications,
} = useDesktopOptions()
const { enablePushNotifications: enableDesktopPushNotifications } =
useDesktopOptions()

const enableDesktopPushNotificationsOption = getColumnOption(
column,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@ import { ColumnFiltersRenderer } from './ColumnFiltersRenderer'
import { ColumnHeader } from './ColumnHeader'
import { ColumnOptionsAccordion } from './ColumnOptionsAccordion'

export function getColumnCardThemeColors({
isDark,
}: {
isDark: boolean
}): {
export function getColumnCardThemeColors({ isDark }: { isDark: boolean }): {
column: keyof ThemeColors
card: keyof ThemeColors
card__hover: keyof ThemeColors
Expand Down
7 changes: 3 additions & 4 deletions packages/components/src/components/columns/ModalColumn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,9 @@ export const ModalColumn = React.memo((props: ModalColumnProps) => {
>
<View style={sharedStyles.flex}>{children}</View>

{!([
'ADD_COLUMN',
'ADD_COLUMN_DETAILS',
] as ModalPayload['name'][]).includes(name) && (
{!(
['ADD_COLUMN', 'ADD_COLUMN_DETAILS'] as ModalPayload['name'][]
).includes(name) && (
<View
style={[
sharedStyles.fullWidth,
Expand Down
4 changes: 1 addition & 3 deletions packages/components/src/components/common/IconButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,9 +178,7 @@ export function IconButton(props: IconButtonProps) {
)
}

export function getIconButtonColors(
type?: IconButtonProps['type'],
): {
export function getIconButtonColors(type?: IconButtonProps['type']): {
foregroundThemeColor: keyof ThemeColors
tintBackgroundHoveredOpacity: number
tintBackgroundPressedOpacity: number
Expand Down
4 changes: 2 additions & 2 deletions packages/components/src/components/common/IntervalRefresh.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ export function IntervalRefresh(props: IntervalRefreshProps) {
useEffect(() => {
clearInterval(timerRef.current)

timerRef.current = (setInterval(() => {
timerRef.current = setInterval(() => {
setUpdatedTimes((prevValue) => prevValue + 1)
}, interval) as any) as number
}, interval) as any as number

return () => clearInterval(timerRef.current)
}, [interval])
Expand Down
Loading

0 comments on commit df0bcf2

Please sign in to comment.