-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from devashish2024/main
add a auto lint workflow
- Loading branch information
Showing
110 changed files
with
16,049 additions
and
3,393 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.yarn | ||
.next | ||
yarn.lock | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,9 @@ | ||
{ | ||
"extends": "next/core-web-vitals", | ||
"rules": { | ||
"extends": ["next/core-web-vitals", "plugin:prettier/recommended"], | ||
"rules": { | ||
"react/no-unescaped-entities": 0, | ||
"@next/next/no-img-element": 0 | ||
} | ||
"@next/next/no-img-element": 0, | ||
"prettier/prettier": "error" | ||
}, | ||
"plugins": ["prettier"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Lint, Format, and Type Check | ||
|
||
on: | ||
push: | ||
branches: | ||
- '**' | ||
pull_request: | ||
branches: | ||
- '**' | ||
|
||
jobs: | ||
lint-and-format: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '21' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Run ESLint | ||
run: npm run lint --fix | ||
|
||
- name: Run Prettier | ||
run: npm run format | ||
|
||
- name: Run Type Check | ||
run: npm run type-check | ||
|
||
- name: Commit and Push Changes | ||
run: | | ||
git config --local user.name "github-actions[bot]" | ||
git config --local user.email "github-actions[bot]@users.noreply.github.com" | ||
git add . | ||
git commit -m "Prettier Format & ESLint" || echo "No changes to commit" | ||
git push origin ${{ github.ref }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
node_modules | ||
.yarn | ||
.next | ||
yarn.lock | ||
package-lock.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"semi": true, | ||
"singleQuote": true, | ||
"trailingComma": "all" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
{ | ||
"typescript.tsdk": "node_modules/typescript/lib" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,42 @@ | ||
import { getGitHubDownloads, getModrinthDownloads, getPlanetMCDownloads, getCurseForgeDownloads } from "@/lib/getDownloads"; | ||
import { NextResponse } from "next/server"; | ||
import { | ||
getGitHubDownloads, | ||
getModrinthDownloads, | ||
getPlanetMCDownloads, | ||
getCurseForgeDownloads, | ||
} from '@/lib/getDownloads'; | ||
import { NextResponse } from 'next/server'; | ||
|
||
export async function GET(request: any) { | ||
const [github, modrinth, planetmc, curseforge] = await Promise.all([ | ||
getGitHubDownloads(), | ||
getModrinthDownloads(), | ||
getPlanetMCDownloads(), | ||
getCurseForgeDownloads() | ||
getCurseForgeDownloads(), | ||
]); | ||
|
||
if (typeof github === 'number' && typeof modrinth === 'number' && typeof planetmc === 'number' && typeof curseforge === 'number') { | ||
if ( | ||
typeof github === 'number' && | ||
typeof modrinth === 'number' && | ||
typeof planetmc === 'number' && | ||
typeof curseforge === 'number' | ||
) { | ||
const total = github + modrinth + planetmc + curseforge; | ||
return NextResponse.json({ | ||
downloads: { | ||
github, | ||
modrinth, | ||
planetmc, | ||
curseforge, | ||
total, | ||
} | ||
}, { status: 200 }); | ||
return NextResponse.json( | ||
{ | ||
downloads: { | ||
github, | ||
modrinth, | ||
planetmc, | ||
curseforge, | ||
total, | ||
}, | ||
}, | ||
{ status: 200 }, | ||
); | ||
} else { | ||
return NextResponse.json({ message: "Server-side error during fetching of downloads" }, { status: 500 }); | ||
return NextResponse.json( | ||
{ message: 'Server-side error during fetching of downloads' }, | ||
{ status: 500 }, | ||
); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,12 @@ | ||
import Download from "@/components/Sections/download/download"; | ||
import { Metadata } from "next"; | ||
import Download from '@/components/Sections/download/download'; | ||
import { Metadata } from 'next'; | ||
|
||
export const metadata: Metadata = { | ||
title: "ClickCrystals - Download", | ||
description: "Download ClickCrystals and experience its whole set of ultimate features. Downloading ClickCrystals is a click-to-go process, so why not do it now?", | ||
} | ||
title: 'ClickCrystals - Download', | ||
description: | ||
'Download ClickCrystals and experience its whole set of ultimate features. Downloading ClickCrystals is a click-to-go process, so why not do it now?', | ||
}; | ||
|
||
export default function download() { | ||
return ( | ||
<Download/> | ||
) | ||
} | ||
return <Download />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,11 @@ | ||
import { Metadata } from "next"; | ||
import { Metadata } from 'next'; | ||
|
||
export const metadata: Metadata = { | ||
title: "ClickCrystals - Gallery", | ||
} | ||
title: 'ClickCrystals - Gallery', | ||
}; | ||
|
||
import Gallery from "@/components/Sections/gallery/Gallery"; | ||
import Gallery from '@/components/Sections/gallery/Gallery'; | ||
|
||
export default function GalleryPage() { | ||
return ( | ||
<Gallery /> | ||
) | ||
} | ||
return <Gallery />; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.