-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
.idea | ||
dist | ||
.next |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
module.exports = { | ||
plugins: ['prettier', 'simple-import-sort'], | ||
extends: ['plugin:@typescript-eslint/recommended', 'eslint:recommended'], | ||
root: true, | ||
env: { | ||
node: true, | ||
}, | ||
ignorePatterns: ['.eslintrc.js', '.prettierrc.js'], | ||
rules: { | ||
'prettier/prettier': 'error', | ||
'simple-import-sort/imports': 'error', | ||
'simple-import-sort/exports': 'error', | ||
camelcase: [ | ||
'error', | ||
{ | ||
properties: 'never', | ||
}, | ||
], | ||
eqeqeq: 'error', | ||
'max-depth': 'error', | ||
'max-lines': 'error', | ||
'no-alert': 'error', | ||
'no-array-constructor': 'error', | ||
'no-console': [ | ||
'error', | ||
{ | ||
allow: ['warn', 'error'], | ||
}, | ||
], | ||
'no-eval': 'error', | ||
'no-implicit-coercion': 'error', | ||
'no-lonely-if': 'error', | ||
'no-nested-ternary': 'error', | ||
'no-negated-condition': 'error', | ||
'no-unneeded-ternary': 'error', | ||
'no-undef-init': 'error', | ||
'no-underscore-dangle': 'error', | ||
'no-useless-concat': 'error', | ||
'no-void': 'error', | ||
'no-var': 'error', | ||
'prefer-const': 'error', | ||
'prefer-promise-reject-errors': 'error', | ||
'prefer-template': 'error', | ||
yoda: 'error', | ||
'no-unused-vars': 'off', | ||
}, | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* text=auto eol=lf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
name: Static Analysis | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
- dev | ||
pull_request: | ||
branches: | ||
- main | ||
- dev | ||
|
||
jobs: | ||
lint-check: | ||
name: ESLint Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Run ESLint check | ||
run: yarn lint | ||
|
||
format-check: | ||
name: Prettier Check | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Run Prettier check | ||
run: yarn format:check | ||
|
||
build: | ||
name: Build | ||
runs-on: ubuntu-latest | ||
needs: | ||
- lint-check | ||
- format-check | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup Node.js | ||
uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
|
||
- name: Install dependencies | ||
run: yarn install | ||
|
||
- name: Build | ||
run: yarn build:backend |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Check Prisma Migrations | ||
|
||
on: | ||
pull_request: | ||
paths: | ||
- 'apps/backend/prisma/schema.prisma' | ||
- 'apps/backend/prisma/migrations/**' | ||
|
||
jobs: | ||
check_prisma_changes: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 # Fetch all history for all branches | ||
|
||
- name: Fetch base branch | ||
run: git fetch origin ${{ github.base_ref }} | ||
|
||
- name: Check if `schema.prisma` was modified in the PR | ||
id: check_schema | ||
run: | | ||
if git diff --name-only origin/${{ github.base_ref }}... | grep -q 'apps/backend/prisma/schema.prisma'; then | ||
echo "schema_changed=true" >> $GITHUB_ENV | ||
else | ||
echo "schema_changed=false" >> $GITHUB_ENV | ||
fi | ||
- name: Check if a new migration was added in the PR | ||
id: check_migrations | ||
run: | | ||
if git diff --name-only --diff-filter=A origin/${{ github.base_ref }}... | grep -q 'apps/backend/prisma/migrations/'; then | ||
echo "migration_added=true" >> $GITHUB_ENV | ||
else | ||
echo "migration_added=false" >> $GITHUB_ENV | ||
fi | ||
- name: Fail if `schema.prisma` was modified and no migration was added | ||
if: env.schema_changed == 'true' && env.migration_added == 'false' | ||
run: | | ||
echo "The schema.prisma file was modified, but no new migration was added." | ||
exit 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
dist | ||
build | ||
node_modules | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
.DS_Store |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
node_modules | ||
.idea | ||
dist | ||
.next |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module.exports = { | ||
semi: true, | ||
singleQuote: true, | ||
trailingComma: 'es5', | ||
bracketSpacing: true, | ||
printWidth: 120, | ||
jsxSingleQuote: true, | ||
bracketSameLine: false, | ||
endOfLine: 'lf', | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"recommendations": ["esbenp.prettier-vscode", "dbaeumer.vscode-eslint", "Prisma.prisma"] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": "Debug backend", | ||
"cwd": "${workspaceFolder}/apps/backend", | ||
"runtimeArgs": ["run", "start:debug"], | ||
"runtimeExecutable": "yarn", | ||
"request": "launch", | ||
"skipFiles": ["<node_internals>/**"], | ||
"outputCapture": "std", | ||
"type": "node", | ||
"restart": true | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"editor.tabSize": 2, | ||
"editor.insertSpaces": true, | ||
"editor.renderWhitespace": "boundary", | ||
"editor.rulers": [120], | ||
"editor.formatOnSave": true, | ||
"files.encoding": "utf8", | ||
"files.trimTrailingWhitespace": true, | ||
"files.insertFinalNewline": true, | ||
"files.eol": "\n", | ||
"search.exclude": { | ||
"public/**": true, | ||
"node_modules/**": true | ||
}, | ||
"editor.defaultFormatter": "esbenp.prettier-vscode", | ||
"editor.codeActionsOnSave": { | ||
"source.organizeImports": "explicit", | ||
"source.formatDocument": "explicit", | ||
"source.fixAll.eslint": "explicit" | ||
}, | ||
"[prisma]": { | ||
"editor.defaultFormatter": "Prisma.prisma" | ||
} | ||
} |