Skip to content

Commit 2bda70e

Browse files
committed
Update to the latest Prettier
1 parent 422203e commit 2bda70e

File tree

43 files changed

+444
-318
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+444
-318
lines changed

examples/using-gatsby-image/src/components/navigation.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@ const NavItem = ({ title, to }) => (
3232
whiteSpace: `nowrap`,
3333
},
3434
"& .nav-link-active, & .nav-link:hover": {
35-
backgroundImage: `linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 1px, ${options.accentColor} 1px, ${options.accentColor} 2px, rgba(0, 0, 0, 0) 2px)`,
35+
backgroundImage: `linear-gradient(to top, rgba(0, 0, 0, 0), rgba(0, 0, 0, 0) 1px, ${
36+
options.accentColor
37+
} 1px, ${options.accentColor} 2px, rgba(0, 0, 0, 0) 2px)`,
3638
color: options.accentColor,
3739
opacity: 1,
3840
},

examples/using-remark/src/utils/typography.js

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,25 @@ const options = {
151151
".post a:not(.gatsby-resp-image-link):not(.anchor), .link-underline": {
152152
position: `relative`,
153153
backgroundImage: `linear-gradient(${colors.link},${colors.link})`,
154-
textShadow: `0.03em 0 ${colors.white}, -0.03em 0 ${colors.white}, 0 0.03em ${colors.white}, 0 -0.03em ${colors.white}, 0.06em 0 ${colors.white}, -0.06em 0 ${colors.white}, 0.09em 0 ${colors.white}, -0.09em 0 ${colors.white}, 0.12em 0 ${colors.white}, -0.12em 0 ${colors.white}, 0.15em 0 ${colors.white}, -0.15em 0 ${colors.white}`,
154+
textShadow: `0.03em 0 ${colors.white}, -0.03em 0 ${
155+
colors.white
156+
}, 0 0.03em ${colors.white}, 0 -0.03em ${colors.white}, 0.06em 0 ${
157+
colors.white
158+
}, -0.06em 0 ${colors.white}, 0.09em 0 ${colors.white}, -0.09em 0 ${
159+
colors.white
160+
}, 0.12em 0 ${colors.white}, -0.12em 0 ${colors.white}, 0.15em 0 ${
161+
colors.white
162+
}, -0.15em 0 ${colors.white}`,
155163
transition: `all 250ms cubic-bezier(0.4, 0, 0.2, 1)`,
156164
backgroundPosition: `0 98%`,
157165
backgroundRepeat: `repeat-x`,
158166
backgroundSize: `1px 1px`,
159167
},
160168
".post a:not(.gatsby-resp-image-link):not(.anchor):hover, .link-underline:hover": {
161169
color: `${colors.linkHover}`,
162-
backgroundImage: `linear-gradient(${colors.linkHover},${colors.linkHover})`,
170+
backgroundImage: `linear-gradient(${colors.linkHover},${
171+
colors.linkHover
172+
})`,
163173
},
164174
".post a.anchor": {
165175
textShadow: `0 !important`,
@@ -169,10 +179,14 @@ const options = {
169179
// https://github.com/comfusion/after-dark/
170180
// @see https://github.com/comfusion/after-dark/blob/8fdbe2f480ac40315cf0e01cece785d2b5c4b0c3/layouts/partials/critical-theme.css#L36-L39
171181
".post a[href*='//']:after": {
172-
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")`,
182+
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${
183+
linkRaw
184+
}'%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")`,
173185
},
174186
".post a[href*='//']:hover:after": {
175-
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")`,
187+
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${
188+
linkHoverRaw
189+
}'%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")`,
176190
},
177191
// Increase base font-size for phablet and desktop.
178192
[presets.Phablet]: {

packages/gatsby-1-config-css-modules/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ const LOCAL_IDENT_NAME = `[path]---[name]---[local]---[hash:base64:5]`
22
exports.LOCAL_IDENT_NAME = LOCAL_IDENT_NAME
33

44
exports.cssModulesConfig = stage => {
5-
const loader = `css?modules&minimize&importLoaders=1&localIdentName=${LOCAL_IDENT_NAME}`
5+
const loader = `css?modules&minimize&importLoaders=1&localIdentName=${
6+
LOCAL_IDENT_NAME
7+
}`
68
return stage.startsWith(`build`) ? loader : `${loader}&sourceMap`
79
}

packages/gatsby-cli/src/create-cli.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,19 @@ function buildLocalCommands(cli, isLocalSite) {
4141
resolveCwd.silent(`gatsby/dist/utils/${command}`)
4242
if (!cmdPath)
4343
return report.panic(
44-
`There was a problem loading the local ${command} command. Gatsby may not be installed.`
44+
`There was a problem loading the local ${
45+
command
46+
} command. Gatsby may not be installed.`
4547
)
4648

4749
report.verbose(`loading local command from: ${cmdPath}`)
4850
return require(cmdPath)
4951
} catch (err) {
5052
cli.showHelp()
5153
return report.panic(
52-
`There was a problem loading the local ${command} command. Gatsby may not be installed.`,
54+
`There was a problem loading the local ${
55+
command
56+
} command. Gatsby may not be installed.`,
5357
err
5458
)
5559
}

packages/gatsby-image/src/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -183,9 +183,9 @@ class Image extends React.Component {
183183
// The outer div is necessary to reset the z-index to 0.
184184
return (
185185
<div
186-
className={`${outerWrapperClassName
187-
? outerWrapperClassName
188-
: ``} gatsby-image-outer-wrapper`}
186+
className={`${
187+
outerWrapperClassName ? outerWrapperClassName : ``
188+
} gatsby-image-outer-wrapper`}
189189
style={{
190190
zIndex: 0,
191191
// Let users set component to be absolutely positioned.
@@ -296,9 +296,9 @@ class Image extends React.Component {
296296
// The outer div is necessary to reset the z-index to 0.
297297
return (
298298
<div
299-
className={`${outerWrapperClassName
300-
? outerWrapperClassName
301-
: ``} gatsby-image-outer-wrapper`}
299+
className={`${
300+
outerWrapperClassName ? outerWrapperClassName : ``
301+
} gatsby-image-outer-wrapper`}
302302
style={{
303303
zIndex: 0,
304304
// Let users set component to be absolutely positioned.

packages/gatsby-plugin-google-analytics/src/gatsby-ssr.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,24 @@ exports.onRenderBody = ({ setPostBodyComponents }, pluginOptions) => {
77
key={`gatsby-plugin-google-analytics`}
88
dangerouslySetInnerHTML={{
99
__html: `
10-
${typeof pluginOptions.anonymize !== `undefined`
11-
? `function gaOptout(){document.cookie=disableStr+'=true; expires=Thu, 31 Dec 2099 23:59:59 UTC;path=/',window[disableStr]=!0}var gaProperty='${pluginOptions.trackingId}',disableStr='ga-disable-'+gaProperty;document.cookie.indexOf(disableStr+'=true')>-1&&(window[disableStr]=!0);`
12-
: ``}
10+
${
11+
typeof pluginOptions.anonymize !== `undefined`
12+
? `function gaOptout(){document.cookie=disableStr+'=true; expires=Thu, 31 Dec 2099 23:59:59 UTC;path=/',window[disableStr]=!0}var gaProperty='${
13+
pluginOptions.trackingId
14+
}',disableStr='ga-disable-'+gaProperty;document.cookie.indexOf(disableStr+'=true')>-1&&(window[disableStr]=!0);`
15+
: ``
16+
}
1317
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
1418
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
1519
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
1620
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
1721
1822
ga('create', '${pluginOptions.trackingId}', 'auto');
19-
${typeof pluginOptions.anonymize !== `undefined`
20-
? `ga('set', 'anonymizeIp', 1);`
21-
: ``}`,
23+
${
24+
typeof pluginOptions.anonymize !== `undefined`
25+
? `ga('set', 'anonymizeIp', 1);`
26+
: ``
27+
}`,
2228
}}
2329
/>,
2430
])

packages/gatsby-plugin-google-tagmanager/src/gatsby-ssr.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,9 @@ exports.onRenderBody = (
2626
dangerouslySetInnerHTML={{
2727
__html: stripIndent`
2828
<iframe
29-
src="https://www.googletagmanager.com/ns.html?id=${pluginOptions.id}"
29+
src="https://www.googletagmanager.com/ns.html?id=${
30+
pluginOptions.id
31+
}"
3032
height="0"
3133
width="0"
3234
style="display: none; visibility: hidden"

packages/gatsby-plugin-netlify/src/build-headers-program.js

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,9 @@ function transformLink(manifest, publicFolder, pathPrefix) {
9696
return `${prefix}${pathPrefix}${file}${suffix}`
9797
} else {
9898
throw new Error(
99-
`Could not find the file specified in the Link header \`${header}\`.` +
99+
`Could not find the file specified in the Link header \`${
100+
header
101+
}\`.` +
100102
`The gatsby-plugin-netlify is looking for a matching file (with or without a ` +
101103
`webpack hash). Check the public folder and your gatsby-config.js to ensure you are ` +
102104
`pointing to a public file.`
@@ -134,18 +136,18 @@ const validateUserOptions = pluginOptions => headers => {
134136
)
135137
}
136138

137-
;[
138-
`mergeSecurityHeaders`,
139-
`mergeLinkHeaders`,
140-
`mergeCachingHeaders`,
141-
].forEach(mergeOption => {
142-
if (!_.isBoolean(pluginOptions[mergeOption])) {
143-
throw new Error(
144-
`The "${mergeOption}" option to gatsby-plugin-netlify must be a boolean. ` +
145-
`Check your gatsby-config.js.`
146-
)
139+
;[`mergeSecurityHeaders`, `mergeLinkHeaders`, `mergeCachingHeaders`].forEach(
140+
mergeOption => {
141+
if (!_.isBoolean(pluginOptions[mergeOption])) {
142+
throw new Error(
143+
`The "${
144+
mergeOption
145+
}" option to gatsby-plugin-netlify must be a boolean. ` +
146+
`Check your gatsby-config.js.`
147+
)
148+
}
147149
}
148-
})
150+
)
149151

150152
if (!_.isFunction(pluginOptions.transformHeaders)) {
151153
throw new Error(

packages/gatsby-plugin-sharp/src/index.js

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -262,8 +262,9 @@ function queueImageResizing({ file, args = {} }) {
262262

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

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

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

413414
// If the users didn't set a default sizes, we'll make one.
414415
if (!options.sizes) {
415-
options.sizes = `(max-width: ${presentationWidth}px) 100vw, ${presentationWidth}px`
416+
options.sizes = `(max-width: ${presentationWidth}px) 100vw, ${
417+
presentationWidth
418+
}px`
416419
}
417420

418421
// Create sizes (in width) for the image. If the max width of the container
@@ -524,7 +527,9 @@ async function resolutions({ file, args = {} }) {
524527
filteredSizes.push(dimensions.width)
525528
console.warn(
526529
`
527-
The requested width "${options.width}px" for a resolutions field for
530+
The requested width "${
531+
options.width
532+
}px" for a resolutions field for
528533
the file ${file.absolutePath}
529534
was wider than the actual image width of ${dimensions.width}px!
530535
If possible, replace the current image with a larger one.
@@ -649,8 +654,9 @@ async function notMemoizedtraceSVG({ file, args, fileArgs }) {
649654
}
650655

651656
const tmpDir = require(`os`).tmpdir()
652-
const tmpFilePath = `${tmpDir}/${file.internal
653-
.contentDigest}-${file.name}-${crypto
657+
const tmpFilePath = `${tmpDir}/${file.internal.contentDigest}-${
658+
file.name
659+
}-${crypto
654660
.createHash(`md5`)
655661
.update(JSON.stringify(fileArgs))
656662
.digest(`hex`)}.${file.extension}`

packages/gatsby-plugin-stylus/src/gatsby-node.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,9 @@ exports.modifyWebpackConfig = ({ config, stage }, options = {}) => {
3333
})
3434
} else if (options.use) {
3535
throw new Error(
36-
`gatsby-plugin-stylus "use" option passed with ${options.use}. Pass an array of stylus plugins instead`
36+
`gatsby-plugin-stylus "use" option passed with ${
37+
options.use
38+
}. Pass an array of stylus plugins instead`
3739
)
3840
}
3941
if (Array.isArray(options.import)) {
@@ -45,7 +47,9 @@ exports.modifyWebpackConfig = ({ config, stage }, options = {}) => {
4547
})
4648
} else if (options.import) {
4749
throw new Error(
48-
`gatsby-plugin-stylus "import" option passed with ${options.import}. Pass an array of filenames instead`
50+
`gatsby-plugin-stylus "import" option passed with ${
51+
options.import
52+
}. Pass an array of filenames instead`
4953
)
5054
}
5155

0 commit comments

Comments
 (0)