Skip to content

Commit 068ba26

Browse files
committed
Add standard to dev dependencies and enforce JS Standard Style
1 parent 337a659 commit 068ba26

23 files changed

+685
-171
lines changed

components/About.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import styled from 'styled-components'
22
import { media } from '../utils/styleUtils'
3-
import Link from 'next/link'
43
import Wrapper from '../components/Wrapper'
54

65
const Name = styled.h2`

components/Categories.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ const Title = styled.h3`
2222

2323
export default () => (
2424
<Wrapper>
25-
{
26-
categories.map(({ id, title }) => (
27-
<Categories
28-
id={id}
29-
key={id}
30-
title={title}
31-
/>
32-
))
33-
}
25+
{
26+
categories.map(({ id, title }) => (
27+
<Categories
28+
id={id}
29+
key={id}
30+
title={title}
31+
/>
32+
))
33+
}
3434
</Wrapper>
3535
)
3636

components/Dot.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import styled from 'styled-components'
22
import { media } from '../utils/styleUtils'
33
import Link from 'next/link'
4-
import to from 'to-id'
54

65
const Dot = styled.div`
76
width: 80px;
@@ -23,5 +22,5 @@ const Dot = styled.div`
2322
`
2423

2524
export default ({ to }) => (
26-
<Link prefetch href={to || '/'}><Dot></Dot></Link>
25+
<Link prefetch href={to || '/'}><Dot /></Link>
2726
)

components/Main.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import styled from 'styled-components'
22
import { media } from '../utils/styleUtils'
3-
import Link from 'next/link'
43
import Wrapper from '../components/Wrapper'
54

65
const Title = styled.h1`

components/Page.js

+7-12
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
import React, { Component } from 'react'
22
import { initGA, logPageView } from '../utils/analytics'
33
import styled, { ThemeProvider } from 'styled-components'
4-
import { media } from '../utils/styleUtils'
5-
import Head from 'next/head'
64

75
const Body = styled.div`
86
font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen,Ubuntu,Cantarell,Fira Sans,Droid Sans,Helvetica Neue,sans-serif;
@@ -33,27 +31,25 @@ const themes = [
3331

3432
]
3533

36-
3734
class Page extends Component {
38-
constructor(props) {
35+
constructor (props) {
3936
super(props)
4037

4138
this.state = {
42-
color: 0,
39+
color: 0
4340
}
4441
this.onToggleTheme = this.onToggleTheme.bind(this)
45-
4642
}
4743

48-
componentDidMount() {
44+
componentDidMount () {
4945
if (!window.GA_INITIALIZED) {
5046
initGA()
5147
window.GA_INITIALIZED = true
5248
}
5349
logPageView()
5450
}
55-
56-
onToggleTheme() {
51+
52+
onToggleTheme () {
5753
const { color } = this.state
5854
let i = this.state.color
5955
if (i < 12 - 1) {
@@ -66,9 +62,8 @@ class Page extends Component {
6662
console.log(color)
6763
}
6864

69-
70-
render() {
71-
const { theme, children } = this.props
65+
render () {
66+
const { children } = this.props
7267
const { color } = this.state
7368
return (
7469
<ThemeProvider theme={themes[color]}>

components/ProjectList.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import styled from 'styled-components'
22
import { media } from '../utils/styleUtils'
3-
import Link from 'next/link'
43
import Wrapper from '../components/Wrapper'
54

65
const Title = styled.h3`
@@ -68,8 +67,8 @@ export default ({ id, title, description, githubLink, demoLink }) => (
6867
<Project>
6968
<Title>{ title } ·</Title>
7069
<Description>{ description }</Description>
71-
<A href={ githubLink } target='_blank' rel='noopener'>· Code</A>
72-
<A href={ demoLink } target='_blank' rel='noopener'>· Demo</A>
70+
<A href={githubLink} target='_blank' rel='noopener'>· Code</A>
71+
<A href={demoLink} target='_blank' rel='noopener'>· Demo</A>
7372
</Project>
7473
<Ws />
7574
</Wrapper>

components/Thoughts.js

+9-9
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ const Title = styled.h3`
2222

2323
export default () => (
2424
<Wrapper>
25-
{
26-
thoughts.map(({ id, title }) => (
27-
<Thoughts
28-
id={id}
29-
key={id}
30-
title={title}
31-
/>
32-
))
33-
}
25+
{
26+
thoughts.map(({ id, title }) => (
27+
<Thoughts
28+
id={id}
29+
key={id}
30+
title={title}
31+
/>
32+
))
33+
}
3434
</Wrapper>
3535
)
3636

components/Wrapper.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import styled from 'styled-components'
22
import { media } from '../utils/styleUtils'
33

4-
54
const Wrapper = styled.div`
65
line-height: 1.5;
76
padding: 0 20px;

components/meta.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import Head from 'next/head'
22

33
export default () => (
44
<Head>
5-
<meta charset="utf-8">
6-
<meta http-equiv="x-ua-compatible" content="ie=edge">
7-
<meta name="viewport" content="width=device-width, initial-scale=1">
5+
<meta charset='utf-8' />
6+
<meta http-equiv='x-ua-compatible' content='ie=edge' />
7+
<meta name='viewport' content='width=device-width, initial-scale=1' />
88
<title>prbsas</title>
9-
<meta name="description" content="Portfolio website">
10-
<meta name="distribution" content="Global">
9+
<meta name='description' content='Portfolio website' />
10+
<meta name='distribution' content='Global' />
1111
</Head>
1212
)

package.json

+3
Original file line numberDiff line numberDiff line change
@@ -12,5 +12,8 @@
1212
"react-ga": "^2.5.3",
1313
"styled-components": "^3.3.0",
1414
"to-id": "^1.0.5"
15+
},
16+
"devDependencies": {
17+
"standard": "^11.0.1"
1518
}
1619
}

pages/about.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import Head from 'next/head'
21
import Page from '../components/Page'
32
import Dot from '../components/Dot'
43
import About from '../components/About'

pages/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
1-
import Head from 'next/head'
21
import Page from '../components/Page'
32
import Dot from '../components/Dot'
43
import Main from '../components/Main'
54
import Nav from '../components/Nav'
65
import Footer from '../components/Footer'
76

8-
97
export default () => (
108
<Page>
119
<Dot />

pages/projects.js

-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react'
2-
import Head from 'next/head'
32
import Page from '../components/Page'
43
import Dot from '../components/Dot'
54
import Categories from '../components/Categories'

pages/projects/color.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
import Head from 'next/head'
21
import Page from '../../components/Page'
32
import Dot from '../../components/Dot'
43
import ProjectList from '../../components/ProjectList'
54
import { color } from '../../data/projects.json'
65

7-
86
export default () => (
97
<Page>
108
<Dot to='/projects' />
11-
{
12-
color.map(({ id, title, description, githubLink, demoLink }) => (
13-
<ProjectList
14-
id={id}
15-
key={id}
16-
title={title}
17-
description={description}
18-
githubLink={githubLink}
19-
demoLink={demoLink}
20-
/>
21-
))
22-
}
9+
{
10+
color.map(({ id, title, description, githubLink, demoLink }) => (
11+
<ProjectList
12+
id={id}
13+
key={id}
14+
title={title}
15+
description={description}
16+
githubLink={githubLink}
17+
demoLink={demoLink}
18+
/>
19+
))
20+
}
2321
</Page>
2422
)

pages/projects/layout.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
import Head from 'next/head'
21
import Page from '../../components/Page'
32
import Dot from '../../components/Dot'
43
import ProjectList from '../../components/ProjectList'
54
import { layout } from '../../data/projects.json'
65

7-
86
export default () => (
97
<Page>
108
<Dot to='/projects' />
11-
{
12-
layout.map(({ id, title, description, githubLink, demoLink }) => (
13-
<ProjectList
14-
id={id}
15-
key={id}
16-
title={title}
17-
description={description}
18-
githubLink={githubLink}
19-
demoLink={demoLink}
20-
/>
21-
))
22-
}
9+
{
10+
layout.map(({ id, title, description, githubLink, demoLink }) => (
11+
<ProjectList
12+
id={id}
13+
key={id}
14+
title={title}
15+
description={description}
16+
githubLink={githubLink}
17+
demoLink={demoLink}
18+
/>
19+
))
20+
}
2321
</Page>
2422
)

pages/projects/random.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
import Head from 'next/head'
21
import Page from '../../components/Page'
32
import Dot from '../../components/Dot'
43
import ProjectList from '../../components/ProjectList'
54
import { random } from '../../data/projects.json'
65

7-
86
export default () => (
97
<Page>
108
<Dot to='/projects' />
11-
{
12-
random.map(({ id, title, description, githubLink, demoLink }) => (
13-
<ProjectList
14-
id={id}
15-
key={id}
16-
title={title}
17-
description={description}
18-
githubLink={githubLink}
19-
demoLink={demoLink}
20-
/>
21-
))
22-
}
9+
{
10+
random.map(({ id, title, description, githubLink, demoLink }) => (
11+
<ProjectList
12+
id={id}
13+
key={id}
14+
title={title}
15+
description={description}
16+
githubLink={githubLink}
17+
demoLink={demoLink}
18+
/>
19+
))
20+
}
2321
</Page>
2422
)

pages/projects/react.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
import Head from 'next/head'
21
import Page from '../../components/Page'
32
import Dot from '../../components/Dot'
43
import ProjectList from '../../components/ProjectList'
54
import { react } from '../../data/projects.json'
65

7-
86
export default () => (
97
<Page>
108
<Dot to='/projects' />
11-
{
12-
react.map(({ id, title, description, githubLink, demoLink }) => (
13-
<ProjectList
14-
id={id}
15-
key={id}
16-
title={title}
17-
description={description}
18-
githubLink={githubLink}
19-
demoLink={demoLink}
20-
/>
21-
))
22-
}
9+
{
10+
react.map(({ id, title, description, githubLink, demoLink }) => (
11+
<ProjectList
12+
id={id}
13+
key={id}
14+
title={title}
15+
description={description}
16+
githubLink={githubLink}
17+
demoLink={demoLink}
18+
/>
19+
))
20+
}
2321
</Page>
2422
)

pages/projects/sound.js

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,22 @@
1-
import Head from 'next/head'
21
import Page from '../../components/Page'
32
import Dot from '../../components/Dot'
43
import ProjectList from '../../components/ProjectList'
54
import { sound } from '../../data/projects.json'
65

7-
86
export default () => (
97
<Page>
108
<Dot to='/projects' />
11-
{
12-
sound.map(({ id, title, description, githubLink, demoLink }) => (
13-
<ProjectList
14-
id={id}
15-
key={id}
16-
title={title}
17-
description={description}
18-
githubLink={githubLink}
19-
demoLink={demoLink}
20-
/>
21-
))
22-
}
9+
{
10+
sound.map(({ id, title, description, githubLink, demoLink }) => (
11+
<ProjectList
12+
id={id}
13+
key={id}
14+
title={title}
15+
description={description}
16+
githubLink={githubLink}
17+
demoLink={demoLink}
18+
/>
19+
))
20+
}
2321
</Page>
2422
)

0 commit comments

Comments
 (0)