Skip to content

Commit

Permalink
chore(root): add formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
hendraaagil committed Jun 12, 2021
1 parent 8a9336a commit a556d45
Show file tree
Hide file tree
Showing 10 changed files with 1,158 additions and 23 deletions.
3 changes: 3 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// .eslintignore
node_modules
db
34 changes: 34 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
module.exports = {
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
env: {
browser: true,
node: true,
es6: true,
},
settings: {
'import/resolver': {
node: {
paths: ['.', 'components', 'styles'],
extensions: ['.js', '.jsx'],
},
},
react: {
version: 'detect',
},
},
extends: ['plugin:react/recommended', 'airbnb', 'prettier'],
plugins: ['react', 'prettier'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.js', '.jsx'] }],
'react/jsx-props-no-spreading': 'off',
'no-plusplus': 'off',
},
};
4 changes: 4 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore :
build
.next
node_modules
10 changes: 10 additions & 0 deletions .prettierrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module.exports = {
tabWidth: 2,
printWidth: 80,
endOfLine: 'auto',
arrowParens: 'always',
semi: true,
useTabs: false,
singleQuote: true,
bracketSpacing: true,
};
4 changes: 3 additions & 1 deletion next-seo.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ const description =
'An opinionated starter project with Next.js and Chakra UI. Created by hendraaagil';
const url = 'https://nextjs-chakra-hendraaagil.vercel.app';

export const SEO = {
const SEO = {
title,
description,
canonical: url,
Expand All @@ -28,3 +28,5 @@ export const SEO = {
},
additionalLinkTags: [{ rel: 'icon', href: '/favicon.ico' }],
};

export default SEO;
15 changes: 14 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,13 @@
"scripts": {
"dev": "next dev",
"build": "next build",
"start": "next start"
"start": "next start",
"lint": "eslint ./components/** ./pages/** -c .eslintrc.js --ext js,jsx",
"lint-fix": "eslint ./components/** ./pages/** -c .eslintrc.js --fix --ext js,jsx"
},
"dependencies": {
"@chakra-ui/react": "^1.6.3",
"@chakra-ui/theme-tools": "^1.1.7",
"@emotion/react": "11",
"@emotion/styled": "11",
"framer-motion": "4",
Expand All @@ -18,5 +21,15 @@
"react": "17.0.2",
"react-dom": "17.0.2",
"react-icons": "^4.2.0"
},
"devDependencies": {
"eslint": "^7.28.0",
"eslint-config-airbnb": "^18.2.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "^2.23.4",
"eslint-plugin-jsx-a11y": "^6.4.1",
"eslint-plugin-prettier": "^3.4.0",
"eslint-plugin-react": "^7.24.0",
"prettier": "^2.3.1"
}
}
6 changes: 3 additions & 3 deletions pages/_app.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ import { DefaultSeo } from 'next-seo';
import { Box, ChakraProvider } from '@chakra-ui/react';
import { AnimatePresence, motion } from 'framer-motion';

import { SEO } from 'next-seo.config';
import { theme } from 'styles/theme';
import { GlobalStyle } from 'styles/styles';
import SEO from 'next-seo.config';
import theme from 'styles/theme';
import GlobalStyle from 'styles/styles';
import 'styles/css/nprogress.css';

import Star from 'components/Star';
Expand Down
4 changes: 3 additions & 1 deletion styles/styles.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Global, css } from '@emotion/react';

export const GlobalStyle = ({ children }) => (
const GlobalStyle = ({ children }) => (
<>
<Global
styles={css`
Expand All @@ -18,3 +18,5 @@ export const GlobalStyle = ({ children }) => (
{children}
</>
);

export default GlobalStyle;
4 changes: 3 additions & 1 deletion styles/theme.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,12 @@ const breakpoints = createBreakpoints({
'2xl': '1440px',
});

export const theme = extendTheme({
const theme = extendTheme({
fonts: {
heading: `'Inter', ${defaultTheme.fonts.heading}`,
body: `'Inter', ${defaultTheme.fonts.body}`,
},
breakpoints,
});

export default theme;
Loading

1 comment on commit a556d45

@vercel
Copy link

@vercel vercel bot commented on a556d45 Jun 12, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.