Skip to content

Commit

Permalink
Upgrade Prettier to 1.14 (beta)
Browse files Browse the repository at this point in the history
  • Loading branch information
j-f1 committed Jul 18, 2018
1 parent 56b1fe7 commit fa1f3b1
Show file tree
Hide file tree
Showing 25 changed files with 758 additions and 177 deletions.
1 change: 0 additions & 1 deletion .eslintrc.yml
Expand Up @@ -93,4 +93,3 @@ parserOptions:
sourceType: module
ecmaFeatures:
jsx: true

10 changes: 6 additions & 4 deletions .github/config.yml
Expand Up @@ -4,10 +4,12 @@
requestInfoReplyComment: >
Thanks for reaching out!
We require the [template](https://github.com/desktop/desktop/blob/master/.github/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report) to be filled out with all new issues. We do this so that
we can be certain we have all the information we need to address your
submission efficiently. This allows the maintainers to spend more time fixing
bugs, implementing enhancements, and reviewing and merging pull requests.
We require the
[template](https://github.com/desktop/desktop/blob/master/.github/CONTRIBUTING.md#how-do-i-submit-a-good-bug-report)
to be filled out with all new issues. We do this so that we can be certain we
have all the information we need to address your submission efficiently. This
allows the maintainers to spend more time fixing bugs, implementing
enhancements, and reviewing and merging pull requests.
Thanks for understanding and meeting us halfway 😀
Expand Down
2 changes: 1 addition & 1 deletion .github/lock.yml
Expand Up @@ -4,4 +4,4 @@ lockLabel: locked-due-to-inactivity
lockComment: false
setLockReason: true
# Proposals need to be handled separately to normal issues
exemptLabels: ['future-proposal']
exemptLabels: ['future-proposal']
15 changes: 7 additions & 8 deletions .github/no-response.yml
Expand Up @@ -5,13 +5,12 @@ daysUntilClose: 14
# Label requiring a response
# TODO: also close `needs-reproduction` issues (blocked by https://github.com/probot/no-response/issues/11)
responseRequiredLabel: more-information-needed
# Comment to post when closing an issue due to lack of response.
# Comment to post when closing an issue due to lack of response.
closeComment: >
Thank you for your issue!
We haven’t gotten a response to our questions above.
With only the information that is currently in the issue,
we don’t have enough information to take action.
We’re going to close this but don’t hesitate to reach out
if you have or find the answers we need.
If you answer our questions above, a maintainer will reopen this issue.
We haven’t gotten a response to our questions above. With only the information
that is currently in the issue, we don’t have enough information to take
action. We’re going to close this but don’t hesitate to reach out if you have
or find the answers we need. If you answer our questions above, a maintainer
will reopen this issue.
6 changes: 3 additions & 3 deletions .prettierrc.yml
Expand Up @@ -4,6 +4,6 @@ semi: false
proseWrap: always

overrides:
- files: "*.scss"
options:
printWidth: 200
- files: '*.scss'
options:
printWidth: 200
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -38,7 +38,7 @@ branches:

language: node_js
node_js:
- "8.11.0"
- '8.11.0'

cache:
yarn: true
Expand All @@ -57,7 +57,8 @@ install:
- yarn install --force

script:
- yarn lint && yarn validate-changelog && yarn build:prod && yarn test:setup && yarn test
- yarn lint && yarn validate-changelog && yarn build:prod && yarn test:setup
&& yarn test

after_failure:
- yarn test:review
32 changes: 17 additions & 15 deletions app/src/lib/fuzzy-find.ts
Expand Up @@ -34,22 +34,24 @@ export function match<T, _K extends keyof T>(
// matching `query` against itself is a perfect match.
const maxScore = score(query, query, 1)
const result = items
.map((item): IMatch<T> => {
const matches: Array<ReadonlyArray<number>> = []
const itemTextArray = getKey(item)
itemTextArray.forEach(text => {
matches.push(fuzzAldrin.match(text, query, undefined, options))
})

return {
score: score(itemTextArray.join(''), query, maxScore),
item,
matches: {
title: matches[0],
subtitle: matches.length > 1 ? matches[1] : [],
},
.map(
(item): IMatch<T> => {
const matches: Array<ReadonlyArray<number>> = []
const itemTextArray = getKey(item)
itemTextArray.forEach(text => {
matches.push(fuzzAldrin.match(text, query, undefined, options))
})

return {
score: score(itemTextArray.join(''), query, maxScore),
item,
matches: {
title: matches[0],
subtitle: matches.length > 1 ? matches[1] : [],
},
}
}
})
)
.filter(
({ matches }) => matches.title.length > 0 || matches.subtitle.length > 0
)
Expand Down
3 changes: 1 addition & 2 deletions app/src/ui/clone-repository/clone-generic-repository.tsx
Expand Up @@ -41,8 +41,7 @@ export class CloneGenericRepository extends React.Component<
label={
<span>
Repository URL or GitHub username and repository
<br />
(<Ref>hubot/cool-repo</Ref>)
<br />(<Ref>hubot/cool-repo</Ref>)
</span>
}
/>
Expand Down
12 changes: 6 additions & 6 deletions app/src/ui/create-branch/create-branch-dialog.tsx
Expand Up @@ -155,7 +155,8 @@ export class CreateBranch extends React.Component<
<p>
You do not currently have any branch checked out (your HEAD reference
is detached). As such your new branch will be based on your currently
checked out commit ({tip.currentSha.substr(0, 7)}).
checked out commit ({tip.currentSha.substr(0, 7)}
).
</p>
)
} else if (tip.kind === TipState.Unborn) {
Expand All @@ -179,11 +180,10 @@ export class CreateBranch extends React.Component<
)
return (
<p>
Your new branch will be based on your currently checked out branch (<Ref
>
{currentBranch.name}
</Ref>). <Ref>{currentBranch.name}</Ref> is the {defaultBranchLink}{' '}
for your repository.
Your new branch will be based on your currently checked out branch (
<Ref>{currentBranch.name}</Ref>
). <Ref>{currentBranch.name}</Ref> is the {defaultBranchLink} for
your repository.
</p>
)
} else {
Expand Down
3 changes: 1 addition & 2 deletions app/src/ui/delete-branch/delete-branch-dialog.tsx
Expand Up @@ -43,8 +43,7 @@ export class DeleteBranch extends React.Component<
>
<DialogContent>
<p>
Delete branch <Ref>{this.props.branch.name}</Ref>?
<br />
Delete branch <Ref>{this.props.branch.name}</Ref>?<br />
This action cannot be undone.
</p>

Expand Down
12 changes: 6 additions & 6 deletions app/src/ui/diff/image-diffs/two-up.tsx
Expand Up @@ -56,9 +56,9 @@ export class TwoUp extends React.Component<ITwoUpProps, {}> {
/>

<div className="image-diff-footer">
<span className="strong">W:</span> {previousImageSize.width}px |{' '}
<span className="strong">H:</span> {previousImageSize.height}px |{' '}
<span className="strong">Size:</span>{' '}
<span className="strong">W:</span> {previousImageSize.width}
px | <span className="strong">H:</span> {previousImageSize.height}
px | <span className="strong">Size:</span>{' '}
{formatBytes(this.props.previous.bytes)}
</div>
</div>
Expand All @@ -72,9 +72,9 @@ export class TwoUp extends React.Component<ITwoUpProps, {}> {
/>

<div className="image-diff-footer">
<span className="strong">W:</span> {currentImageSize.width}px |{' '}
<span className="strong">H:</span> {currentImageSize.height}px |{' '}
<span className="strong">Size:</span>{' '}
<span className="strong">W:</span> {currentImageSize.width}
px | <span className="strong">H:</span> {currentImageSize.height}
px | <span className="strong">Size:</span>{' '}
{formatBytes(this.props.current.bytes)}
</div>
</div>
Expand Down
3 changes: 2 additions & 1 deletion app/src/ui/discard-changes/discard-changes-dialog.tsx
Expand Up @@ -69,7 +69,8 @@ export class DiscardChanges extends React.Component<
<DialogContent>
{this.renderFileList()}
<p>
Changes can be restored by retrieving them from the {TrashNameLabel}.
Changes can be restored by retrieving them from the {TrashNameLabel}
.
</p>
{this.renderConfirmDiscardChanges()}
</DialogContent>
Expand Down
5 changes: 2 additions & 3 deletions app/src/ui/history/compare.tsx
Expand Up @@ -245,9 +245,8 @@ export class CompareSidebar extends React.Component<
</p>
) : (
<p>
Your branch is up to date with the compared branch (<Ref>
{currentlyComparedBranchName}
</Ref>)
Your branch is up to date with the compared branch (
<Ref>{currentlyComparedBranchName}</Ref>)
</p>
)
}
Expand Down
8 changes: 6 additions & 2 deletions app/src/ui/history/merge-call-to-action.tsx
Expand Up @@ -53,9 +53,13 @@ export class MergeCallToAction extends React.Component<
<div className="merge-message">
This will merge
<strong>{` ${count} ${pluralized}`}</strong>
{` `}from{` `}
{` `}
from
{` `}
<strong>{branch.name}</strong>
{` `}into{` `}
{` `}
into
{` `}
<strong>{currentBranch.name}</strong>
</div>
)
Expand Down
5 changes: 2 additions & 3 deletions app/src/ui/notification/new-commits-banner.tsx
Expand Up @@ -57,9 +57,8 @@ export class NewCommitsBanner extends React.Component<
<p>
We have noticed that your branch is{' '}
<strong>
{this.props.commitsBehindBaseBranch} commit{pluralize
? 's'
: ''}
{this.props.commitsBehindBaseBranch} commit
{pluralize ? 's' : ''}
</strong>{' '}
behind <Ref>{this.props.baseBranch.name}</Ref>.
</p>
Expand Down
6 changes: 3 additions & 3 deletions app/src/ui/remove-repository/confirm-remove-repository.tsx
Expand Up @@ -61,9 +61,9 @@ export class ConfirmRemoveRepository extends React.Component<
>
<DialogContent>
<p>
Are you sure you want to remove the repository "{
this.props.repository.name
}"?
Are you sure you want to remove the repository "
{this.props.repository.name}
"?
</p>
<p className="description">
The repository will be removed from GitHub Desktop.
Expand Down
11 changes: 7 additions & 4 deletions app/src/ui/terms-and-conditions/terms-and-conditions.tsx
Expand Up @@ -138,7 +138,8 @@ export class TermsAndConditions extends React.Component<
GitHub will process that information in accordance with the
<LinkButton uri={privacyStatement}>
GitHub Privacy Statement
</LinkButton>.
</LinkButton>
.
</p>

<h2>Additional Services</h2>
Expand Down Expand Up @@ -243,13 +244,15 @@ export class TermsAndConditions extends React.Component<
under the{' '}
<LinkButton uri={license}>
Creative Commons Attribution license
</LinkButton>. You may use it freely under the terms of the
Creative Commons license.
</LinkButton>
. You may use it freely under the terms of the Creative Commons
license.
</li>

<li>
Contact Us. Please send any questions about these Application
Terms to <LinkButton uri={contact}>support@github.com</LinkButton>.
Terms to <LinkButton uri={contact}>support@github.com</LinkButton>
.
</li>
</ol>
</DialogContent>
Expand Down
3 changes: 2 additions & 1 deletion app/src/ui/updates/update-available.tsx
Expand Up @@ -28,7 +28,8 @@ export class UpdateAvailable extends React.Component<
or{' '}
<LinkButton onClick={this.updateNow}>
restart GitHub Desktop
</LinkButton>.
</LinkButton>
.
</span>

<a className="close" onClick={this.dismiss}>
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Expand Up @@ -4,7 +4,7 @@ platform:
- x64

environment:
nodejs_version: "8.11"
nodejs_version: '8.11'

cache:
- .eslintcache
Expand All @@ -19,7 +19,7 @@ branches:

skip_tags: true

version: "{build}"
version: '{build}'

install:
- cmd: regedit /s script\default-to-tls12-on-appveyor.reg
Expand Down
11 changes: 6 additions & 5 deletions circle.yml
Expand Up @@ -11,10 +11,10 @@ machine:

dependencies:
cache_directories:
- ".eslintcache"
- "node_modules"
- "~/.electron"
- "~/Library/Caches/Yarn/v1"
- '.eslintcache'
- 'node_modules'
- '~/.electron'
- '~/Library/Caches/Yarn/v1'

pre:
- brew update
Expand All @@ -25,7 +25,8 @@ dependencies:
# everything is terrible, but we must march on
- brew link --overwrite node@8 --force
# workaround for yarn installation issue
- curl -o- -L https://yarnpkg.com/install.sh | TERM=xterm bash -s -- --version 1.5.1
- curl -o- -L https://yarnpkg.com/install.sh | TERM=xterm bash -s --
--version 1.5.1

override:
- yarn install --force
Expand Down
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -84,7 +84,7 @@
"node-sass": "^4.7.2",
"octicons": "^7.0.1",
"parallel-webpack": "^2.3.0",
"prettier": "1.13.0",
"prettier": "prettier/prettier#1a2c4e6",
"request": "^2.72.0",
"rimraf": "^2.5.2",
"sass-loader": "^7.0.1",
Expand Down
12 changes: 6 additions & 6 deletions script/electron-builder-linux.yml
@@ -1,11 +1,11 @@
productName: "GitHubDesktop"
artifactName: "${productName}-${os}-${arch}-${version}.${ext}"
productName: 'GitHubDesktop'
artifactName: '${productName}-${os}-${arch}-${version}.${ext}'
linux:
category: "GNOME;GTK;Development"
packageCategory: "GNOME;GTK;Development"
icon: "app/static/logos"
category: 'GNOME;GTK;Development'
packageCategory: 'GNOME;GTK;Development'
icon: 'app/static/logos'
target:
- deb
- rpm
- AppImage
maintainer: "GitHub, Inc <opensource+desktop@github.com>"
maintainer: 'GitHub, Inc <opensource+desktop@github.com>'
2 changes: 1 addition & 1 deletion script/prettier.ts
Expand Up @@ -12,7 +12,7 @@ const prettier = process.platform === 'win32' ? 'prettier.cmd' : 'prettier'
const prettierPath = Path.join(root, 'node_modules', '.bin', prettier)

const args = [
'**/*.scss',
'**/*.{scss,y{,a}ml}',
'app/**/*.{ts,tsx}',
'script/**/*.ts',
'--list-different',
Expand Down

0 comments on commit fa1f3b1

Please sign in to comment.