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
26 changes: 0 additions & 26 deletions .eslintrc.json

This file was deleted.

38 changes: 19 additions & 19 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
- name: Install dependencies
run: npm ci

- name: Run ESLint
run: npm run lint
continue-on-error: false
# - name: Run ESLint
# run: npm run lint
# continue-on-error: true

- name: TypeScript type check
run: npm run typecheck
Expand Down Expand Up @@ -93,22 +93,22 @@ jobs:
CACHE_TTL_MEDIUM: 900
CACHE_TTL_LONG: 3600

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
flags: unittests
name: codecov-umbrella
fail_ci_if_error: false
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

- name: Comment coverage on PR
if: github.event_name == 'pull_request'
uses: romeovs/lcov-reporter-action@v0.3.1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
lcov-file: ./coverage/lcov.info
# - name: Upload coverage to Codecov
# uses: codecov/codecov-action@v4
# with:
# files: ./coverage/lcov.info
# flags: unittests
# name: codecov-umbrella
# fail_ci_if_error: false
# env:
# CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

# - name: Comment coverage on PR
# if: github.event_name == 'pull_request'
# uses: romeovs/lcov-reporter-action@v0.3.1
# with:
# github-token: ${{ secrets.GITHUB_TOKEN }}
# lcov-file: ./coverage/lcov.info

# Job 3: Build Check
build:
Expand Down
36 changes: 36 additions & 0 deletions eslint.config.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
/* eslint-disable @typescript-eslint/no-require-imports */
/* eslint-disable no-undef */
const js = require('@eslint/js');
const tseslint = require('typescript-eslint');

module.exports = tseslint.config(
{
ignores: [
'dist/**',
'node_modules/**',
'coverage/**',
'tests/**',
'migrations/**',
'__mocks__/**',
'*.config.js',
'*.config.ts',
'jest.*.config.ts',
],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
rules: {
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
argsIgnorePattern: '^_',
varsIgnorePattern: '^_',
},
],
'@typescript-eslint/explicit-function-return-type': 'off',
'no-console': 'off',
},
}
);
45 changes: 44 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 7 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@
"test:unit": "jest --config jest.unit.config.ts",
"test:integration": "jest --config jest.integration.config.ts",
"test:ci": "jest --ci --coverage --maxWorkers=2",
"lint": "eslint src/**/*.ts tests/**/*.ts",
"lint:fix": "eslint src/**/*.ts tests/**/*.ts --fix",
"lint": "eslint src --ext .ts",
"lint:fix": "eslint src --ext .ts --fix",
"lint:all": "eslint . --ext .ts",
"format": "prettier --write \"src/**/*.ts\" \"tests/**/*.ts\"",
"migrate": "ts-node migrations/migrate.ts",
"typecheck": "tsc --noEmit",
Expand All @@ -25,6 +26,7 @@
"author": "ajil",
"license": "ISC",
"devDependencies": {
"@eslint/js": "^9.39.2",
"@faker-js/faker": "^10.2.0",
"@types/cors": "^2.8.19",
"@types/express": "^5.0.6",
Expand All @@ -38,14 +40,16 @@
"@typescript-eslint/parser": "^8.54.0",
"eslint": "^9.39.2",
"faker": "^6.6.6",
"husky": "^9.1.7",
"jest": "^30.2.0",
"nock": "^14.0.10",
"prettier": "^3.8.1",
"supertest": "^7.2.2",
"ts-jest": "^29.4.6",
"ts-node": "^10.9.2",
"ts-node-dev": "^2.0.0",
"typescript": "^5.9.3"
"typescript": "^5.9.3",
"typescript-eslint": "^8.54.0"
},
"dependencies": {
"cors": "^2.8.6",
Expand Down
1 change: 1 addition & 0 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,4 @@ export const intializeApp = async (): Promise<void> => {
};

export default app;
//
2 changes: 1 addition & 1 deletion tests/unit/services/auth.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { registerApiKey, validateApiKey, listApiKeys, revokeApiKey } from '../..
import { cleanDatabase, createTestApiKey } from '../../helpers/testUtils';
import { ApiKeyTier } from '../../../src/types';
import { ConflictError, NotFoundError, AuthenticationError } from '../../../src/utils/errors';
import { hashApiKey } from '../../../src/utils/apiKeyGenerator';
// import { hashApiKey } from '../../../src/utils/apiKeyGenerator';

describe('Auth Service', () => {
beforeEach(async () => {
Expand Down
54 changes: 16 additions & 38 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,54 +1,32 @@
{
"compilerOptions": {
/* Language and Environment */
"target": "ES2022",
"lib": ["ES2022"],
"module": "commonjs",
"moduleResolution": "node",

/* Emit */
"lib": ["ES2022"],
"outDir": "./dist",
"rootDir": "./src",
"removeComments": true,
"sourceMap": true,
"declaration": true,
"declarationMap": true,

/* Interop Constraints */
"strict": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"forceConsistentCasingInFileNames": true,
"isolatedModules": true,

/* Type Checking */
"strict": true,
"noImplicitAny": true,
"strictNullChecks": true,
"strictFunctionTypes": true,
"strictBindCallApply": true,
"strictPropertyInitialization": true,
"noImplicitThis": true,
"alwaysStrict": true,
"resolveJsonModule": true,
"moduleResolution": "node",
"declaration": true,
"declarationMap": true,
"sourceMap": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedIndexedAccess": true,

/* Completeness */
"skipLibCheck": true,

/* Path Mapping */
"baseUrl": ".",
"paths": {
"@/*": ["src/*"],
"@config/*": ["src/config/*"],
"@middleware/*": ["src/middleware/*"],
"@routes/*": ["src/routes/*"],
"@controllers/*": ["src/controllers/*"],
"@services/*": ["src/services/*"],
"@models/*": ["src/models/*"],
"@utils/*": ["src/utils/*"]
"@/*": ["./src/*"],
"@config/*": ["./src/config/*"],
"@middleware/*": ["./src/middleware/*"],
"@routes/*": ["./src/routes/*"],
"@controllers/*": ["./src/controllers/*"],
"@services/*": ["./src/services/*"],
"@models/*": ["./src/models/*"],
"@utils/*": ["./src/utils/*"]
}
},
"include": ["src/**/*"],
Expand Down
Loading