From b7787afcc28fccba4004def65593288bc4ef70f0 Mon Sep 17 00:00:00 2001 From: talksik Date: Fri, 3 Jun 2022 11:16:08 -0700 Subject: [PATCH] adding linting and bunch of scripts --- Dockerfile | 1 - packages/api/.eslintrc.json | 16 ++++++++++++++++ packages/api/package.json | 10 ++++++++-- 3 files changed, 24 insertions(+), 3 deletions(-) create mode 100644 packages/api/.eslintrc.json diff --git a/Dockerfile b/Dockerfile index 1914276..f3403f1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -19,7 +19,6 @@ RUN yarn install WORKDIR /app/packages/api RUN yarn install --production -RUN yarn build CMD ["yarn", "start"] diff --git a/packages/api/.eslintrc.json b/packages/api/.eslintrc.json new file mode 100644 index 0000000..2fbc365 --- /dev/null +++ b/packages/api/.eslintrc.json @@ -0,0 +1,16 @@ +{ + "env": { + "browser": true, + "es6": true, + "node": true + }, + + "extends": [ + "eslint:recommended", + "plugin:@typescript-eslint/eslint-recommended", + "plugin:@typescript-eslint/recommended", + "plugin:import/recommended", + "plugin:import/typescript" + ], + "parser": "@typescript-eslint/parser" +} diff --git a/packages/api/package.json b/packages/api/package.json index d972edf..cccc7eb 100644 --- a/packages/api/package.json +++ b/packages/api/package.json @@ -8,14 +8,20 @@ "dev": "NODE_ENV=development && yarn common && nodemon", "start:dev": "ts-node index.ts", "start": "node dist/index.js", - "gcp-build": "npm run common && tsc -p .", + "lint": "eslint --ext .ts,.tsx .", + "build": "npm run common && npm run lint && tsc -p .", + "gcp-build": "npm run build", "production": "NODE_ENV=production nodemon" }, "devDependencies": { "@types/express": "^4.17.13", "@types/node": "^17.0.21", "nodemon": "^2.0.15", - "typescript": "^4.6.2" + "typescript": "^4.6.2", + "@typescript-eslint/eslint-plugin": "^5.0.0", + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.0" }, "dependencies": { "axios": "^0.26.1",