Skip to content

Commit

Permalink
build: add eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
shawnzhu committed Jan 4, 2024
1 parent cda70a0 commit 397d3e4
Show file tree
Hide file tree
Showing 4 changed files with 602 additions and 12 deletions.
10 changes: 10 additions & 0 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
extends:
- eslint:recommended
- plugin:@typescript-eslint/recommended
parser: '@typescript-eslint/parser'
plugins:
- '@typescript-eslint'
root: true
ignorePatterns:
- node_modules/
- dist/
7 changes: 6 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,20 @@
"@types/koa": "^2.13.12",
"@types/koa__router": "^12.0.4",
"@types/supertest": "^2.0.16",
"@typescript-eslint/eslint-plugin": "^6.17.0",
"@typescript-eslint/parser": "^6.17.0",
"aws-sdk-client-mock": "^3.0.0",
"aws-sdk-client-mock-jest": "^3.0.0",
"eslint": "^8.56.0",
"jest": "^29.7.0",
"pm2": "^4.0.0",
"supertest": "^6.3.3",
"ts-node": "^8.0.2",
"typescript": "^5.3.2"
},
"engines": { "node": ">=18" },
"engines": {
"node": ">=18"
},
"jest": {
"testPathIgnorePatterns": [
"/node_modules/",
Expand Down
6 changes: 3 additions & 3 deletions src/server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Koa, { Context } from 'koa';
import Koa, { Context, type Next } from 'koa';
import Router from '@koa/router';
import {
S3Client,
Expand All @@ -15,7 +15,7 @@ const logger = debug('turbo-remote-cache');
const BUCKET_NAME = process.env.STORAGE_PATH;
const awsErrorCodesForNotFound = ['NoSuchBucket', 'NoSuchKey'];

const validateReq = (hash: string, ctx: Context, next: any) => {
const validateReq = (hash: string, ctx: Context, next: Next) => {
const teamId = ctx.query.slug;

if (!teamId) {
Expand Down Expand Up @@ -80,7 +80,7 @@ const saveArtifact = async (ctx: Context) => {
* @param ctx
* @param next
*/
const handleEvents = (ctx: Context, next: any) => {
const handleEvents = (ctx: Context, next: Next) => {
if (ctx.artifactId === 'events') {
logger('post events', ctx.body);
}
Expand Down
Loading

0 comments on commit 397d3e4

Please sign in to comment.