Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 0 additions & 44 deletions .eslintrc.js

This file was deleted.

58 changes: 58 additions & 0 deletions .github/workflows/code-formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: Code Formatting

on:
pull_request:
types: [opened, synchronize, reopened]
branches:
- "feature/**"
- "main"
- "production"

jobs:
format-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Packages
run: npm ci
- name: Run Prettier
run: npm run format

auto_format:
permissions:
contents: write
needs: format-check
if: failure()
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Packages
run: npm ci
- name: Format Code
run: npm run format:fix
- name: Add Code
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
- name: Auto Commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "style: auto format"

jest-testing:
runs-on: ubuntu-latest
needs: auto_format
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Docker Compose
run: |
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
- name: Build images
run: docker-compose build
- name: Run Test
run: docker-compose run --rm server sh -c "npm run test"
12 changes: 5 additions & 7 deletions .github/workflows/code-linting.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,19 @@
name: Code Linting

on:
push:
pull_request:
types: [opened, synchronize, reopened]
branches:
- 'feature/**'
- 'main'
- "feature/**"
- "main"

jobs:
eslint-check:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
- name: Install Packages
run: npm install
run: npm ci
- name: Run Eslint
run: npm run lint


1 change: 1 addition & 0 deletions .github/workflows/push-docker.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
name: Push Docker Images

on:
push:
branches:
Expand Down
21 changes: 0 additions & 21 deletions .github/workflows/test-api.yml

This file was deleted.

59 changes: 0 additions & 59 deletions eslint.config.js

This file was deleted.

59 changes: 59 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import globals from 'globals'
import tseslint from '@typescript-eslint/eslint-plugin'
import tsParser from '@typescript-eslint/parser'
import pluginPrettier from 'eslint-plugin-prettier'
import preferArrowFunctions from 'eslint-plugin-prefer-arrow-functions'

export default [
// replaces .eslintignore
{ ignores: ['eslint.config.mjs', 'node_modules/', 'dist/', 'build/', 'coverage/'] },

{
files: ['**/*.ts'],
languageOptions: {
parser: tsParser,
parserOptions: {
project: 'tsconfig.json',
tsconfigRootDir: process.cwd(),
sourceType: 'module',
},
globals: {
...globals.node,
...globals.jest,
},
},
plugins: {
'@typescript-eslint': tseslint,
'prefer-arrow-functions': preferArrowFunctions,
prettier: pluginPrettier,
},
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',

'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-redeclare': 'off',
'@typescript-eslint/space-before-function-paren': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',

'prefer-const': 'warn',

// keep your Prettier rule customization
'prettier/prettier': ['warn', { endOfLine: 'auto' }],

'prefer-arrow-functions/prefer-arrow-functions': [
'warn',
{
allowNamedFunctions: false,
classPropertiesAllowed: false,
disallowPrototype: false,
returnStyle: 'unchanged',
singleReturnOnly: false,
},
],
},
},
]
Loading