-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
611 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
module.exports = { | ||
globals: { | ||
__PATH_PREFIX__: true, | ||
}, | ||
extends: [ | ||
"airbnb", | ||
"react-app", | ||
"prettier", | ||
"prettier/flowtype", | ||
"prettier/react" | ||
], | ||
"rules": { | ||
// Allow jsx tags inside .js files. | ||
"react/jsx-filename-extension": [1, {"extensions": [".js", ".jsx"]}], | ||
// Disable props spreading (<App {...props} />) warning. | ||
"react/jsx-props-no-spreading": 0, | ||
// Throw warning instead of error when using array index as a key. | ||
"react/no-array-index-key": 1, | ||
// Allow modules with named exports only. | ||
"import/prefer-default-export": 0, | ||
// Force {foo: 'bar'} object literal syntax. | ||
"object-curly-spacing": ["error", "never"], | ||
// Throw warning instead of error. Feel free to choose your favorite option https://eslint.org/docs/rules/arrow-body-style | ||
"arrow-body-style": ["warn", "as-needed"], | ||
// Make prettier code formatting suggestions more verbose. | ||
"prettier/prettier": ["warn"], | ||
// Throw warning when <a href="#"> or <a href="javascript:void(0)"> are used. Use <button> instead. | ||
"jsx-a11y/anchor-is-valid": ["warn", {"aspects": ["invalidHref"]}], | ||
// Allow using (props) => <Component /> and ({propName}) => <Component /> syntax. | ||
"react/destructuring-assignment": "off", | ||
// Disable <Fragment> => <> replacement. Feel free to change | ||
"react/jsx-fragments": "off", | ||
// Below is the set of functional rules to warn developer about accidental mutations, which may cause error in reducers etc. | ||
// No delete operator. | ||
"fp/no-delete": "warn", | ||
// Warning when Object.assign(a, b) used, since it mutates first argument. Object.assign({}, a, b) is ok. | ||
"fp/no-mutating-assign": "warn", | ||
// Warning when mutating method (pop, push, reverse, shift, sort, splice, unshift, etc) is used. Ramda and lodash/fp are allowed (_.pop, R.push) | ||
"fp/no-mutating-methods": [ | ||
"warn", | ||
{ | ||
"allowedObjects": ["_", "R"] | ||
} | ||
], | ||
// Warning when mutating operators (++, --, etc) are used, object = {} also. `Component.propTypes`, `Component.defaultProps`, common.js (`module.exports`) and `ref.current` are ok. | ||
"fp/no-mutation": [ | ||
"warn", | ||
{ | ||
"commonjs": true, | ||
"allowThis": true, | ||
"exceptions": [{"property": "propTypes"}, {"property": "defaultProps"}, {"property": "current"}] | ||
} | ||
] | ||
}, | ||
"plugins": ["prettier", "fp"], | ||
"settings": { | ||
"import/resolver": { | ||
"node": { | ||
"moduleDirectory": ["node_modules", "./src"] | ||
} | ||
} | ||
}, | ||
"overrides": [ | ||
{ | ||
"files": [ "./*.js"], | ||
"rules": { | ||
"import/no-extraneous-dependencies": ["error", {"devDependencies": true, "optionalDependencies": false, "peerDependencies": false}], | ||
"global-require": 0 | ||
} | ||
}, | ||
{ | ||
"files": ["**/*.spec.js"], | ||
"rules": { | ||
"react/prop-types": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,9 @@ | ||
{ | ||
"arrowParens": "avoid", | ||
"semi": false | ||
"semi": true, | ||
"singleQuote": true, | ||
"jsxSingleQuote": false, | ||
"trailingComma": "es5", | ||
"bracketSpacing": false, | ||
"jsxBracketSameLine": true, | ||
"arrowParens": "avoid" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,39 @@ | ||
import { Link } from "gatsby" | ||
import PropTypes from "prop-types" | ||
import React from "react" | ||
import {Link} from 'gatsby'; | ||
import PropTypes from 'prop-types'; | ||
import React from 'react'; | ||
|
||
const Header = ({ siteTitle }) => ( | ||
const Header = ({siteTitle}) => ( | ||
<header | ||
style={{ | ||
background: `rebeccapurple`, | ||
marginBottom: `1.45rem`, | ||
}} | ||
> | ||
}}> | ||
<div | ||
style={{ | ||
margin: `0 auto`, | ||
maxWidth: 960, | ||
padding: `1.45rem 1.0875rem`, | ||
}} | ||
> | ||
<h1 style={{ margin: 0 }}> | ||
}}> | ||
<h1 style={{margin: 0}}> | ||
<Link | ||
to="/" | ||
style={{ | ||
color: `white`, | ||
textDecoration: `none`, | ||
}} | ||
> | ||
}}> | ||
{siteTitle} | ||
</Link> | ||
</h1> | ||
</div> | ||
</header> | ||
) | ||
); | ||
|
||
Header.propTypes = { | ||
siteTitle: PropTypes.string, | ||
} | ||
}; | ||
|
||
Header.defaultProps = { | ||
siteTitle: ``, | ||
} | ||
}; | ||
|
||
export default Header | ||
export default Header; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
import React from "react" | ||
import React from 'react'; | ||
|
||
import Layout from "../components/layout" | ||
import SEO from "../components/seo" | ||
import Layout from '../components/layout'; | ||
import SEO from '../components/seo'; | ||
|
||
const NotFoundPage = () => ( | ||
<Layout> | ||
<SEO title="404: Not found" /> | ||
<h1>NOT FOUND</h1> | ||
<p>You just hit a route that doesn't exist... the sadness.</p> | ||
</Layout> | ||
) | ||
); | ||
|
||
export default NotFoundPage | ||
export default NotFoundPage; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import React from "react" | ||
import { Link } from "gatsby" | ||
import React from 'react'; | ||
import {Link} from 'gatsby'; | ||
|
||
import Layout from "../components/layout" | ||
import Image from "../components/image" | ||
import SEO from "../components/seo" | ||
import Layout from '../components/layout'; | ||
import Image from '../components/image'; | ||
import SEO from '../components/seo'; | ||
|
||
const IndexPage = () => ( | ||
<Layout> | ||
<SEO title="Home" /> | ||
<h1>Hi people</h1> | ||
<p>Welcome to your new Gatsby site.</p> | ||
<p>Now go build something great.</p> | ||
<div style={{ maxWidth: `300px`, marginBottom: `1.45rem` }}> | ||
<div style={{maxWidth: `300px`, marginBottom: `1.45rem`}}> | ||
<Image /> | ||
</div> | ||
<Link to="/page-2/">Go to page 2</Link> | ||
</Layout> | ||
) | ||
); | ||
|
||
export default IndexPage | ||
export default IndexPage; |
Oops, something went wrong.