Skip to content

Commit

Permalink
Prettier fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
brunolemos committed Dec 8, 2020
1 parent 9c950fd commit 86724e1
Show file tree
Hide file tree
Showing 21 changed files with 158 additions and 175 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
*.jsbundle
*.tsbuildinfo
.DS_Store
.eslintcache
.history
.jest
.now
.vscode
Pods
node_modules/
npm-debug.log
yarn-error.log
.now
1 change: 0 additions & 1 deletion .prettierrc.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
parser: 'typescript',
semi: false,
singleQuote: true,
trailingComma: 'all',
Expand Down
4 changes: 2 additions & 2 deletions landing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"compile": "cd .",
"deploy": "yarn compile && yarn now",
"export": "yarn run-scripts && next build && next export",
"format": "prettier --write '{.,src/**,pages/**}/*.{js,jsx,ts,tsx}'",
"format": "prettier --write '{.,src,pages}/**/*.{js,jsx,ts,tsx,json}'",
"lint": "eslint src",
"now": "now",
"postinstall": "yarn run-scripts",
Expand Down Expand Up @@ -58,4 +58,4 @@
"engines": {
"node": ">=12"
}
}
}
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,11 @@
}
},
"lint-staged": {
"*.{ts,tsx}": [
"eslint --fix --quiet",
"*.{js,jsx,ts,tsx}": [
"eslint --fix --quiet"
],
"*.{js,jsx,ts,tsx,json}": [
"prettier --write"
]
}
}
}
4 changes: 2 additions & 2 deletions packages/components/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"scripts": {
"compile": "tsc -b --incremental",
"clean": "shx rm -f *.tsbuildinfo && shx rm -rf dist/*",
"format": "prettier --write '{.,src}/**.{js,jsx,ts,tsx}'",
"format": "prettier --write '{.,src}/**/*.{js,jsx,ts,tsx,json}'",
"lint": "eslint src",
"prepare": "cd .. && yarn patch-package"
},
Expand Down Expand Up @@ -72,4 +72,4 @@
"peerDependencies": {
"eslint": "*"
}
}
}
174 changes: 87 additions & 87 deletions packages/components/src/components/modals/AddColumnDetailsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -825,24 +825,24 @@ function getNewColumnAndSubscriptions(
switch (subtype) {
case 'REPO_NOTIFICATIONS':
default: {
newSubscription = createSubscriptionObjectWithId<
NotificationColumnSubscriptionCreation
>({
params: {
...(defaultParams as any),
all: true,
participating: formValues.inbox === 'participating',
...(!!(repoOwnerAndRepo.owner && repoOwnerAndRepo.repo) && {
owner: repoOwnerAndRepo.owner,
repo: repoOwnerAndRepo.repo,
}),
newSubscription = createSubscriptionObjectWithId<NotificationColumnSubscriptionCreation>(
{
params: {
...(defaultParams as any),
all: true,
participating: formValues.inbox === 'participating',
...(!!(repoOwnerAndRepo.owner && repoOwnerAndRepo.repo) && {
owner: repoOwnerAndRepo.owner,
repo: repoOwnerAndRepo.repo,
}),
},
type,
subtype:
repoOwnerAndRepo.owner && repoOwnerAndRepo.repo
? 'REPO_NOTIFICATIONS'
: undefined,
},
type,
subtype:
repoOwnerAndRepo.owner && repoOwnerAndRepo.repo
? 'REPO_NOTIFICATIONS'
: undefined,
})
)
_newColumnFilters.notifications =
_newColumnFilters.notifications || {}
_newColumnFilters.notifications.participating =
Expand All @@ -865,44 +865,44 @@ function getNewColumnAndSubscriptions(
case 'ISSUES':
case 'PULLS':
default: {
newSubscription = createSubscriptionObjectWithId<
IssueOrPullRequestColumnSubscriptionCreation
>({
params: {
...(defaultParams as any),
owners: {
...(!!formValues.owner && {
[formValues.owner]: {
value: true,
repos: {},
},
}),

...(!!repoOwnerAndRepo.owner &&
!!repoOwnerAndRepo.repo && {
[repoOwnerAndRepo.owner]: {
newSubscription = createSubscriptionObjectWithId<IssueOrPullRequestColumnSubscriptionCreation>(
{
params: {
...(defaultParams as any),
owners: {
...(!!formValues.owner && {
[formValues.owner]: {
value: true,
repos: {
[repoOwnerAndRepo.repo]: true,
},
repos: {},
},
}),
},
involves: formValues.user
? {
[formValues.user]: true,
}
: undefined,
subjectType:
subtype === 'ISSUES'
? 'Issue'
: subtype === 'PULLS'
? 'PullRequest'

...(!!repoOwnerAndRepo.owner &&
!!repoOwnerAndRepo.repo && {
[repoOwnerAndRepo.owner]: {
value: true,
repos: {
[repoOwnerAndRepo.repo]: true,
},
},
}),
},
involves: formValues.user
? {
[formValues.user]: true,
}
: undefined,
subjectType:
subtype === 'ISSUES'
? 'Issue'
: subtype === 'PULLS'
? 'PullRequest'
: undefined,
},
type,
subtype,
},
type,
subtype,
})
)

_newColumnFilters.involves = newSubscription.params.involves
_newColumnFilters.subjectTypes = newSubscription.params.subjectType
Expand Down Expand Up @@ -936,32 +936,32 @@ function getNewColumnAndSubscriptions(
switch (subtype) {
case 'ORG_PUBLIC_EVENTS':
case 'USER_ORG_EVENTS': {
newSubscription = createSubscriptionObjectWithId<
ActivityColumnSubscriptionCreation
>({
params: {
...(defaultParams as any),
org: formValues.org,
username: subtype === 'USER_ORG_EVENTS' ? loggedUsername : '',
newSubscription = createSubscriptionObjectWithId<ActivityColumnSubscriptionCreation>(
{
params: {
...(defaultParams as any),
org: formValues.org,
username: subtype === 'USER_ORG_EVENTS' ? loggedUsername : '',
},
type,
subtype,
},
type,
subtype,
})
)
filterBotsForksAndStarsOut()

break
}

case 'PUBLIC_EVENTS': {
newSubscription = createSubscriptionObjectWithId<
ActivityColumnSubscriptionCreation
>({
params: {
...(defaultParams as any),
newSubscription = createSubscriptionObjectWithId<ActivityColumnSubscriptionCreation>(
{
params: {
...(defaultParams as any),
},
type,
subtype,
},
type,
subtype,
})
)
filterBotsForksAndStarsOut()

break
Expand All @@ -971,17 +971,17 @@ function getNewColumnAndSubscriptions(
case 'REPO_NETWORK_EVENTS': {
if (!(repoOwnerAndRepo.owner && repoOwnerAndRepo.repo)) return null

newSubscription = createSubscriptionObjectWithId<
ActivityColumnSubscriptionCreation
>({
params: {
...(defaultParams as any),
owner: repoOwnerAndRepo.owner,
repo: repoOwnerAndRepo.repo,
newSubscription = createSubscriptionObjectWithId<ActivityColumnSubscriptionCreation>(
{
params: {
...(defaultParams as any),
owner: repoOwnerAndRepo.owner,
repo: repoOwnerAndRepo.repo,
},
type,
subtype,
},
type,
subtype,
})
)
filterBotsForksAndStarsOut()

break
Expand All @@ -993,16 +993,16 @@ function getNewColumnAndSubscriptions(
case 'USER_RECEIVED_PUBLIC_EVENTS': {
if (!formValues.user) return null

newSubscription = createSubscriptionObjectWithId<
ActivityColumnSubscriptionCreation
>({
params: {
...(defaultParams as any),
username: formValues.user,
newSubscription = createSubscriptionObjectWithId<ActivityColumnSubscriptionCreation>(
{
params: {
...(defaultParams as any),
username: formValues.user,
},
type,
subtype,
},
type,
subtype,
})
)

if (subtype === 'USER_RECEIVED_EVENTS') {
newColumnFilters.subjectTypes = newColumnFilters.subjectTypes || {
Expand Down
4 changes: 1 addition & 3 deletions packages/components/src/libs/swipeable/AppleSwipeableRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@ export interface AppleSwipeableRowAction extends BaseSwipeableRowAction {
label: string
}

export type AppleSwipeableRowProps = BaseSwipeableRowProps<
AppleSwipeableRowAction
>
export type AppleSwipeableRowProps = BaseSwipeableRowProps<AppleSwipeableRowAction>

export class AppleSwipeableRow extends BaseSwipeableRow<
AppleSwipeableRowProps,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ export type GoogleSwipeableRowAction = BaseSwipeableRowAction & {
icon: IconProp
}

export type GoogleSwipeableRowProps = BaseSwipeableRowProps<
GoogleSwipeableRowAction
>
export type GoogleSwipeableRowProps = BaseSwipeableRowProps<GoogleSwipeableRowAction>

const AnimatedOcticons = Animated.createAnimatedComponent(Octicons)
const AnimatedMaterialIcons = Animated.createAnimatedComponent(MaterialIcons)
Expand Down
7 changes: 3 additions & 4 deletions packages/components/src/redux/migrations.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,10 +266,9 @@ export default {
)
return

const oldTypesFilter: Partial<Record<
GitHubEvent['type'],
boolean
>> = (column.filters.activity as any).types
const oldTypesFilter: Partial<
Record<GitHubEvent['type'], boolean>
> = (column.filters.activity as any).types

column.filters.subjectTypes = column.filters.subjectTypes || {}
column.filters.activity.actions = column.filters.activity.actions || {}
Expand Down
Loading

0 comments on commit 86724e1

Please sign in to comment.