Skip to content

Commit

Permalink
Upgrade to Prettier 1.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
KyleAMathews committed Dec 6, 2017
1 parent 38a865f commit cc55e19
Show file tree
Hide file tree
Showing 49 changed files with 145 additions and 226 deletions.
3 changes: 1 addition & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ The usual contributing steps are:
* Run `npm run watch` from the root of the repo to first do an initial Babel
build of all packages and then watch for changes to packages' source code and
compile these changes on-the-fly as you work.
* Install [gatsby-dev-cli](/packages/gatsby-dev-cli/) globally: `yarn global add
gatsby-dev-cli`
* Install [gatsby-dev-cli](/packages/gatsby-dev-cli/) globally: `yarn global add gatsby-dev-cli`
* For each of your Gatsby test sites, run the `gatsby-dev` command there to copy
the built files from your cloned copy of Gatsby. It'll watch for your changes
to Gatsby packages and copy them into the site. For more detailed instructions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@ along with a modern css-in-js library
uses [Redux](http://redux.js.org/) to communicate with their Django API.

The marketing portion of the site loads quickly with minimal JavaScript. When a
potential customer goes to sign-up for the app, there's no *awkward jump from
the marketing website to the web app*—just a simple page change which seamlessly
potential customer goes to sign-up for the app, there's no _awkward jump from
the marketing website to the web app_—just a simple page change which seamlessly
loads in the needed JavaScript. The _team is sharing components and styles
across the site_ without stepping on each others shoes as they rapidly iterate
on features.
Expand Down
6 changes: 2 additions & 4 deletions docs/blog/2017-07-19-creating-a-blog-with-gatsby/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ project), `gatsby develop` (launch a hot-reload enabled web development server),
etc.

We can now begin the exciting task of _actually_ developing on the site, and
creating a functional, modern blog. You'll generally want to use `gatsby
develop` to launch the local development server to validate functionality as we
creating a functional, modern blog. You'll generally want to use `gatsby develop` to launch the local development server to validate functionality as we
progress through the steps.

## Adding necessary plugins
Expand Down Expand Up @@ -87,8 +86,7 @@ with the following command:
yarn add gatsby-plugin-catch-links gatsby-plugin-react-helmet
```

We're using [yarn][yarn], but npm can just as easily be used with `npm i --save
[deps]`.
We're using [yarn][yarn], but npm can just as easily be used with `npm i --save [deps]`.

After installing each of these functional plugins, we'll edit
`gatsby-config.js`, which Gatsby loads at build-time to implement the exposed
Expand Down
3 changes: 1 addition & 2 deletions docs/blog/2017-10-17-building-i18n-with-gatsby/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,7 @@ implementation in other projects.

To get started, you'll need to install a few packages:

`npm i -S i18next i18next-xhr-backend i18next-browser-languagedetector
react-i18next`
`npm i -S i18next i18next-xhr-backend i18next-browser-languagedetector react-i18next`

## Setting up

Expand Down
7 changes: 4 additions & 3 deletions docs/blog/2017-11-08-migrate-from-jekyll-to-gatsby/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,10 @@ exports.onCreateNode = ({ node, getNode, boundActionCreators }) => {
)

// create a new slug concatenating everything
const slug = `/${slugify(categories.concat([date]).join("-"), "/")}/${
title
}/`
const slug = `/${slugify(
categories.concat([date]).join("-"),
"/"
)}/${title}/`

createNodeField({ node, name: `slug`, value: slug })

Expand Down
4 changes: 2 additions & 2 deletions docs/blog/gatsby-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -296,8 +296,8 @@ along with a modern css-in-js library
uses [Redux](http://redux.js.org/) to communicate with their Django API.

The marketing portion of the site loads quickly with minimal JavaScript. When a
potential customer goes to sign-up for the app, there's no *awkward jump from
the marketing website to the web app*—just a simple page change which seamlessly
potential customer goes to sign-up for the app, there's no _awkward jump from
the marketing website to the web app_—just a simple page change which seamlessly
loads in the needed JavaScript. The _team is sharing components and styles
across the site_ without stepping on each others shoes as they rapidly iterate
on features.
Expand Down
3 changes: 1 addition & 2 deletions docs/docs/api-proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,5 @@ This way, when you `fetch('/api/todos')` in development, the development server
will recognize that it’s not a static asset, and will proxy your request to
`http://dev-mysite.com/api/todos` as a fallback.

Keep in mind that `proxy` only has effect in development (with `gatsby
develop`), and it is up to you to ensure that URLs like `/api/todos` point to
Keep in mind that `proxy` only has effect in development (with `gatsby develop`), and it is up to you to ensure that URLs like `/api/todos` point to
the right place in production.
3 changes: 1 addition & 2 deletions docs/docs/custom-html.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ the client like other components. If you want to dynamically update your

### Target container

If you see this error: `Uncaught Error: _registerComponent(...): Target
container is not a DOM element.` it means your `html.js` is missing the required
If you see this error: `Uncaught Error: _registerComponent(...): Target container is not a DOM element.` it means your `html.js` is missing the required
"target container". Inside your `<body>` you must have a div with an id of
`___gatsby` like:

Expand Down
3 changes: 1 addition & 2 deletions docs/docs/deploy-gatsby.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,7 @@ module.exports = {
If you have not yet initialized a git repository in your working gatsby site
repo, set up git in your project with `git init`. Then tell Gatsby where to
deploy your site by adding the git remote address with https or ssh. Here is how
to do it with https: `git remote add origin
git@github.com:username/project-name.git`.
to do it with https: `git remote add origin git@github.com:username/project-name.git`.

Now run `yarn deploy` or `npm run deploy`. Preview changes in your GitHub page
`https://username.github.io/project-name/`. You can also find the link to your
Expand Down
3 changes: 1 addition & 2 deletions docs/docs/gatsby-on-windows.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ see compilation errors such as `node-gyp` or `sharp` or `binding.gyp not found`.

If you suspect this is your problem, download the
[Visual Studio Community 2015 Package](https://www.visualstudio.com/products/visual-studio-community-vs)
and install only the part of the package that interests us : `Programming
languages > Visual C++ > Common tools for Visual Studio 2015`. Be sure to
and install only the part of the package that interests us : `Programming languages > Visual C++ > Common tools for Visual Studio 2015`. Be sure to
download the 2015 version of VS Community, not the 2017 version (see Note 1
below) ; you'll have to use the
[search bar on the VS site](https://www.visualstudio.com/products/visual-studio-community-vs)
Expand Down
10 changes: 3 additions & 7 deletions docs/docs/gatsby-style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -70,17 +70,15 @@ If you prefer to write locally before submitting a PR, then follow these steps:
3. Add a remote upstream so git knows where the official Gatsby Guides
repository is located by running the command `git remote add upstream`
_incomplete code here_
4. Create a new branch for your work with the command `git checkout -b
NEW-BRANCH-NAME`. Try to name your branch in a way that describes your
4. Create a new branch for your work with the command `git checkout -b NEW-BRANCH-NAME`. Try to name your branch in a way that describes your
article topic, like `fix/ArticleHTMLElements`
5. Write your article, commit your changes locally, and push your new branch to
GitHub with the command `git push origin NEW-BRANCH-NAME`
6. Go to your repository on GitHub and open a PR

Make sure to maintain your local fork going forward so it stays up-to-date with
the Gatsby guides repository. The next time you want to contribute, checkout
your local `master` branch and run the command `git pull --rebase upstream
master` before creating a new branch. This will grab all the changes on the
your local `master` branch and run the command `git pull --rebase upstream master` before creating a new branch. This will grab all the changes on the
official master branch without making an additional commit in your local
repository.

Expand All @@ -90,9 +88,7 @@ Finally, if you want to run a version of the guides repository locally, follow
these steps:

1. Ensure you have the yarn package manager installed `npm install -g yarn`
2. Fork this repository 👇 `git clone
https://github.com/YOUR-GITHUB-USERNAME/guides.git` `cd guides` `yarn
install` `yarn run dev`
2. Fork this repository 👇 `git clone https://github.com/YOUR-GITHUB-USERNAME/guides.git` `cd guides` `yarn install` `yarn run dev`

In this project we are using `yarn` because
[`Netlify`](https://www.netlify.com/) builds our site with `yarn`.
Expand Down
12 changes: 4 additions & 8 deletions docs/docs/migrating-from-v0-to-v1.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,7 @@ Here's an example of migrating a markdown wrapper to Gatsby v1.

Install Gatsby plugins for handling markdown files.

`npm install --save gatsby-source-filesystem@next gatsby-transformer-remark@next
gatsby-remark-copy-linked-files@next gatsby-remark-prismjs@next
gatsby-remark-responsive-iframe@next gatsby-remark-images@next
gatsby-remark-smartypants@next gatsby-plugin-sharp@next`
`npm install --save gatsby-source-filesystem@next gatsby-transformer-remark@next gatsby-remark-copy-linked-files@next gatsby-remark-prismjs@next gatsby-remark-responsive-iframe@next gatsby-remark-images@next gatsby-remark-smartypants@next gatsby-plugin-sharp@next`

Next add them to your `gatsby-config.js` file. Make your config file look
something like the following:
Expand Down Expand Up @@ -300,8 +297,7 @@ but in the meantime, check out http://graphql.org/ and play around on Gatsby's
built-in GraphQL IDE (Graph*i*QL) which can be reached when you start the
development server.

At this point you should have working markdown pages when you run `gatsby
develop`! Now start gradually adding back what you had in your wrapper component
At this point you should have working markdown pages when you run `gatsby develop`! Now start gradually adding back what you had in your wrapper component
adding HTML elements, styles, and extending the GraphQL query as needed.

Repeat this process for other wrapper components you were using.
Expand All @@ -323,12 +319,12 @@ your `html.js` should look like:
</body>
```

## _template.js is now src/layouts/index.js
## \_template.js is now src/layouts/index.js

You should be able to copy your `_template.js` file directly making only one
change making `this.props.children` a function call so `this.props.children()`.
The rational for this change is described
[in this PR comment](https://github.com/gatsbyjs/gatsby/pull/940#issuecomment-300878300).

Nested layouts (similar to the nested _template feature) are _not_ supported yet
Nested layouts (similar to the nested _template feature) are \_not_ supported yet
but are on the roadmap for v1.
2 changes: 1 addition & 1 deletion docs/tutorial/part-four/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -742,7 +742,7 @@ Let's get started.
So far, we've created pages by placing React components in `src/pages`. We'll
now learn how to _programmatically_ create pages from _data_. Gatsby is _not_
limited to making pages from files like many static site generators. Gatsby lets
you use GraphQL to query your _data_ and _map_ the data to *pages*—all at build
you use GraphQL to query your _data_ and _map_ the data to _pages_—all at build
time. This is a really powerful idea. We'll be exploring its implications and
ways to use it for the remainder of the tutorial.
Expand Down
6 changes: 2 additions & 4 deletions docs/tutorial/part-one/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,7 @@ Open a terminal window. See
[these instructions](http://www.macworld.co.uk/feature/mac-software/how-use-terminal-on-mac-3608274/)
for Mac users and
[these other instructions](https://www.quora.com/How-do-I-open-terminal-in-windows)
for Windows users. In your terminal window, type `node --version` then `npm
--version`.
for Windows users. In your terminal window, type `node --version` then `npm --version`.

You should see something like:

Expand Down Expand Up @@ -71,8 +70,7 @@ cd tutorial-part-one
gatsby develop
```

You should see shortly some text that says `The development server is listening
at:` [http://localhost:8000](http://localhost:8000). Open that address in your
You should see shortly some text that says `The development server is listening at:` [http://localhost:8000](http://localhost:8000). Open that address in your
browser and...

![Gatsby.js hello world](hello-world.png)
Expand Down
8 changes: 2 additions & 6 deletions examples/using-remark/src/utils/typography.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,10 @@ const options = {
// https://github.com/comfusion/after-dark/
// @see https://github.com/comfusion/after-dark/blob/8fdbe2f480ac40315cf0e01cece785d2b5c4b0c3/layouts/partials/critical-theme.css#L36-L39
".post a[href*='//']:after": {
content: `" " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23${
linkRaw
}'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E")`,
content: `" " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23${linkRaw}'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E")`,
},
".post a[href*='//']:hover:after": {
content: `" " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23${
linkHoverRaw
}'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E")`,
content: `" " url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20class='i-external'%20viewBox='0%200%2032%2032'%20width='14'%20height='14'%20fill='none'%20stroke='%23${linkHoverRaw}'%20stroke-linecap='round'%20stroke-linejoin='round'%20stroke-width='9.38%'%3E%3Cpath%20d='M14%209%20L3%209%203%2029%2023%2029%2023%2018%20M18%204%20L28%204%2028%2014%20M28%204%20L14%2018'/%3E%3C/svg%3E")`,
},
// Increase base font-size for phablet and desktop.
[presets.Phablet]: {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"jest-cli": "^20.0.4",
"lerna": "^2.1.1",
"plop": "^1.8.1",
"prettier": "^1.8.2",
"prettier": "^1.9.1",
"prettier-eslint-cli": "4.2.x",
"remotedev-server": "^0.2.3",
"rimraf": "^2.6.1"
Expand Down
4 changes: 1 addition & 3 deletions packages/gatsby-1-config-css-modules/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ const LOCAL_IDENT_NAME = `[path]---[name]---[local]---[hash:base64:5]`
exports.LOCAL_IDENT_NAME = LOCAL_IDENT_NAME

exports.cssModulesConfig = stage => {
const loader = `css?modules&minimize&importLoaders=1&localIdentName=${
LOCAL_IDENT_NAME
}`
const loader = `css?modules&minimize&importLoaders=1&localIdentName=${LOCAL_IDENT_NAME}`
return stage.startsWith(`build`) ? loader : `${loader}&sourceMap`
}
8 changes: 2 additions & 6 deletions packages/gatsby-cli/src/create-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,15 @@ function buildLocalCommands(cli, isLocalSite) {
resolveCwd.silent(`gatsby/dist/utils/${command}`)
if (!cmdPath)
return report.panic(
`There was a problem loading the local ${
command
} command. Gatsby may not be installed.`
`There was a problem loading the local ${command} command. Gatsby may not be installed.`
)

report.verbose(`loading local command from: ${cmdPath}`)
return require(cmdPath)
} catch (err) {
cli.showHelp()
return report.panic(
`There was a problem loading the local ${
command
} command. Gatsby may not be installed.`,
`There was a problem loading the local ${command} command. Gatsby may not be installed.`,
err
)
}
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-plugin-google-analytics/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ plugins: [
## The "anonymize" option

Some countries (such as Germany) require you to use the
[_anonymizeIP](https://support.google.com/analytics/answer/2763052) function for
[\_anonymizeIP](https://support.google.com/analytics/answer/2763052) function for
Google Analytics. Otherwise you are not allowed to use it. The option adds two
blocks to the code:

Expand Down
8 changes: 2 additions & 6 deletions packages/gatsby-plugin-netlify/src/build-headers-program.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,7 @@ function transformLink(manifest, publicFolder, pathPrefix) {
return `${prefix}${pathPrefix}${file}${suffix}`
} else {
throw new Error(
`Could not find the file specified in the Link header \`${
header
}\`.` +
`Could not find the file specified in the Link header \`${header}\`.` +
`The gatsby-plugin-netlify is looking for a matching file (with or without a ` +
`webpack hash). Check the public folder and your gatsby-config.js to ensure you are ` +
`pointing to a public file.`
Expand Down Expand Up @@ -140,9 +138,7 @@ const validateUserOptions = pluginOptions => headers => {
mergeOption => {
if (!_.isBoolean(pluginOptions[mergeOption])) {
throw new Error(
`The "${
mergeOption
}" option to gatsby-plugin-netlify must be a boolean. ` +
`The "${mergeOption}" option to gatsby-plugin-netlify must be a boolean. ` +
`Check your gatsby-config.js.`
)
}
Expand Down
10 changes: 4 additions & 6 deletions packages/gatsby-plugin-sharp/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,9 @@ function queueImageResizing({ file, args = {} }) {

const argsDigestShort = argsDigest.substr(argsDigest.length - 5)

const imgSrc = `/${file.name}-${file.internal.contentDigest}-${
argsDigestShort
}.${fileExtension}`
const imgSrc = `/${file.name}-${
file.internal.contentDigest
}-${argsDigestShort}.${fileExtension}`
const filePath = path.join(process.cwd(), `public`, `static`, imgSrc)

// Create function to call when the image is finished.
Expand Down Expand Up @@ -413,9 +413,7 @@ async function responsiveSizes({ file, args = {} }) {

// If the users didn't set a default sizes, we'll make one.
if (!options.sizes) {
options.sizes = `(max-width: ${presentationWidth}px) 100vw, ${
presentationWidth
}px`
options.sizes = `(max-width: ${presentationWidth}px) 100vw, ${presentationWidth}px`
}

// Create sizes (in width) for the image. If the max width of the container
Expand Down
3 changes: 1 addition & 2 deletions packages/gatsby-plugin-styled-components/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,4 @@ plugins: [`gatsby-plugin-styled-components`]
#### v2.0.1

`styled-components` is moved to a peer dependency. Installing the package
alongside `gatsby-plugin-styled-components` is now required. Use `yarn add
styled-components --save`
alongside `gatsby-plugin-styled-components` is now required. Use `yarn add styled-components --save`
3 changes: 1 addition & 2 deletions packages/gatsby-plugin-styled-jsx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ Provides drop-in support for [styled-jsx](https://github.com/zeit/styled-jsx).

## How to use

Add the plugin to the plugins array in your `gatsby-config.js` and use `<style
jsx>` tags in your component files.
Add the plugin to the plugins array in your `gatsby-config.js` and use `<style jsx>` tags in your component files.

```javascript
plugins: [`gatsby-plugin-styled-jsx`]
Expand Down
2 changes: 1 addition & 1 deletion packages/gatsby-remark-code-repls/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ with [reactjs.org](https://github.com/reactjs/reactjs.org):
* Examples (eg Codepens) were owned by a single author, so the community
couldn't contribute PRs to update them without forking and fragmenting
ownership.
* It was easy to create invalid links (eg Babel REPL links that _don't quite
* It was easy to create invalid links (eg Babel REPL links that \_don't quite
work).

## Overview
Expand Down
4 changes: 1 addition & 3 deletions packages/gatsby-remark-code-repls/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,7 @@ module.exports = (
// This config JSON must then be lz-string compressed
parameters = compress(JSON.stringify(parameters))

const href = `https://codesandbox.io/api/v1/sandboxes/define?parameters=${
parameters
}`
const href = `https://codesandbox.io/api/v1/sandboxes/define?parameters=${parameters}`
const text =
node.children.length === 0 ? defaultText : node.children[0].value

Expand Down
Loading

0 comments on commit cc55e19

Please sign in to comment.