Skip to content

Commit

Permalink
clean prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
thedaviddias committed Jul 27, 2022
1 parent e0ef8c0 commit b3d6c9a
Show file tree
Hide file tree
Showing 17 changed files with 210 additions and 72 deletions.
42 changes: 41 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,43 @@
module.exports = {
extends: "next/core-web-vitals"
plugins: ['simple-import-sort'],
extends: ['next/core-web-vitals', 'plugin:import/recommended', 'prettier'],
rules: {
'simple-import-sort/imports': [
'warn',
{
groups: [
// ext library & side effect imports
['^@?\\w', '^\\u0000'],
// {s}css files
['^.+\\.s?css$'],
// Lib and hooks
['^@/lib', '^@/hooks'],
// static data
['^@/data'],
// components
['^@/components'],
// Other imports
['^@/'],
// relative paths up until 3 level
[
'^\\./?$',
'^\\.(?!/?$)',
'^\\.\\./?$',
'^\\.\\.(?!/?$)',
'^\\.\\./\\.\\./?$',
'^\\.\\./\\.\\.(?!/?$)',
'^\\.\\./\\.\\./\\.\\./?$',
'^\\.\\./\\.\\./\\.\\.(?!/?$)',
],
['^@/types'],
// other that didnt fit in
['^'],
],
},
],
'simple-import-sort/exports': 'error',
'import/first': 'error',
'import/newline-after-import': 'error',
'import/no-duplicates': 'error',
},
}
2 changes: 1 addition & 1 deletion .github/workflows/deploy-vercel-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "${{ steps.nvmrc.outputs.version }}"
node-version: '${{ steps.nvmrc.outputs.version }}'

- name: Install pnpm
uses: pnpm/action-setup@v2.2.2
Expand Down
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.next
next-env.d.ts
node_modules
package-lock.json
public
pnpm-lock.yaml
12 changes: 11 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "next lint"
"lint": "next lint",
"check:format": "prettier --check .",
"check:lint": "eslint . --ext js,ts,tsx",
"check:types": "tsc -p tsconfig.json --noEmit --pretty",
"format": "prettier --write .",
"lint:write": "eslint . --ext js,ts,tsx --fix --max-warnings=0"
},
"dependencies": {
"@tailwindcss/aspect-ratio": "^0.4.0",
Expand Down Expand Up @@ -36,9 +41,14 @@
"date-fns": "^2.29.1",
"eslint": "8.20.0",
"eslint-config-next": "12.2.3",
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-simple-import-sort": "^7.0.0",
"hast-util-has-property": "^2.0.0",
"hast-util-heading-rank": "^2.1.0",
"hast-util-to-string": "^2.0.0",
"prettier": "^2.7.1",
"react-social-media-embed": "^2.2.2",
"rehype-autolink-headings": "^6.1.1",
"rehype-image-placeholder": "^1.0.1",
Expand Down
116 changes: 116 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion public/google4385e63ec6c7b5f1.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
google-site-verification: google4385e63ec6c7b5f1.html
google-site-verification: google4385e63ec6c7b5f1.html
24 changes: 12 additions & 12 deletions public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"name": "David Dias",
"short_name": "David Dias",
"icons": [
{
"src": "/img/website/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
"name": "David Dias",
"short_name": "David Dias",
"icons": [
{
"src": "/img/website/android-chrome-96x96.png",
"sizes": "96x96",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
4 changes: 1 addition & 3 deletions src/components/Container/Container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,7 @@ export const Container: FC<ContainerProps> = ({ children }) => {
<div className="min-h-screen flex flex-col">
<Header pathname={router.pathname} />
<div className="py-3 top-0 mb-12">
<div className="max-w-5xl mx-auto px-2 sm:px-6 lg:px-8">
{children}
</div>
<div className="max-w-5xl mx-auto px-2 sm:px-6 lg:px-8">{children}</div>
</div>
<Footer />
</div>
Expand Down
3 changes: 2 additions & 1 deletion src/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import '../styles/globals.css'
import type { AppProps } from 'next/app'

import '../styles/globals.css'

function MyApp({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}
Expand Down
21 changes: 9 additions & 12 deletions src/pages/blog/[slug].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,26 +13,23 @@ import rehypeSlug from 'rehype-slug'
import remarkGfm from 'remark-gfm'
import slugify from 'slugify'


import { AdjacentPosts } from '@/components/AdjacentPosts'
import { Author } from '@/components/Author'
import { Container } from '@/components/Container'

import { CustomLink } from '@/components/CustomLink'
import { DatePost } from '@/components/DatePost'
import { H1 } from '@/components/Headings'
import { MDXComponents } from '@/components/MdxComponents'

import { Paragraph } from '@/components/Paragraph'
import { Share } from '@/components/Share'
import { TableOfContents } from '@/components/TableOfContents'
import { Tags } from '@/components/Tags'

import { routes } from '@/config/routes'
import { baseUrl } from '@/config/seo'
import { getAdjacentPosts, getAllPosts, getPost, getPostBySlug } from '@/utils/get-blog-posts'
import { rehypeExtractHeadings } from '@/utils/rehype-extract-headings'
import { remarkCodeTitles } from '@/utils/remark-code-titles'
import { H1 } from '@/components/Headings'
import { CustomLink } from '@/components/CustomLink'
import { Paragraph } from '@/components/Paragraph'
import { Author } from '@/components/Author'
import { DatePost } from '@/components/DatePost'
import { Tags } from '@/components/Tags'
import { TableOfContents } from '@/components/TableOfContents'
import { AdjacentPosts } from '@/components/AdjacentPosts'
import { Share } from '@/components/Share'

export type BlogPostProps = {
frontMatter: {
Expand Down
2 changes: 0 additions & 2 deletions src/pages/blog/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ import { H1, H5 } from '@/components/Headings'
import { routes } from '@/config/routes'
import { getAllPostsWithFrontMatter } from '@/utils/get-blog-posts'



type BlogProps = {
posts: any[]
}
Expand Down
2 changes: 0 additions & 2 deletions src/pages/category/[category].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ import { H1 } from '@/components/Headings'
import { routes } from '@/config/routes'
import { getAllPostsWithFrontMatter, getCategories } from '@/utils/get-blog-posts'



type CategoryPageProps = {
posts: any[]
category: {
Expand Down
Loading

0 comments on commit b3d6c9a

Please sign in to comment.