Skip to content

Commit

Permalink
Init commit
Browse files Browse the repository at this point in the history
Eslint
General env setup
Prettier
nodemon
  • Loading branch information
Sebastp committed Nov 3, 2019
0 parents commit f4f8394
Show file tree
Hide file tree
Showing 18 changed files with 13,296 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"presets": [
"next/babel"
],
"plugins": [
[
"babel-plugin-root-import"
]
]
}
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
next.config.js
jest.config.js
25 changes: 25 additions & 0 deletions .eslintrc generated
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"airbnb"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module"
},
"plugins": [
"react"
],
"rules": {
}
}
18 changes: 18 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 2019,
"sourceType": "module"
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"extends": ["airbnb", "prettier", "prettier/react"],
"plugins": ["react", "prettier"],
"rules": {
"prettier/prettier": "error",
"no-var": "warn"
}
}
25 changes: 25 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# next.js
/.next/
/out/

# production
/build

# misc
.DS_Store
.env*

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.cache
package.json
package-lock.json
public
7 changes: 7 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"endOfLine": "lf",
"semi": false,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "es5"
}
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Tech to use:
https://github.com/immutable-js/immutable-js
typescript or prop-types
https://github.com/apollographql/eslint-plugin-graphql
https://www.npmjs.com/package/react-helmet

Bootstraps:
https://github.com/Sly777/ran
https://github.com/tomanagle/Apollo-Next.js-GraphQL-starter
56 changes: 56 additions & 0 deletions components/nav.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import React from 'react'
import Link from 'next/link'

const links = [
{ href: 'https://zeit.co/now', label: 'ZEIT' },
{ href: 'https://github.com/zeit/next.js', label: 'GitHub' }
].map(link => {
link.key = `nav-link-${link.href}-${link.label}`
return link
})

const Nav = () => (
<nav>
<ul>
<li>
<Link href='/'>
<a>Home</a>
</Link>
</li>
{links.map(({ key, href, label }) => (
<li key={key}>
<a href={href}>{label}</a>
</li>
))}
</ul>

<style jsx>{`
:global(body) {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Avenir Next, Avenir,
Helvetica, sans-serif;
}
nav {
text-align: center;
}
ul {
display: flex;
justify-content: space-between;
}
nav > ul {
padding: 4px 16px;
}
li {
display: flex;
padding: 6px 8px;
}
a {
color: #067df7;
text-decoration: none;
font-size: 13px;
}
`}</style>
</nav>
)

export default Nav
3 changes: 3 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = {
testPathIgnorePatterns: ['/node_modules/', '/build/']
}
22 changes: 22 additions & 0 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require('dotenv').config()

const path = require('path')
const Dotenv = require('dotenv-webpack')

module.exports = {
webpack: config => {
config.plugins = config.plugins || []

config.plugins = [
...config.plugins,

// Read the .env file
new Dotenv({
path: path.join(__dirname, '.env'),
systemvars: true
})
]

return config
}
}
3 changes: 3 additions & 0 deletions nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"watch": ["server/**/*.js"]
}
Loading

0 comments on commit f4f8394

Please sign in to comment.