From 077a4149c982fb67fb332513967892a985236c0f Mon Sep 17 00:00:00 2001 From: Chuck Dries Date: Mon, 14 Jun 2021 18:10:54 -0700 Subject: [PATCH] add lint-fix command --- gatsby/package.json | 3 ++- gatsby/src/components/gallery-image.js | 18 +++++++++--------- gatsby/src/pages/404.js | 18 +++++++++--------- gatsby/src/utils.js | 6 +++--- 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/gatsby/package.json b/gatsby/package.json index 8860773..12102b1 100644 --- a/gatsby/package.json +++ b/gatsby/package.json @@ -12,7 +12,8 @@ "start": "gatsby develop", "build": "gatsby build", "serve": "gatsby serve", - "clean": "gatsby clean" + "clean": "gatsby clean", + "lint-fix": "eslint --fix --ext .jsx,.js src" }, "dependencies": { "@mdx-js/mdx": "^1.6.22", diff --git a/gatsby/src/components/gallery-image.js b/gatsby/src/components/gallery-image.js index a33405e..a7751ae 100644 --- a/gatsby/src/components/gallery-image.js +++ b/gatsby/src/components/gallery-image.js @@ -1,12 +1,12 @@ -import React from 'react' -import { graphql } from 'gatsby' +import React from 'react'; +import { graphql } from 'gatsby'; import { getMeta, getName, hasName } from '../utils'; -import { GatsbyImage, getImage } from 'gatsby-plugin-image' +import { GatsbyImage, getImage } from 'gatsby-plugin-image'; import { Helmet } from 'react-helmet'; -import classnames from 'classnames' +import classnames from 'classnames'; const GalleryImage = ({ data }) => { - const image = data.allFile.edges[0].node + const image = data.allFile.edges[0].node; const ar = image.childImageSharp.fluid.aspectRatio; console.log(ar); // const imageStyle = {} @@ -16,7 +16,7 @@ const GalleryImage = ({ data }) => { // imageStyle.height = '90vh' // } - console.log(`calc(90vw * ${ar})px`) + console.log(`calc(90vw * ${ar})px`); const name = getName(image); return (<> @@ -50,7 +50,7 @@ const GalleryImage = ({ data }) => { ); -} +}; export const query = graphql` query GalleryImage($imageFilename: String) { @@ -93,6 +93,6 @@ export const query = graphql` } -` +`; -export default GalleryImage \ No newline at end of file +export default GalleryImage; \ No newline at end of file diff --git a/gatsby/src/pages/404.js b/gatsby/src/pages/404.js index 4d41c72..2fc80a3 100644 --- a/gatsby/src/pages/404.js +++ b/gatsby/src/pages/404.js @@ -1,28 +1,28 @@ -import * as React from 'react' -import { Link } from 'gatsby' +import * as React from 'react'; +import { Link } from 'gatsby'; // styles const pageStyles = { color: '#232129', padding: '96px', fontFamily: '-apple-system, Roboto, sans-serif, serif', -} +}; const headingStyles = { marginTop: 0, marginBottom: 64, maxWidth: 320, -} +}; const paragraphStyles = { marginBottom: 48, -} +}; const codeStyles = { color: '#8A6534', padding: 4, backgroundColor: '#FFF4DB', fontSize: '1.25rem', borderRadius: 4, -} +}; // markup const NotFoundPage = () => { @@ -48,7 +48,7 @@ const NotFoundPage = () => { Go home.

- ) -} + ); +}; -export default NotFoundPage +export default NotFoundPage; diff --git a/gatsby/src/utils.js b/gatsby/src/utils.js index 9a9cae9..e88c3a0 100644 --- a/gatsby/src/utils.js +++ b/gatsby/src/utils.js @@ -1,5 +1,5 @@ -export const getMeta = (image) => image.childImageSharp.fields.imageMeta +export const getMeta = (image) => image.childImageSharp.fields.imageMeta; -export const getName = (image) => getMeta(image)?.iptc.object_name || image.base +export const getName = (image) => getMeta(image)?.iptc.object_name || image.base; -export const hasName = (image) => Boolean(getMeta(image)?.iptc.object_name) \ No newline at end of file +export const hasName = (image) => Boolean(getMeta(image)?.iptc.object_name); \ No newline at end of file