Skip to content

Commit 3c18906

Browse files
committed
Add eslint + prettier
1 parent 2c2c910 commit 3c18906

13 files changed

+136
-113
lines changed

Diff for: .eslintignore

+4-3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1-
node_modules
2-
public
3-
coverage
1+
/.cache
2+
/node_modules
3+
/public
4+
/coverage

Diff for: .eslintrc.js

+4-10
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,14 @@ module.exports = {
33
browser: true,
44
es2021: true,
55
},
6-
extends: [
7-
'plugin:react/recommended',
8-
'airbnb',
9-
],
6+
extends: ["plugin:react/recommended", "airbnb", "airbnb/hooks", "prettier"],
107
parserOptions: {
118
ecmaFeatures: {
129
jsx: true,
1310
},
1411
ecmaVersion: 12,
15-
sourceType: 'module',
16-
},
17-
plugins: [
18-
'react',
19-
],
20-
rules: {
12+
sourceType: "module",
2113
},
14+
plugins: ["react"],
15+
rules: {},
2216
};

Diff for: .github/workflows/build-checks.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,4 @@ jobs:
3535
key: ${{ runner.os }}-cache-gatsby
3636
restore-keys: |
3737
${{ runner.os }}-cache-gatsby
38-
- run: npm run build
38+
- run: npm run build

Diff for: .prettierignore

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/.cache
2+
/node_modules
3+
/public
4+
/coverage
5+
/package-lock.json

Diff for: .prettierrc.json

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{}

Diff for: .vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
3+
}

Diff for: .vscode/settings.json

+3-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"eslint.format.enable": true,
3-
"editor.codeActionsOnSave": {
4-
"source.fixAll.eslint": true,
5-
},
6-
}
2+
"editor.defaultFormatter": "esbenp.prettier-vscode",
3+
"editor.formatOnSave": true
4+
}

Diff for: gatsby-config.js

+27-19
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,45 @@
11
module.exports = {
22
siteMetadata: {
3-
siteUrl: 'https://www.yourdomain.tld',
4-
title: 'Delta Lake',
3+
siteUrl: "https://www.yourdomain.tld",
4+
title: "Delta Lake",
55
},
66
plugins: [
7-
'gatsby-plugin-styled-components',
8-
'gatsby-plugin-image',
9-
'gatsby-plugin-react-helmet',
10-
'gatsby-plugin-sitemap',
7+
"gatsby-plugin-styled-components",
8+
"gatsby-plugin-image",
9+
"gatsby-plugin-react-helmet",
10+
"gatsby-plugin-sitemap",
1111
{
12-
resolve: 'gatsby-plugin-manifest',
12+
resolve: "gatsby-plugin-manifest",
1313
options: {
14-
icon: 'src/images/icon.png',
14+
name: "Delta Lake",
15+
short_name: "Delta Lake",
16+
start_url: "/",
17+
background_color: "#042436",
18+
theme_color: "#00ADD4",
19+
icon: "src/images/icon.png",
20+
icon_options: {
21+
purpose: "maskable",
22+
},
1523
},
1624
},
17-
'gatsby-plugin-mdx',
18-
'gatsby-plugin-sharp',
19-
'gatsby-transformer-sharp',
25+
"gatsby-plugin-mdx",
26+
"gatsby-plugin-sharp",
27+
"gatsby-transformer-sharp",
2028
{
21-
resolve: 'gatsby-source-filesystem',
29+
resolve: "gatsby-source-filesystem",
2230
options: {
23-
name: 'images',
24-
path: './src/images/',
31+
name: "images",
32+
path: "./src/images/",
2533
},
26-
__key: 'images',
34+
__key: "images",
2735
},
2836
{
29-
resolve: 'gatsby-source-filesystem',
37+
resolve: "gatsby-source-filesystem",
3038
options: {
31-
name: 'pages',
32-
path: './src/pages/',
39+
name: "pages",
40+
path: "./src/pages/",
3341
},
34-
__key: 'pages',
42+
__key: "pages",
3543
},
3644
],
3745
};

Diff for: package-lock.json

+22-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+5-3
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@
1717
"build": "gatsby build",
1818
"serve": "gatsby serve",
1919
"clean": "gatsby clean",
20-
"lint": "eslint \"**/*.{js,jsx}\"",
21-
"lint:fix": "eslint \"**/*.{js,jsx}\" --fix"
20+
"lint": "eslint \"**/*.{js,jsx}\" && prettier --check .",
21+
"lint:fix": "eslint \"**/*.{js,jsx}\" --fix && prettier --write ."
2222
},
2323
"dependencies": {
2424
"@mdx-js/mdx": "^1.6.22",
@@ -42,9 +42,11 @@
4242
"devDependencies": {
4343
"eslint": "^7.31.0",
4444
"eslint-config-airbnb": "^18.2.1",
45+
"eslint-config-prettier": "^8.3.0",
4546
"eslint-plugin-import": "^2.23.4",
4647
"eslint-plugin-jsx-a11y": "^6.4.1",
4748
"eslint-plugin-react": "^7.24.0",
48-
"eslint-plugin-react-hooks": "^4.2.0"
49+
"eslint-plugin-react-hooks": "^4.2.0",
50+
"prettier": "^2.3.2"
4951
}
5052
}

Diff for: src/images/icon.png

41.4 KB
Loading

Diff for: src/pages/404.jsx

+13-18
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import * as React from 'react';
2-
import { Link } from 'gatsby';
1+
import * as React from "react";
2+
import { Link } from "gatsby";
33

44
// styles
55
const pageStyles = {
6-
color: '#232129',
7-
padding: '96px',
8-
fontFamily: '-apple-system, Roboto, sans-serif, serif',
6+
color: "#232129",
7+
padding: "96px",
8+
fontFamily: "-apple-system, Roboto, sans-serif, serif",
99
};
1010
const headingStyles = {
1111
marginTop: 0,
@@ -17,10 +17,10 @@ const paragraphStyles = {
1717
marginBottom: 48,
1818
};
1919
const codeStyles = {
20-
color: '#8A6534',
20+
color: "#8A6534",
2121
padding: 4,
22-
backgroundColor: '#FFF4DB',
23-
fontSize: '1.25rem',
22+
backgroundColor: "#FFF4DB",
23+
fontSize: "1.25rem",
2424
borderRadius: 4,
2525
};
2626

@@ -30,27 +30,22 @@ const NotFoundPage = () => (
3030
<title>Not found</title>
3131
<h1 style={headingStyles}>Page not found</h1>
3232
<p style={paragraphStyles}>
33-
Sorry
34-
{' '}
33+
Sorry{" "}
3534
<span role="img" aria-label="Pensive emoji">
3635
😔
37-
</span>
38-
{' '}
36+
</span>{" "}
3937
we couldn’t find what you were looking for.
4038
<br />
41-
{process.env.NODE_ENV === 'development' ? (
39+
{process.env.NODE_ENV === "development" ? (
4240
<>
4341
<br />
44-
Try creating a page in
45-
{' '}
46-
<code style={codeStyles}>src/pages/</code>
42+
Try creating a page in <code style={codeStyles}>src/pages/</code>
4743
.
4844
<br />
4945
</>
5046
) : null}
5147
<br />
52-
<Link to="/">Go home</Link>
53-
.
48+
<Link to="/">Go home</Link>.
5449
</p>
5550
</main>
5651
);

0 commit comments

Comments
 (0)