Skip to content

Commit

Permalink
Add prettier for lint and Github workflow (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sama-004 authored Oct 3, 2024
1 parent 4da16ab commit 69e32bc
Show file tree
Hide file tree
Showing 26 changed files with 3,844 additions and 1,631 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/prettier-formatting-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# workflow to check if the formatting is following the prettierrc
name: Prettier Formatting Check

on:
pull_request:
branches:
- master

jobs:
prettier:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20.x'

- name: Install dependencies
run: npm install --save-dev prettier

- name: Run Prettier check
run: |
npx prettier --check "**/*.{js,ts,tsx,jsx,json,css}" || (echo "Prettier check failed. Please run 'npm run prettier:format' locally to fix the formatting issues and push the changes." && exit 1)
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
node_modules
.github
.next
9 changes: 9 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"semi": true,

"singleQuote": true,

"tabWidth": 2,

"trailingComma": "all"
}
8 changes: 4 additions & 4 deletions next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ const nextConfig = {
images: {
remotePatterns: [
{
protocol: "https",
hostname: "dicedb.io",
port: "",
pathname: "/**",
protocol: 'https',
hostname: 'dicedb.io',
port: '',
pathname: '/**',
},
],
},
Expand Down
Loading

0 comments on commit 69e32bc

Please sign in to comment.