Skip to content

Commit 6ed290b

Browse files
committed
Add husky and run prettier on pre-commit
1 parent b816c6d commit 6ed290b

File tree

196 files changed

+1397
-739
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

196 files changed

+1397
-739
lines changed

babel-preset.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ module.exports = () => {
2121
[r('@babel/preset-react'), { development: !PRODUCTION }],
2222
],
2323
plugins: [
24-
PRODUCTION ? r('babel-plugin-universal-import') : r('react-hot-loader/babel'),
24+
PRODUCTION
25+
? r('babel-plugin-universal-import')
26+
: r('react-hot-loader/babel'),
2527
[
2628
r('@babel/plugin-transform-runtime'),
2729
{

bin/react-static-build

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
43
require('../lib/utils/binHelper')
54
const program = require('commander')
65
const buildCmd = require('../lib/commands/build')
@@ -27,4 +26,4 @@ buildCmd
2726
.catch(err => {
2827
console.error(err)
2928
process.exit(1)
30-
})
29+
})

bin/react-static-bundle

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
43
require('../lib/utils/binHelper')
54
const program = require('commander')
65
const bundleCmd = require('../lib/commands/bundle')
@@ -14,13 +13,13 @@ program
1413

1514
const { config, staging, debug } = program
1615

17-
18-
bundleCmd.default({
19-
config,
20-
staging,
21-
debug,
22-
isCLI: true,
23-
})
16+
bundleCmd
17+
.default({
18+
config,
19+
staging,
20+
debug,
21+
isCLI: true,
22+
})
2423
.then(() => {
2524
process.exit(0)
2625
})

bin/react-static-create

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
43
require('../lib/utils/binHelper')
54
const program = require('commander')
65
const chalk = require('chalk')

bin/react-static-export

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
43
require('../lib/utils/binHelper')
54
const program = require('commander')
65
const exportCmd = require('../lib/commands/export')
@@ -14,12 +13,13 @@ program
1413

1514
const { config, staging, debug } = program
1615

17-
exportCmd.default({
18-
config,
19-
staging,
20-
debug,
21-
isCLI: true,
22-
})
16+
exportCmd
17+
.default({
18+
config,
19+
staging,
20+
debug,
21+
isCLI: true,
22+
})
2323
.then(() => {
2424
process.exit(0)
2525
})

bin/react-static-start

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#!/usr/bin/env node
22

3-
43
require('../lib/utils/binHelper')
54
const program = require('commander')
65
const startCmd = require('../lib/commands/start')

examples/algolia/src/App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const App = () => (
1010
<Router>
1111
<div>
1212
<nav>
13-
<Link exact to="/">Home</Link>
13+
<Link exact to="/">
14+
Home
15+
</Link>
1416
<Link to="/about">About</Link>
1517
<Link to="/blog">Blog</Link>
1618
<Link to="/search">Search</Link>

examples/algolia/src/index.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ export default App
1010

1111
// Render your app
1212
if (typeof document !== 'undefined') {
13-
const renderMethod = module.hot ? ReactDOM.render : ReactDOM.hydrate || ReactDOM.render
13+
const renderMethod = module.hot
14+
? ReactDOM.render
15+
: ReactDOM.hydrate || ReactDOM.render
1416
const render = Comp => {
1517
renderMethod(
1618
<AppContainer>

examples/algolia/src/pages/about.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
21
import React from 'react'
32
//
43

54
export default () => (
65
<div>
76
<h1>This is what we're all about.</h1>
8-
<p>React, static sites, performance, speed. It's the stuff that makes us tick.</p>
7+
<p>
8+
React, static sites, performance, speed. It's the stuff that makes us
9+
tick.
10+
</p>
911
</div>
1012
)

examples/algolia/src/pages/blog.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React from 'react'
32
import { withRouteData, Link } from 'react-static'
43
//

examples/algolia/src/pages/search.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ const Post = props => {
1414
}
1515

1616
export default () => (
17-
<InstantSearch appId="applicationID" apiKey="searchOnlyApiKey" indexName="posts">
17+
<InstantSearch
18+
appId="applicationID"
19+
apiKey="searchOnlyApiKey"
20+
indexName="posts"
21+
>
1822
<SearchBox />
1923
<Hits hitComponent={Post} />
2024
</InstantSearch>

examples/animated-routes/src/App.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ const AnimatedRoutes = getContext({
8282
},
8383
() => ({
8484
router: data.router,
85-
}),
85+
})
8686
)(props => <div {...props} />)
8787

8888
return (
@@ -114,7 +114,9 @@ const App = () => (
114114
<Router>
115115
<div>
116116
<nav>
117-
<Link exact to="/">Home</Link>
117+
<Link exact to="/">
118+
Home
119+
</Link>
118120
<Link to="/about">About</Link>
119121
<Link to="/blog">Blog</Link>
120122
</nav>

examples/animated-routes/src/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ export default App
1010

1111
// Render your app
1212
if (typeof document !== 'undefined') {
13-
const renderMethod = module.hot ? ReactDOM.render : ReactDOM.hydrate || ReactDOM.render
13+
const renderMethod = module.hot
14+
? ReactDOM.render
15+
: ReactDOM.hydrate || ReactDOM.render
1416
const render = Comp => {
15-
renderMethod(<AppContainer><Comp /></AppContainer>, document.getElementById('root'))
17+
renderMethod(
18+
<AppContainer>
19+
<Comp />
20+
</AppContainer>,
21+
document.getElementById('root')
22+
)
1623
}
1724

1825
// Render!
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
21
import React from 'react'
32
//
43

54
export default () => (
65
<div>
76
<h1>This is what we're all about.</h1>
8-
<p>React, static sites, performance, speed. It's the stuff that makes us tick.</p>
7+
<p>
8+
React, static sites, performance, speed. It's the stuff that makes us
9+
tick.
10+
</p>
911
</div>
1012
)

examples/animated-routes/src/pages/blog.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React from 'react'
32
import { withRouteData, Link } from 'react-static'
43
//

examples/apollo-redux/src/App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ const App = () => (
1717
<Router>
1818
<div>
1919
<nav>
20-
<Link exact to="/">Home</Link>
20+
<Link exact to="/">
21+
Home
22+
</Link>
2123
<Link to="/about">About</Link>
2224
<Link to="/blog">Blog</Link>
2325
</nav>

examples/apollo-redux/src/connectors/redux/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if (typeof window === 'undefined') {
1010
const store = createStore(
1111
reducer,
1212
{}, // initial state
13-
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__(),
13+
window.__REDUX_DEVTOOLS_EXTENSION__ && window.__REDUX_DEVTOOLS_EXTENSION__()
1414
)
1515
/* eslint-enable */
1616

examples/apollo-redux/src/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ export default App
1010

1111
// Render your app
1212
if (typeof document !== 'undefined') {
13-
const renderMethod = module.hot ? ReactDOM.render : ReactDOM.hydrate || ReactDOM.render
13+
const renderMethod = module.hot
14+
? ReactDOM.render
15+
: ReactDOM.hydrate || ReactDOM.render
1416
const render = Comp => {
15-
renderMethod(<AppContainer><Comp /></AppContainer>, document.getElementById('root'))
17+
renderMethod(
18+
<AppContainer>
19+
<Comp />
20+
</AppContainer>,
21+
document.getElementById('root')
22+
)
1623
}
1724

1825
// Render!

examples/apollo-redux/src/pages/about.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React from 'react'
32
import { graphql } from 'react-apollo'
43
import gql from 'graphql-tag'
@@ -53,15 +52,18 @@ const CounterConnected = connect(
5352
dispatch => ({
5453
increment: () => dispatch({ type: 'INCREMENT' }),
5554
reset: () => dispatch({ type: 'RESET' }),
56-
}),
55+
})
5756
)(Counter)
5857

5958
// /////////////////////////////////////////////////////////
6059
// Actual container
6160
const About = () => (
6261
<div>
6362
<h1>This is what we're all about.</h1>
64-
<p>React, static sites, performance, speed. It's the stuff that makes us tick.</p>
63+
<p>
64+
React, static sites, performance, speed. It's the stuff that makes us
65+
tick.
66+
</p>
6567
<h2>Here is a person loaded from graphql:</h2>
6668
<PersonWithData />
6769
<h2>Here is a redux counter:</h2>

examples/apollo-redux/src/pages/blog.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React from 'react'
32
import { withRouteData, Link } from 'react-static'
43
//

examples/apollo/src/App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ const App = () => (
1414
<Router>
1515
<div>
1616
<nav>
17-
<Link exact to="/">Home</Link>
17+
<Link exact to="/">
18+
Home
19+
</Link>
1820
<Link to="/about">About</Link>
1921
<Link to="/blog">Blog</Link>
2022
</nav>

examples/apollo/src/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ export default App
1010

1111
// Render your app
1212
if (typeof document !== 'undefined') {
13-
const renderMethod = module.hot ? ReactDOM.render : ReactDOM.hydrate || ReactDOM.render
13+
const renderMethod = module.hot
14+
? ReactDOM.render
15+
: ReactDOM.hydrate || ReactDOM.render
1416
const render = Comp => {
15-
renderMethod(<AppContainer><Comp /></AppContainer>, document.getElementById('root'))
17+
renderMethod(
18+
<AppContainer>
19+
<Comp />
20+
</AppContainer>,
21+
document.getElementById('root')
22+
)
1623
}
1724

1825
// Render!

examples/apollo/src/pages/about.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React from 'react'
32
import { graphql } from 'react-apollo'
43
import gql from 'graphql-tag'
@@ -38,7 +37,10 @@ const PersonWithData = graphql(gql`
3837
const About = () => (
3938
<div>
4039
<h1>This is what we're all about.</h1>
41-
<p>React, static sites, performance, speed. It's the stuff that makes us tick.</p>
40+
<p>
41+
React, static sites, performance, speed. It's the stuff that makes us
42+
tick.
43+
</p>
4244
<h2>Here is a person loaded from graphql:</h2>
4345
<PersonWithData />
4446
</div>

examples/apollo/src/pages/blog.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React from 'react'
32
import { withRouteData, Link } from 'react-static'
43
//

examples/basic-prismic/src/App.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@ const App = () => (
1010
<Router>
1111
<div>
1212
<nav>
13-
<Link exact to="/">Home</Link>
13+
<Link exact to="/">
14+
Home
15+
</Link>
1416
<Link to="/about">About</Link>
1517
<Link to="/blog">Blog</Link>
1618
</nav>

examples/basic-prismic/src/index.js

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,16 @@ export default App
1010

1111
// Render your app
1212
if (typeof document !== 'undefined') {
13-
const renderMethod = module.hot ? ReactDOM.render : ReactDOM.hydrate || ReactDOM.render
13+
const renderMethod = module.hot
14+
? ReactDOM.render
15+
: ReactDOM.hydrate || ReactDOM.render
1416
const render = Comp => {
15-
renderMethod(<AppContainer><Comp /></AppContainer>, document.getElementById('root'))
17+
renderMethod(
18+
<AppContainer>
19+
<Comp />
20+
</AppContainer>,
21+
document.getElementById('root')
22+
)
1623
}
1724

1825
// Render!
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
1-
21
import React from 'react'
32
//
43

54
export default () => (
65
<div>
76
<h1>This is what we're all about.</h1>
8-
<p>React, static sites, performance, speed. It's the stuff that makes us tick.</p>
7+
<p>
8+
React, static sites, performance, speed. It's the stuff that makes us
9+
tick.
10+
</p>
911
</div>
1012
)

examples/basic-prismic/src/pages/blog.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
import React from 'react'
32
import { withRouteData, Link } from 'react-static'
43
//
Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
21
import apiEndpoint from './config'
32
import transform from './transformer'
43

54
const Prismic = require('prismic-javascript')
65

7-
8-
export default async function getData () {
6+
export default (async function getData() {
97
const api = await Prismic.getApi(apiEndpoint)
108
const response = await api.query('')
119

@@ -16,4 +14,4 @@ export default async function getData () {
1614
...transform(data),
1715
}))
1816
return mapped
19-
}
17+
})

0 commit comments

Comments
 (0)