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:
parent
616c3d7ac8
commit
6b7864e57e
|
@ -1,3 +1,3 @@
|
|||
module.exports = {
|
||||
distDir: '../../dist/functions/next',
|
||||
};
|
||||
distDir: '../../dist/functions/next'
|
||||
}
|
||||
|
|
|
@ -1,18 +1,18 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Header from './Header';
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import Header from './Header'
|
||||
|
||||
const propTypes = {
|
||||
children: PropTypes.element,
|
||||
};
|
||||
children: PropTypes.element
|
||||
}
|
||||
|
||||
const App = ({ children }) => (
|
||||
<main>
|
||||
<Header />
|
||||
{children}
|
||||
</main>
|
||||
);
|
||||
)
|
||||
|
||||
App.propTypes = propTypes;
|
||||
App.propTypes = propTypes
|
||||
|
||||
export default App;
|
||||
export default App
|
||||
|
|
|
@ -1,23 +1,23 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import Link from 'next/link';
|
||||
import React from 'react'
|
||||
import PropTypes from 'prop-types'
|
||||
import Link from 'next/link'
|
||||
|
||||
const propTypes = {
|
||||
pathname: PropTypes.String,
|
||||
};
|
||||
pathname: PropTypes.String
|
||||
}
|
||||
|
||||
const Header = ({ pathname }) => (
|
||||
<header>
|
||||
<Link href="/">
|
||||
<Link href='/'>
|
||||
<a className={pathname === '/' ? 'is-active' : ''}>Home</a>
|
||||
</Link>
|
||||
<span> - </span>
|
||||
<Link href="/about">
|
||||
<Link href='/about'>
|
||||
<a className={pathname === '/about' ? 'is-active' : ''}>About</a>
|
||||
</Link>
|
||||
</header>
|
||||
);
|
||||
)
|
||||
|
||||
Header.propTypes = propTypes;
|
||||
Header.propTypes = propTypes
|
||||
|
||||
export default Header;
|
||||
export default Header
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as React from 'react';
|
||||
import App from '../components/App';
|
||||
import * as React from 'react'
|
||||
import App from '../components/App'
|
||||
|
||||
export default () => (
|
||||
<App>
|
||||
<p>About Page</p>
|
||||
</App>
|
||||
);
|
||||
)
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import * as React from 'react';
|
||||
import App from '../components/App';
|
||||
import * as React from 'react'
|
||||
import App from '../components/App'
|
||||
|
||||
export default () => (
|
||||
<App>
|
||||
<p>Index Page</p>
|
||||
</App>
|
||||
);
|
||||
)
|
||||
|
|
|
@ -1,28 +1,28 @@
|
|||
/* eslint-disable import/no-unresolved,import/extensions */
|
||||
import next from 'next';
|
||||
import express from 'express';
|
||||
import compression from 'compression';
|
||||
import helmet from 'helmet';
|
||||
import cors from 'cors';
|
||||
import bodyParser from 'body-parser';
|
||||
import { functions } from './lib/firebase';
|
||||
import next from 'next'
|
||||
import express from 'express'
|
||||
import compression from 'compression'
|
||||
import helmet from 'helmet'
|
||||
import cors from 'cors'
|
||||
import bodyParser from 'body-parser'
|
||||
import { functions } from './lib/firebase'
|
||||
|
||||
const nextApp = next({ dev: false, conf: { distDir: 'next' } });
|
||||
const handle = nextApp.getRequestHandler();
|
||||
const nextApp = next({ dev: false, conf: { distDir: 'next' } })
|
||||
const handle = nextApp.getRequestHandler()
|
||||
|
||||
const server = express();
|
||||
server.disable('x-powered-by');
|
||||
server.use(cors());
|
||||
server.use(bodyParser.json());
|
||||
server.set('trust proxy', 1);
|
||||
server.use(compression());
|
||||
server.use(helmet());
|
||||
const server = express()
|
||||
server.disable('x-powered-by')
|
||||
server.use(cors())
|
||||
server.use(bodyParser.json())
|
||||
server.set('trust proxy', 1)
|
||||
server.use(compression())
|
||||
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) => {
|
||||
await nextApp.prepare();
|
||||
return server(req, res);
|
||||
});
|
||||
await nextApp.prepare()
|
||||
return server(req, res)
|
||||
})
|
||||
|
||||
export { app };
|
||||
export { app }
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import admin from 'firebase-admin';
|
||||
import * as functions from 'firebase-functions';
|
||||
import admin from 'firebase-admin'
|
||||
import * as functions from 'firebase-functions'
|
||||
|
||||
export { functions };
|
||||
export const firebase = admin.initializeApp();
|
||||
export { functions }
|
||||
export const firebase = admin.initializeApp()
|
||||
|
|
|
@ -9,7 +9,7 @@ function fetchQuery (
|
|||
operation,
|
||||
variables,
|
||||
cacheConfig,
|
||||
uploadables,
|
||||
uploadables
|
||||
) {
|
||||
// Because we implement the graphql server, the client must to point to the same host
|
||||
const relayServer = process.browser ? '' : process.env.RELAY_SERVER
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
"test": "npm run testall || npm run testall",
|
||||
"coveralls": "cat ./test/coverage/lcov.info | coveralls",
|
||||
"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",
|
||||
"prepublish": "lerna run prepublish",
|
||||
"publish-canary": "lerna version prerelease --preid canary --force-publish",
|
||||
|
|
Loading…
Reference in a new issue