Commit 6b7864e5 authored by Tim Neutkens's avatar Tim Neutkens

Fix linting

parent 616c3d7a
module.exports = { module.exports = {
distDir: '../../dist/functions/next', distDir: '../../dist/functions/next'
}; }
import React from 'react'; import React from 'react'
import PropTypes from 'prop-types'; import PropTypes from 'prop-types'
import Header from './Header'; import Header from './Header'
const propTypes = { const propTypes = {
children: PropTypes.element, children: PropTypes.element
}; }
const App = ({ children }) => ( const App = ({ children }) => (
<main> <main>
<Header /> <Header />
{children} {children}
</main> </main>
); )
App.propTypes = propTypes; App.propTypes = propTypes
export default App; export default App
import React from 'react'; import React from 'react'
import PropTypes from 'prop-types'; import PropTypes from 'prop-types'
import Link from 'next/link'; import Link from 'next/link'
const propTypes = { const propTypes = {
pathname: PropTypes.String, pathname: PropTypes.String
}; }
const Header = ({ pathname }) => ( const Header = ({ pathname }) => (
<header> <header>
<Link href="/"> <Link href='/'>
<a className={pathname === '/' ? 'is-active' : ''}>Home</a> <a className={pathname === '/' ? 'is-active' : ''}>Home</a>
</Link> </Link>
<span> - </span> <span> - </span>
<Link href="/about"> <Link href='/about'>
<a className={pathname === '/about' ? 'is-active' : ''}>About</a> <a className={pathname === '/about' ? 'is-active' : ''}>About</a>
</Link> </Link>
</header> </header>
); )
Header.propTypes = propTypes; Header.propTypes = propTypes
export default Header; export default Header
import * as React from 'react'; import * as React from 'react'
import App from '../components/App'; import App from '../components/App'
export default () => ( export default () => (
<App> <App>
<p>About Page</p> <p>About Page</p>
</App> </App>
); )
import * as React from 'react'; import * as React from 'react'
import App from '../components/App'; import App from '../components/App'
export default () => ( export default () => (
<App> <App>
<p>Index Page</p> <p>Index Page</p>
</App> </App>
); )
/* eslint-disable import/no-unresolved,import/extensions */ /* eslint-disable import/no-unresolved,import/extensions */
import next from 'next'; import next from 'next'
import express from 'express'; import express from 'express'
import compression from 'compression'; import compression from 'compression'
import helmet from 'helmet'; import helmet from 'helmet'
import cors from 'cors'; import cors from 'cors'
import bodyParser from 'body-parser'; import bodyParser from 'body-parser'
import { functions } from './lib/firebase'; import { functions } from './lib/firebase'
const nextApp = next({ dev: false, conf: { distDir: 'next' } }); const nextApp = next({ dev: false, conf: { distDir: 'next' } })
const handle = nextApp.getRequestHandler(); const handle = nextApp.getRequestHandler()
const server = express(); const server = express()
server.disable('x-powered-by'); server.disable('x-powered-by')
server.use(cors()); server.use(cors())
server.use(bodyParser.json()); server.use(bodyParser.json())
server.set('trust proxy', 1); server.set('trust proxy', 1)
server.use(compression()); server.use(compression())
server.use(helmet()); server.use(helmet())
server.get('*', (req, res) => handle(req, res)); server.get('*', (req, res) => handle(req, res))
const app = functions.https.onRequest(async (req, res) => { const app = functions.https.onRequest(async (req, res) => {
await nextApp.prepare(); await nextApp.prepare()
return server(req, res); return server(req, res)
}); })
export { app }; export { app }
import admin from 'firebase-admin'; import admin from 'firebase-admin'
import * as functions from 'firebase-functions'; import * as functions from 'firebase-functions'
export { functions }; export { functions }
export const firebase = admin.initializeApp(); export const firebase = admin.initializeApp()
...@@ -9,7 +9,7 @@ function fetchQuery ( ...@@ -9,7 +9,7 @@ function fetchQuery (
operation, operation,
variables, variables,
cacheConfig, cacheConfig,
uploadables, uploadables
) { ) {
// Because we implement the graphql server, the client must to point to the same host // Because we implement the graphql server, the client must to point to the same host
const relayServer = process.browser ? '' : process.env.RELAY_SERVER const relayServer = process.browser ? '' : process.env.RELAY_SERVER
......
...@@ -14,6 +14,7 @@ ...@@ -14,6 +14,7 @@
"test": "npm run testall || npm run testall", "test": "npm run testall || npm run testall",
"coveralls": "cat ./test/coverage/lcov.info | coveralls", "coveralls": "cat ./test/coverage/lcov.info | coveralls",
"lint": "lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts", "lint": "lerna run typescript && standard && standard --parser typescript-eslint-parser --plugin typescript packages/**/*.ts",
"lint-fix": "standard --fix && standard --fix --parser typescript-eslint-parser --plugin typescript packages/**/*.ts",
"typescript": "lerna run typescript", "typescript": "lerna run typescript",
"prepublish": "lerna run prepublish", "prepublish": "lerna run prepublish",
"publish-canary": "lerna version prerelease --preid canary --force-publish", "publish-canary": "lerna version prerelease --preid canary --force-publish",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment