Skip to content

Commit

Permalink
Prettier and eslint (#93)
Browse files Browse the repository at this point in the history
* feat: set-up eslint and prettier

Signed-off-by: Rodolpho Alves <rodolpho.castro.a+macosx@gmail.com>

* chore: setup prettier ignore

Signed-off-by: Rodolpho Alves <rodolpho.castro.a+macosx@gmail.com>

* chore: tune eslint and prettier integration

Signed-off-by: Rodolpho Alves <rodolpho.castro.a+macosx@gmail.com>

* chore: apply prettier to the project

Signed-off-by: Rodolpho Alves <rodolpho.castro.a+macosx@gmail.com>

* cicd: lint files on PRs

Signed-off-by: Rodolpho Alves <rodolpho.castro.a+macosx@gmail.com>

---------

Signed-off-by: Rodolpho Alves <rodolpho.castro.a+macosx@gmail.com>
Co-authored-by: Rodolpho Alves <rodolpho.castro.a+macosx@gmail.com>
  • Loading branch information
rodolphocastro and Rodolpho Alves authored Sep 18, 2024
1 parent b96b674 commit 8a99536
Show file tree
Hide file tree
Showing 15 changed files with 1,318 additions and 121 deletions.
8 changes: 4 additions & 4 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2
updates:
- package-ecosystem: "npm"
directory: "/"
- package-ecosystem: 'npm'
directory: '/'
schedule:
interval: "weekly"
interval: 'weekly'
groups:
npm-dev:
applies-to: version-updates
Expand All @@ -13,4 +13,4 @@ updates:
dependency-type: production
cybersecurity:
applies-to: security-updates
dependency-type: production
dependency-type: production
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI
on:
push:
branches:
- "main"
- 'main'
pull_request:
types: [opened, synchronize, reopened]

Expand All @@ -28,11 +28,11 @@ jobs:
node-version: 20
cache: npm

- name: Setup Pages
uses: actions/configure-pages@v4

- name: Install dependencies
run: npm ci

- name: Build with VitePress
run: npm run build

- name: Lint files
run: npm run lint
6 changes: 6 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
.vitepress/dist
.vitepress/cache
**/.git
**/.svn
**/.hg
**/node_modules
15 changes: 15 additions & 0 deletions .prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"arrowParens": "avoid",
"bracketSpacing": true,
"endOfLine": "lf",
"bracketSameLine": false,
"jsxSingleQuote": false,
"printWidth": 80,
"proseWrap": "preserve",
"quoteProps": "as-needed",
"semi": true,
"singleQuote": true,
"tabWidth": 2,
"trailingComma": "all",
"useTabs": false
}
37 changes: 20 additions & 17 deletions .vitepress/config.mts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { DefaultTheme, defineConfig } from 'vitepress'
import { DefaultTheme, defineConfig } from 'vitepress';

// https://vitepress.dev/reference/site-config
export default defineConfig({
Expand All @@ -15,49 +15,52 @@ export default defineConfig({
hour12: true,
month: 'short',
day: '2-digit',
}
}
}
},
},
},
},
pt: {
label: 'Português 🇧🇷',
lang: 'pt',
}
},
},
themeConfig: {
// https://vitepress.dev/reference/default-theme-config

search: {
provider: 'local'
provider: 'local',
},

nav: [
{ text: 'Home', link: '/' },
{ text: 'Posts', link: '/posts' },
{ text: 'Resume', link: '/curriculum' }
{ text: 'Resume', link: '/curriculum' },
],

sidebar: {
'/posts': postsSideBar()
'/posts': postsSideBar(),
},

socialLinks: [
{ icon: 'github', link: 'https://github.com/rodolphocastro' },
{ icon: 'linkedin', link: 'https://www.linkedin.com/in/rodolpho-alves93/' },
{
icon: 'linkedin',
link: 'https://www.linkedin.com/in/rodolpho-alves93/',
},
],

footer: {
message: "built with ❤️ using Vitepress",
copyright: "Copyright 2024-present Rodolpho Alves"
}
}
})
message: 'built with ❤️ using Vitepress',
copyright: 'Copyright 2024-present Rodolpho Alves',
},
},
});

function postsSideBar(): DefaultTheme.SidebarItem[] {
return [
{
text: '1 - Why',
link: 'posts/001-why.md'
}
]
link: 'posts/001-why.md',
},
];
}
14 changes: 7 additions & 7 deletions .vitepress/theme/index.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// https://vitepress.dev/guide/custom-theme
import { h } from 'vue'
import type { Theme } from 'vitepress'
import DefaultTheme from 'vitepress/theme'
import './style.css'
import { h } from 'vue';
import type { Theme } from 'vitepress';
import DefaultTheme from 'vitepress/theme';
import './style.css';

export default {
extends: DefaultTheme,
Layout: () => {
return h(DefaultTheme.Layout, null, {
// https://vitepress.dev/guide/extending-default-theme#layout-slots
})
});
},
enhanceApp({ app, router, siteData }) {
// ...
}
} satisfies Theme
},
} satisfies Theme;
3 changes: 1 addition & 2 deletions .vitepress/theme/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* in custom container, badges, etc.
* -------------------------------------------------------------------------- */

:root {
:root {
--vp-c-default-1: var(--vp-c-gray-1);
--vp-c-default-2: var(--vp-c-gray-2);
--vp-c-default-3: var(--vp-c-gray-3);
Expand Down Expand Up @@ -136,4 +136,3 @@
.DocSearch {
--docsearch-primary-color: var(--vp-c-brand-1) !important;
}

5 changes: 2 additions & 3 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@
"version": "0.2.0",
"configurations": [
{
"command": "npm run dev",
"command": "npm run dev --open",
"name": "Vitepress Dev mode",
"request": "launch",
"type": "node-terminal",
"type": "node-terminal"
}

]
}
4 changes: 2 additions & 2 deletions curriculum/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
title: "My Resume"
description: "my professional resume"
title: 'My Resume'
description: 'my professional resume'
lang: en
lastUpdated: true
---
Expand Down
8 changes: 8 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import eslintConfigPrettier from 'eslint-config-prettier';

export default [
{
ignores: ['.vitepress/dist', '.vitepress/cache'],
},
eslintConfigPrettier,
];
3 changes: 1 addition & 2 deletions index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ layout: home

hero:
name: "Rodolpho Alves' Website"
tagline: "Welcome to my blog and curriculum"
tagline: 'Welcome to my blog and curriculum'

features:
- title: Blog Posts
Expand All @@ -18,4 +18,3 @@ features:
link: /curriculum
linkText: See Resume
---

Loading

0 comments on commit 8a99536

Please sign in to comment.