add lint-fix command

This commit is contained in:
Chuck Dries 2021-06-14 18:10:54 -07:00
parent e54d501f0f
commit 077a4149c9
No known key found for this signature in database
GPG Key ID: 4E6B9B2DCEC64BA9
4 changed files with 23 additions and 22 deletions

View File

@ -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",

View File

@ -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 }) => {
</div>
</div>
</>);
}
};
export const query = graphql`
query GalleryImage($imageFilename: String) {
@ -93,6 +93,6 @@ export const query = graphql`
}
`
`;
export default GalleryImage
export default GalleryImage;

View File

@ -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 = () => {
<Link to="/">Go home</Link>.
</p>
</main>
)
}
);
};
export default NotFoundPage
export default NotFoundPage;

View File

@ -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)
export const hasName = (image) => Boolean(getMeta(image)?.iptc.object_name);