1
0
Fork 0
mirror of https://github.com/terribleplan/next.js.git synced 2024-01-19 02:48:18 +00:00

Fix linting

This commit is contained in:
Tim Neutkens 2017-11-25 12:03:25 +01:00
parent 52bf00eda3
commit c9401214db
10 changed files with 52 additions and 85 deletions

View file

@ -7,7 +7,7 @@ function Post ({ id, data: { loading, error, Post } }) {
<section>
<div key={Post.id}>
<h1>{Post.title}</h1>
<p>ID: {Post.id}<br/>URL: {Post.url}</p>
<p>ID: {Post.id}<br />URL: {Post.url}</p>
<PostUpvoter id={Post.id} votes={Post.votes} />
</div>
</section>
@ -26,7 +26,6 @@ const post = gql`
}
`
// The `graphql` wrapper executes a GraphQL query and makes the results
// available on the `data` prop of the wrapped component (PostList)
// Tip: ownProps is parent component's props

View file

@ -16,7 +16,7 @@ function PostList ({ data: { loading, error, allPosts, _allPostsMeta }, loadMore
<li key={post.id}>
<div>
<span>{index + 1}. </span>
<Link href={{ pathname: '/blog/'+post.id}}><a>{post.title}</a></Link>
<Link href={{ pathname: '/blog/' + post.id }}><a>{post.title}</a></Link>
<PostUpvoter id={post.id} votes={post.votes} />
</div>
</li>

View file

@ -1,7 +1,5 @@
import App from '../components/App'
import Header from '../components/Header'
import Submit from '../components/Submit'
import PostList from '../components/PostList'
import withData from '../lib/withData'
export default withData((props) => (

View file

@ -37,4 +37,3 @@ app.prepare().then(() => {
console.log(`> Ready on http://localhost:${port}`)
})
})

View file

@ -7,23 +7,23 @@ const defaultOGImage = ''
const Head = (props) => (
<NextHead>
<meta charset="UTF-8" />
<meta charset='UTF-8' />
<title>{props.title || ''}</title>
<meta name="description" content={props.description || defaultDescription} />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" sizes="192x192" href="/static/touch-icon.png" />
<link rel="apple-touch-icon" href="/static/touch-icon.png" />
<link rel="mask-icon" href="/static/favicon-mask.svg" color="#49B882" />
<link rel="icon" href="/static/favicon.ico" />
<meta property="og:url" content={props.url || defaultOGURL} />
<meta property="og:title" content={props.title || ''} />
<meta property="og:description" content={props.description || defaultDescription} />
<meta name="twitter:site" content={props.url || defaultOGURL} />
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:image" content={props.ogImage || defaultOGImage} />
<meta property="og:image" content={props.ogImage || defaultOGImage} />
<meta property="og:image:width" content="1200" />
<meta property="og:image:height" content="630" />
<meta name='description' content={props.description || defaultDescription} />
<meta name='viewport' content='width=device-width, initial-scale=1' />
<link rel='icon' sizes='192x192' href='/static/touch-icon.png' />
<link rel='apple-touch-icon' href='/static/touch-icon.png' />
<link rel='mask-icon' href='/static/favicon-mask.svg' color='#49B882' />
<link rel='icon' href='/static/favicon.ico' />
<meta property='og:url' content={props.url || defaultOGURL} />
<meta property='og:title' content={props.title || ''} />
<meta property='og:description' content={props.description || defaultDescription} />
<meta name='twitter:site' content={props.url || defaultOGURL} />
<meta name='twitter:card' content='summary_large_image' />
<meta name='twitter:image' content={props.ogImage || defaultOGImage} />
<meta property='og:image' content={props.ogImage || defaultOGImage} />
<meta property='og:image:width' content='1200' />
<meta property='og:image:height' content='630' />
</NextHead>
)

View file

@ -1,6 +1,4 @@
import Head from './head'
import Link from 'next/link'
const links = [
{ href: 'https://github.com/segmentio/create-next-app', label: 'Github' }
].map(link => {
@ -12,7 +10,7 @@ const Nav = () => (
<nav>
<ul>
<li>
<Link prefetch href="/">
<Link prefetch href='/'>
<a>Home</a>
</Link>
</li>
@ -21,7 +19,7 @@ const Nav = () => (
({ key, href, label }) => (
<li key={key}>
<Link href={href}>
<a className="btn-blue">{label}</a>
<a className='btn-blue'>{label}</a>
</Link>
</li>
)

View file

@ -1,17 +1,17 @@
import Document, { Head, Main, NextScript } from 'next/document'
class MyDocument extends Document {
static getInitialProps({ renderPage }) {
static getInitialProps ({ renderPage }) {
const { html, head, errorHtml, chunks } = renderPage()
return { html, head, errorHtml, chunks }
}
render() {
render () {
return (
<html>
<Head>
<link rel="stylesheet" href="/static/css/bundle.css" />
<link rel='stylesheet' href='/static/css/bundle.css' />
</Head>
<body>
{this.props.customValue}
@ -23,4 +23,4 @@ class MyDocument extends Document {
}
}
export default MyDocument;
export default MyDocument

View file

@ -1,13 +1,12 @@
import Link from 'next/link'
import Head from '../components/head'
import Nav from '../components/nav'
export default () => (
<div>
<Head title="Home" />
<Head title='Home' />
<Nav />
<div className="hero">
<h1 className="title">Next.js + Tailwind css</h1>
<div className='hero'>
<h1 className='title'>Next.js + Tailwind css</h1>
</div>
</div>
)

View file

@ -1,10 +1,10 @@
var tailwindcss = require('tailwindcss');
var tailwindcss = require('tailwindcss')
module.exports = {
plugins: [
require('postcss-easy-import'),
tailwindcss('./styles/config/tailwind.config.js'),
require('autoprefixer'),
require('cssnano'),
require('cssnano')
]
}

View file

@ -12,7 +12,6 @@ we've done our very best to explain each section.
View the full documentation at https://tailwindcss.com.
|-------------------------------------------------------------------------------
| The default config
|-------------------------------------------------------------------------------
@ -24,8 +23,7 @@ View the full documentation at https://tailwindcss.com.
|
*/
var defaultConfig = require('tailwindcss/defaultConfig')()
// var defaultConfig = require('tailwindcss/defaultConfig')()
/*
|-------------------------------------------------------------------------------
@ -126,7 +124,7 @@ var colors = {
'pink': '#f66d9b',
'pink-light': '#fa7ea8',
'pink-lighter': '#ffbbca',
'pink-lightest': '#ffebef',
'pink-lightest': '#ffebef'
}
module.exports = {
@ -146,7 +144,6 @@ module.exports = {
colors: colors,
/*
|-----------------------------------------------------------------------------
| Screens https://tailwindcss.com/docs/responsive-design
@ -170,10 +167,9 @@ module.exports = {
'sm': '576px',
'md': '768px',
'lg': '992px',
'xl': '1200px',
'xl': '1200px'
},
/*
|-----------------------------------------------------------------------------
| Fonts https://tailwindcss.com/docs/fonts
@ -204,7 +200,7 @@ module.exports = {
'Fira Sans',
'Droid Sans',
'Helvetica Neue',
'sans-serif',
'sans-serif'
],
'serif': [
'Constantia',
@ -216,7 +212,7 @@ module.exports = {
'Bitstream Vera Serif',
'Liberation Serif',
'Georgia',
'serif',
'serif'
],
'mono': [
'Menlo',
@ -224,11 +220,10 @@ module.exports = {
'Consolas',
'Liberation Mono',
'Courier New',
'monospace',
'monospace'
]
},
/*
|-----------------------------------------------------------------------------
| Text sizes https://tailwindcss.com/docs/text-sizing
@ -257,10 +252,9 @@ module.exports = {
'2xl': '1.5rem', // 24px
'3xl': '1.875rem', // 30px
'4xl': '2.25rem', // 36px
'5xl': '3rem', // 48px
'5xl': '3rem' // 48px
},
/*
|-----------------------------------------------------------------------------
| Font weights https://tailwindcss.com/docs/font-weight
@ -284,10 +278,9 @@ module.exports = {
'semibold': 600,
'bold': 700,
'extrabold': 800,
'black': 900,
'black': 900
},
/*
|-----------------------------------------------------------------------------
| Leading (line height) https://tailwindcss.com/docs/line-height
@ -304,10 +297,9 @@ module.exports = {
'none': 1,
'tight': 1.25,
'normal': 1.5,
'loose': 2,
'loose': 2
},
/*
|-----------------------------------------------------------------------------
| Tracking (letter spacing) https://tailwindcss.com/docs/letter-spacing
@ -323,10 +315,9 @@ module.exports = {
tracking: {
'tight': '-0.05em',
'normal': '0',
'wide': '0.05em',
'wide': '0.05em'
},
/*
|-----------------------------------------------------------------------------
| Text colors https://tailwindcss.com/docs/text-color
@ -342,7 +333,6 @@ module.exports = {
textColors: colors,
/*
|-----------------------------------------------------------------------------
| Background colors https://tailwindcss.com/docs/background-color
@ -358,7 +348,6 @@ module.exports = {
backgroundColors: colors,
/*
|-----------------------------------------------------------------------------
| Border widths https://tailwindcss.com/docs/border-width
@ -377,10 +366,9 @@ module.exports = {
'0': '0',
'2': '2px',
'4': '4px',
'8': '8px',
'8': '8px'
},
/*
|-----------------------------------------------------------------------------
| Border colors https://tailwindcss.com/docs/border-color
@ -400,7 +388,6 @@ module.exports = {
borderColors: Object.assign({ default: colors['grey-light'] }, colors),
/*
|-----------------------------------------------------------------------------
| Border radius https://tailwindcss.com/docs/border-radius
@ -422,10 +409,9 @@ module.exports = {
'sm': '.125rem',
default: '.25rem',
'lg': '.5rem',
'full': '9999px',
'full': '9999px'
},
/*
|-----------------------------------------------------------------------------
| Width https://tailwindcss.com/docs/width
@ -477,7 +463,6 @@ module.exports = {
'screen': '100vw'
},
/*
|-----------------------------------------------------------------------------
| Height https://tailwindcss.com/docs/height
@ -513,7 +498,6 @@ module.exports = {
'screen': '100vh'
},
/*
|-----------------------------------------------------------------------------
| Minimum width https://tailwindcss.com/docs/min-width
@ -530,10 +514,9 @@ module.exports = {
minWidth: {
'0': '0',
'full': '100%',
'full': '100%'
},
/*
|-----------------------------------------------------------------------------
| Minimum height https://tailwindcss.com/docs/min-height
@ -554,7 +537,6 @@ module.exports = {
'screen': '100vh'
},
/*
|-----------------------------------------------------------------------------
| Maximum width https://tailwindcss.com/docs/max-width
@ -580,10 +562,9 @@ module.exports = {
'3xl': '80rem',
'4xl': '90rem',
'5xl': '100rem',
'full': '100%',
'full': '100%'
},
/*
|-----------------------------------------------------------------------------
| Maximum height https://tailwindcss.com/docs/max-height
@ -600,10 +581,9 @@ module.exports = {
maxHeight: {
'full': '100%',
'screen': '100vh',
'screen': '100vh'
},
/*
|-----------------------------------------------------------------------------
| Padding https://tailwindcss.com/docs/padding
@ -627,10 +607,9 @@ module.exports = {
'3': '0.75rem',
'4': '1rem',
'6': '1.5rem',
'8': '2rem',
'8': '2rem'
},
/*
|-----------------------------------------------------------------------------
| Margin https://tailwindcss.com/docs/margin
@ -655,10 +634,9 @@ module.exports = {
'3': '0.75rem',
'4': '1rem',
'6': '1.5rem',
'8': '2rem',
'8': '2rem'
},
/*
|-----------------------------------------------------------------------------
| Negative margin https://tailwindcss.com/docs/negative-margin
@ -682,10 +660,9 @@ module.exports = {
'3': '0.75rem',
'4': '1rem',
'6': '1.5rem',
'8': '2rem',
'8': '2rem'
},
/*
|-----------------------------------------------------------------------------
| Shadows https://tailwindcss.com/docs/shadows
@ -707,10 +684,9 @@ module.exports = {
'md': '0 4px 8px 0 rgba(0,0,0,0.12), 0 2px 4px 0 rgba(0,0,0,0.08)',
'lg': '0 15px 30px 0 rgba(0,0,0,0.11), 0 5px 15px 0 rgba(0,0,0,0.08)',
'inner': 'inset 0 2px 4px 0 rgba(0,0,0,0.06)',
'none': 'none',
'none': 'none'
},
/*
|-----------------------------------------------------------------------------
| Z-index https://tailwindcss.com/docs/z-index
@ -731,10 +707,9 @@ module.exports = {
'20': 20,
'30': 30,
'40': 40,
'50': 50,
'50': 50
},
/*
|-----------------------------------------------------------------------------
| Opacity https://tailwindcss.com/docs/opacity
@ -753,10 +728,9 @@ module.exports = {
'25': '.25',
'50': '.5',
'75': '.75',
'100': '1',
'100': '1'
},
/*
|-----------------------------------------------------------------------------
| Options https://tailwindcss.com/docs/configuration#options
@ -769,7 +743,7 @@ module.exports = {
options: {
prefix: '',
important: false,
},
important: false
}
}