Skip to content
Merged
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Server Configuration
PORT=3000
NODE_ENV=development
Empty file.
31 changes: 31 additions & 0 deletions .github/workflows/formatting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Code Formatting Check

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
format-check:
name: Check code formatting
runs-on: ubuntu-latest

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

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Check prettier formatting
run: npx prettier --check "src/**/*.{ts,js,json,md}"

# - name: Check ESLint rules
# run: npx eslint "src/**/*.{ts,js}"
30 changes: 30 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Dependencies
node_modules/

# Build output
dist/
build/

# Environment variables
.env
.env.local
.env.*.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Editor directories and files
.idea/
.vscode/
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# OS files
.DS_Store
63 changes: 63 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Build output
dist/
build/
coverage/

# Dependencies
node_modules/
**/node_modules/

# Package files
package-lock.json
yarn.lock
pnpm-lock.yaml

# Log files
logs/
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# Environment variables
.env
.env.local
.env.*

# Cache directories
.npm/
.eslintcache
.cache/

# Generated files
**/*.min.js
**/*.bundle.js

# Database files
*.sqlite
*.db

# TypeORM migration files
src/migrations/*.js

# Config files that should maintain their formatting
.husky/
.github/workflows/

# Specific file types to ignore
*.svg
*.ico
*.png
*.jpg
*.jpeg
*.gif
*.pdf
*.eot
*.ttf
*.woff
*.woff2

# Documentation
LICENSE
README.md
CHANGELOG.md
10 changes: 10 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"semi": true,
"trailingComma": "all",
"singleQuote": true,
"printWidth": 100,
"tabWidth": 2,
"bracketSpacing": true,
"arrowParens": "avoid",
"endOfLine": "lf"
}
54 changes: 54 additions & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
const { FlatCompat } = require('@eslint/eslintrc');
const js = require('@eslint/js');
const tseslint = require('typescript-eslint');

// Create compatibility layer between new flat config and traditional config formats
const compat = new FlatCompat();

module.exports = [
js.configs.recommended,
...tseslint.configs.recommended,
...compat.config({
extends: ['prettier'],
plugins: ['prettier'],
}),
{
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
},
},
files: ['**/*.ts', '**/*.js'],
ignores: [
'node_modules/**',
'dist/**',
'build/**',
'coverage/**',
'**/*.d.ts',
],
rules: {
'prettier/prettier': 'error',
'@typescript-eslint/explicit-function-return-type': 'warn',
'@typescript-eslint/explicit-module-boundary-types': 'warn',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': ['error', {
'argsIgnorePattern': '^_',
'varsIgnorePattern': '^_',
}],
'no-console': ['warn', { allow: ['warn', 'error'] }],
'no-duplicate-imports': 'error',
'no-unused-expressions': 'error',
'prefer-const': 'error',
},
},
{
files: ['**/*.test.ts', '**/*.spec.ts', 'tests/**/*.ts'],
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'no-console': 'off',
},
}
];
Loading