-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d6fa8c0
commit ce7918c
Showing
10 changed files
with
1,211 additions
and
208 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,47 @@ | ||
name: Code Quality | ||
|
||
on: | ||
workflow_call: | ||
outputs: | ||
status: | ||
description: "The status of the quality checks" | ||
value: ${{ jobs.code-quality.outputs.status }} | ||
|
||
jobs: | ||
code-quality: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
status: ${{ steps.quality-check.outputs.status }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: '22' | ||
|
||
- name: Setup pnpm | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
|
||
- name: Install Dependencies | ||
working-directory: frontend | ||
run: pnpm install | ||
|
||
- name: Type Check | ||
working-directory: frontend | ||
run: pnpm typecheck | ||
|
||
- name: Lint | ||
working-directory: frontend | ||
run: pnpm lint | ||
|
||
- name: Build | ||
working-directory: frontend | ||
run: pnpm build | ||
|
||
- name: Set output | ||
id: quality-check | ||
run: echo "status=success" >> $GITHUB_OUTPUT |
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,10 @@ | ||
name: Pull Request Checks | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
quality: | ||
uses: ./.github/workflows/code-quality.yml |
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,4 @@ | ||
cd frontend || exit | ||
|
||
echo "Running code quality check..." | ||
pnpm lint |
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,14 @@ | ||
# Run only if there are changes in the frontend directory | ||
if git diff --name-only HEAD^ HEAD | grep --quiet "frontend"; then | ||
|
||
# Change to frontend from any path | ||
git_root=$(git rev-parse --show-toplevel) | ||
cd "$git_root/frontend" || exit | ||
|
||
echo "Running code quality check..." | ||
pnpm lint | ||
|
||
echo "Running type check..." | ||
pnpm typecheck | ||
|
||
fi |
This file was deleted.
Oops, something went wrong.
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,55 @@ | ||
/* eslint-disable @typescript-eslint/no-require-imports */ | ||
/* eslint-disable @typescript-eslint/no-unused-vars */ | ||
const reactPlugin = require('eslint-plugin-react'); | ||
const typescriptPlugin = require('@typescript-eslint/eslint-plugin'); | ||
const { FlatCompat } = require('@eslint/eslintrc'); | ||
const path = require('path'); | ||
const eslintJs = require('@eslint/js'); | ||
|
||
const compat = new FlatCompat({ | ||
baseDirectory: __dirname, | ||
recommendedConfig: eslintJs.configs.recommended | ||
}); | ||
|
||
const config = [ | ||
{ | ||
ignores: [ | ||
'out/**', | ||
'.next/**', | ||
'build/**', | ||
'dist/**', | ||
'node_modules/**' | ||
] | ||
}, | ||
...compat.extends( | ||
'eslint:recommended', | ||
'plugin:react/recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
'next/core-web-vitals' | ||
), | ||
{ | ||
files: ['*.js', '*.jsx', '*.ts', '*.tsx'], | ||
languageOptions: { | ||
parserOptions: { | ||
ecmaVersion: 'latest', | ||
sourceType: 'module', | ||
}, | ||
}, | ||
plugins: { | ||
react: reactPlugin, | ||
'@typescript-eslint': typescriptPlugin, | ||
}, | ||
rules: { | ||
'no-unused-vars': 'warn', | ||
'no-console': 'off', | ||
'eol-last': ['error', 'always'], | ||
}, | ||
settings: { | ||
react: { | ||
version: 'detect', | ||
}, | ||
}, | ||
}, | ||
]; | ||
|
||
module.exports = config; |
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 |
---|---|---|
|
@@ -29,4 +29,4 @@ const nextConfig = { | |
} | ||
} | ||
|
||
module.exports = nextConfig | ||
export default nextConfig |
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.