Skip to content

Commit 2fbc5ee

Browse files
committed
improvements
1 parent 11502ee commit 2fbc5ee

File tree

21 files changed

+938
-303
lines changed

21 files changed

+938
-303
lines changed

.eslintrc.js

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
module.exports = {
2+
'extends': 'airbnb',
3+
'plugins': [
4+
'react',
5+
'jsx-a11y',
6+
'import'
7+
],
8+
'rules': {
9+
'semi': 0,
10+
'comma-dangle': 0,
11+
'global-require': 0,
12+
'react/prop-types': 0,
13+
'import/no-unresolved': 0,
14+
'import/no-webpack-loader-syntax': 0,
15+
'jsx-a11y/click-events-have-key-events': 0,
16+
'react/prefer-stateless-function': 0,
17+
'react/no-danger': 0,
18+
'no-multi-spaces': 0,
19+
'jsx-a11y/anchor-has-content': 0,
20+
'jsx-a11y/label-has-for': 0,
21+
'jsx-a11y/no-static-element-interactions': 0,
22+
'arrow-body-style': 0,
23+
'react/forbid-prop-types': 0,
24+
'react/require-default-props': 0,
25+
'camelcase': 0,
26+
'indent': ['error', 'tab'],
27+
'no-tabs': 0,
28+
'react/jsx-indent': 0,
29+
'no-console': 0,
30+
'import/prefer-default-export': 0,
31+
'jsx-a11y/anchor-is-valid': 0,
32+
'react/no-unescaped-entities': 0,
33+
'react/jsx-closing-tag-location': 0,
34+
'react/jsx-filename-extension': 0,
35+
'function-paren-newline': 0,
36+
'react/jsx-one-expression-per-line': 0,
37+
'(react/jsx-first-prop-new-line': 0,
38+
'react/jsx-indent-props': 0,
39+
'import/no-extraneous-dependencies': 0,
40+
'object-curly-newline': 0,
41+
'no-restricted-globals': 0,
42+
'arrow-parens': 0,
43+
'import/no-useless-path-segments': 0,
44+
'import/no-cycle': 0,
45+
'react/destructuring-assignment': 0,
46+
'no-mixed-spaces-and-tabs': 0
47+
},
48+
'parser': 'babel-eslint',
49+
'globals': {
50+
'location': true,
51+
'graphql': true,
52+
'__PATH_PREFIX__': true
53+
}
54+
};

.vscode/settings.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"prettier.tabWidth": 4,
3+
"eslint.autoFixOnSave": true
4+
}

gatsby-browser.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* See: https://www.gatsbyjs.org/docs/browser-apis/
55
*/
66

7-
// You can delete this file if you're not using it
7+
// You can delete this file if you're not using it

gatsby-config.js

Lines changed: 63 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,84 +1,84 @@
1-
const config = require("./data/Config");
1+
const config = require('./data/Config');
22

33
module.exports = {
4-
plugins: [
5-
'gatsby-plugin-react-helmet',
6-
'gatsby-plugin-sass',
7-
'gatsby-plugin-react-next',
8-
{
9-
resolve: 'gatsby-plugin-canonical-urls',
10-
options: {
11-
siteUrl: config.siteURL,
12-
},
13-
},
14-
'gatsby-plugin-catch-links',
15-
'gatsby-transformer-sharp',
16-
'gatsby-plugin-sharp',
4+
plugins: [
5+
'gatsby-plugin-react-helmet',
6+
'gatsby-plugin-sass',
7+
'gatsby-plugin-react-next',
178
{
18-
resolve: `gatsby-transformer-remark`,
9+
resolve: 'gatsby-plugin-canonical-urls',
10+
options: {
11+
siteUrl: config.siteURL,
12+
},
13+
},
14+
'gatsby-plugin-catch-links',
15+
'gatsby-transformer-sharp',
16+
'gatsby-plugin-sharp',
17+
{
18+
resolve: 'gatsby-transformer-remark',
1919
options: {
2020
plugins: [
2121
{
22-
resolve: `gatsby-remark-prismjs`,
22+
resolve: 'gatsby-remark-prismjs',
2323
options: {
2424
classPrefix: 'language-',
2525
inlineCodeMarker: null,
2626
aliases: {},
2727
},
28-
},
29-
{
30-
resolve: 'gatsby-remark-images',
31-
options: {
32-
maxWidth: 1000,
33-
},
34-
},
28+
},
29+
{
30+
resolve: 'gatsby-remark-images',
31+
options: {
32+
maxWidth: 1000,
33+
},
34+
},
3535
],
3636
},
3737
},
38-
{
38+
{
3939
resolve: 'gatsby-source-filesystem',
4040
options: {
4141
name: 'posts',
4242
path: `${__dirname}/content/`,
4343
},
4444
},
45-
{
46-
resolve: "gatsby-plugin-google-analytics",
47-
options: {
48-
trackingId: config.googleAnalyticsID,
49-
}
50-
},
51-
{
52-
resolve: "gatsby-plugin-nprogress",
53-
options: {
54-
color: config.themeColor,
55-
showSpinner: false,
56-
}
57-
},
58-
'gatsby-transformer-json',
59-
{
60-
resolve: `gatsby-plugin-manifest`,
61-
options: {
62-
name: config.siteName,
63-
short_name: config.siteName,
64-
start_url: "/",
65-
background_color: config.backgroundColor,
66-
theme_color: config.themeColor,
67-
display: "minimal-ui",
68-
icons: [
69-
{
70-
src: `/favicon/logo-192x192.png`,
71-
sizes: `192x192`,
72-
type: `image/png`,
73-
},
74-
{
75-
src: `/favicon/logo-512x512.png`,
76-
sizes: `512x512`,
77-
type: `image/png`,
78-
},
79-
],
80-
},
81-
},
82-
"gatsby-plugin-offline",
83-
],
45+
{
46+
resolve: 'gatsby-plugin-google-analytics',
47+
options: {
48+
trackingId: config.googleAnalyticsID,
49+
}
50+
},
51+
{
52+
resolve: 'gatsby-plugin-nprogress',
53+
options: {
54+
color: config.themeColor,
55+
showSpinner: false,
56+
}
57+
},
58+
'gatsby-transformer-json',
59+
{
60+
resolve: 'gatsby-plugin-manifest',
61+
options: {
62+
name: config.siteName,
63+
short_name: config.siteName,
64+
start_url: '/',
65+
background_color: config.backgroundColor,
66+
theme_color: config.themeColor,
67+
display: 'minimal-ui',
68+
icons: [
69+
{
70+
src: '/favicon/logo-192x192.png',
71+
sizes: '192x192',
72+
type: 'image/png',
73+
},
74+
{
75+
src: '/favicon/logo-512x512.png',
76+
sizes: '512x512',
77+
type: 'image/png',
78+
},
79+
],
80+
},
81+
},
82+
'gatsby-plugin-offline',
83+
],
8484
};

gatsby-node.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ exports.onCreateNode = ({ node, boundActionCreators, getNode }) => {
99
const fileNode = getNode(node.parent)
1010
const parsedFilePath = path.parse(fileNode.relativePath)
1111
if (
12-
Object.prototype.hasOwnProperty.call(node, 'frontmatter') &&
13-
Object.prototype.hasOwnProperty.call(node.frontmatter, 'slug')
12+
Object.prototype.hasOwnProperty.call(node, 'frontmatter')
13+
&& Object.prototype.hasOwnProperty.call(node.frontmatter, 'slug')
1414
) {
1515
slug += `${_.kebabCase(node.frontmatter.slug)}`
1616
}
1717
if (
18-
Object.prototype.hasOwnProperty.call(node, 'frontmatter') &&
19-
Object.prototype.hasOwnProperty.call(node.frontmatter, 'title')
18+
Object.prototype.hasOwnProperty.call(node, 'frontmatter')
19+
&& Object.prototype.hasOwnProperty.call(node.frontmatter, 'title')
2020
) {
2121
slug += `${_.kebabCase(node.frontmatter.title)}`
2222
} else if (parsedFilePath.name !== 'index' && parsedFilePath.dir !== '') {
@@ -86,4 +86,4 @@ exports.modifyWebpackConfig = ({ config, stage }) => {
8686
if (stage === 'build-javascript') {
8787
config.plugin('Lodash', webpackLodashPlugin, null)
8888
}
89-
}
89+
}

gatsby-ssr.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
* See: https://www.gatsbyjs.org/docs/ssr-apis/
55
*/
66

7-
// You can delete this file if you're not using it
7+
// You can delete this file if you're not using it

package.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,12 @@
4545
"test": "echo \"Error: no test specified\" && exit 1"
4646
},
4747
"devDependencies": {
48+
"babel-eslint": "^8.2.5",
49+
"eslint": "^4.19.1",
50+
"eslint-config-airbnb": "^17.0.0",
51+
"eslint-plugin-import": "^2.12.0",
52+
"eslint-plugin-jsx-a11y": "^6.1.0",
53+
"eslint-plugin-react": "^7.9.1",
4854
"prettier": "^1.11.1"
4955
}
5056
}

src/components/Docs/DocsContent/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ const DocsContent = ({ title, content }) => (
1111
</div>
1212
)
1313

14-
export { DocsContent }
14+
export { DocsContent }

src/components/Docs/SidebarDocs/index.jsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@ import './styles.scss'
66
const SidebarDocs = ({ isToggled, chapters, selectedDocBySlug, selected }) => (
77
<div className={cx('docs-sidebar', { active: isToggled })}>
88
<div className="tabs">
9-
{ chapters.map(chapter => (
10-
<Link
11-
key={chapter.entry.id}
12-
onClick={() => selectedDocBySlug(chapter.entry.childMarkdownRemark.fields.slug)}
13-
className={cx({ current: chapter.entry.childMarkdownRemark.fields.slug === selected })}
14-
to={chapter.entry.childMarkdownRemark.fields.slug}
15-
>
16-
{chapter.title}
17-
</Link>
18-
)) }
19-
</div>
9+
{ chapters.map(chapter => (
10+
<Link
11+
key={chapter.entry.id}
12+
onClick={() => selectedDocBySlug(chapter.entry.childMarkdownRemark.fields.slug)}
13+
className={cx({ current: chapter.entry.childMarkdownRemark.fields.slug === selected })}
14+
to={chapter.entry.childMarkdownRemark.fields.slug}
15+
>
16+
{chapter.title}
17+
</Link>
18+
)) }
19+
</div>
2020
</div>
2121
)
2222

src/components/Docs/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export * from './DocsContent'
22
export * from './SidebarDocs'
3-
export * from './BurgerIcon'
3+
export * from './BurgerIcon'

src/components/Includes/Footer/index.jsx

Whitespace-only changes.

src/components/Includes/Footer/styles.scss

Whitespace-only changes.

src/components/Includes/Header/Hamburger/index.jsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import './styles.scss'
44

55
const Hamburger = ({ sidebar, Toggle }) => (
66
<div className={cx('hamburger', { active: sidebar })} onClick={Toggle}>
7-
<div className="top"></div>
8-
<div className="mid"></div>
9-
<div className="bottom"></div>
7+
<div className="top" />
8+
<div className="mid" />
9+
<div className="bottom" />
1010
</div>
1111
)
1212

src/components/Includes/Header/index.jsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,4 @@ const enhance = compose(
2828
)
2929
)
3030

31-
export default enhance(Header)
31+
export default enhance(Header)

0 commit comments

Comments
 (0)