Skip to content

Commit

Permalink
Merge pull request #423 from matchID-project/fix/update-dep
Browse files Browse the repository at this point in the history
🗑  Remove eslintrc
  • Loading branch information
cristianpb authored Sep 4, 2024
2 parents 047835e + d2b6578 commit 4977cca
Show file tree
Hide file tree
Showing 15 changed files with 1,482 additions and 1,555 deletions.
2 changes: 0 additions & 2 deletions .github/workflows/dockerimage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ jobs:
- uses: actions/checkout@v1
- name: 🐋 Build the master docker image
run: make backend-build-all
env:
NPM_VERBOSE: ""
- name: 👷 Make deploy local
run: make deploy-dependencies
env:
Expand Down
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -325,9 +325,9 @@ backend-test-vitest: db-json-fake smtp
@echo Testing API with vitest tests
@if [ ! -f "${BACKEND}/src/routes/routes.ts" ]; then export EXEC_ENV=development; \
export BACKEND_LOG_LEVEL=error; \
${DC_BACKEND} -f ${DC_FILE}-dev-backend.yml run --rm backend npm run tsoa;fi
${DC_BACKEND} -f ${DC_FILE}-dev-backend.yml run --rm backend npm run tsoa --verbose;fi
@export EXEC_ENV=development; export BACKEND_LOG_LEVEL=error; \
${DC_BACKEND} -f ${DC_FILE}-dev-backend.yml run --rm backend npm run test
${DC_BACKEND} -f ${DC_FILE}-dev-backend.yml run --rm backend npm run test --verbose

backend/tests/clients_test.csv:
curl -L https://github.com/matchID-project/examples/raw/master/data/clients_test.csv -o backend/tests/clients_test.csv
Expand Down
170 changes: 0 additions & 170 deletions backend/.eslintrc.js

This file was deleted.

22 changes: 11 additions & 11 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#######################
# Step 1: Base target #
#######################
FROM node:20-slim as base
FROM node:20-slim AS base
ARG http_proxy
ARG https_proxy
ARG no_proxy
Expand Down Expand Up @@ -34,7 +34,7 @@ RUN [ -z "${NPM_LATEST}" ] || npm i npm@latest -g
################################
# Step 2: "development" target #
################################
FROM base as development
FROM base AS development
ARG app_ver
ARG app_path
ARG app_name
Expand Down Expand Up @@ -64,29 +64,29 @@ VOLUME /${app_path}/tests
VOLUME /${app_path}/data

COPY tsconfig.json ./
COPY .eslintrc.js ./
COPY eslint.config.mjs ./

# Expose the listening port of your app
EXPOSE ${port}

CMD ["npm","run", "dev"]
CMD ["npm","run", "dev", "--verbose"]

##########################
# Step 3: "build" target #
##########################
FROM development as build
FROM development AS build

ADD src ./src
COPY src ./src

COPY tsconfig.json ./
COPY .eslintrc.js ./
COPY eslint.config.mjs ./

RUN npm run build && tar czvf dist.tar.gz dist
RUN npm run build --verbose && tar czvf dist.tar.gz dist

###############################
# Step 4: "production" target #
###############################
FROM node:20-alpine3.18 as production
FROM node:20-alpine3.18 AS production
ARG app_path
ARG port
ARG app_ver
Expand All @@ -96,8 +96,8 @@ ENV NODE_ENV=production
WORKDIR /$app_path

COPY package.json ./
ADD tests ./tests
ADD data ./data
COPY tests ./tests
COPY data ./data

# Install production dependencies and clean cache
RUN npm install --production && \
Expand Down
139 changes: 139 additions & 0 deletions backend/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
import typescriptEslint from "@typescript-eslint/eslint-plugin";
import preferArrow from "eslint-plugin-prefer-arrow";
import globals from "globals";
import tsParser from "@typescript-eslint/parser";
import path from "node:path";
import { fileURLToPath } from "node:url";
import js from "@eslint/js";
import { FlatCompat } from "@eslint/eslintrc";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const compat = new FlatCompat({
baseDirectory: __dirname,
recommendedConfig: js.configs.recommended,
allConfig: js.configs.all
});

export default [...compat.extends(
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
), {
plugins: {
"@typescript-eslint": typescriptEslint,
"prefer-arrow": preferArrow,
},

languageOptions: {
globals: {
...globals.browser,
...globals.node,
},

parser: tsParser,
ecmaVersion: 5,
sourceType: "module",

parserOptions: {
project: "tsconfig.json",
},
},

rules: {
"@typescript-eslint/array-type": ["error", {
default: "array",
}],

"@typescript-eslint/dot-notation": "error",
"@typescript-eslint/camelcase": "off",
"@typescript-eslint/member-delimiter-style": "off",
"@typescript-eslint/no-explicit-any": "off",
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/no-unused-expressions": "error",
"@typescript-eslint/no-use-before-define": "off",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",

"@typescript-eslint/triple-slash-reference": ["error", {
path: "always",
types: "prefer-import",
lib: "always",
}],

"@typescript-eslint/no-unused-vars": "warn",
"@typescript-eslint/prefer-promise-reject-errors": "warn",
"@typescript-eslint/type-annotation-spacing": "off",
"@typescript-eslint/unified-signatures": "error",
"@typescript-eslint/no-misused-promises": "warn",
"@typescript-eslint/no-unsafe-call": "off",
"@typescript-eslint/no-unsafe-member-access": "off",
"@typescript-eslint/no-unsafe-assignment": "off",
"@typescript-eslint/no-unsafe-argument": "off",
"@typescript-eslint/no-unsafe-return": "off",
"@typescript-eslint/no-floating-promises": "off",
"@typescript-eslint/restrict-plus-operands": "off",
camelcase: "off",
complexity: "off",
"constructor-super": "error",
eqeqeq: ["error", "smart"],
"guard-for-in": "error",

"id-blacklist": [
"error",
"any",
"Number",
"number",
"String",
"string",
"Boolean",
"boolean",
"Undefined",
"undefined",
],

"id-match": "error",
"jsdoc/check-alignment": "off",
"jsdoc/check-indentation": "off",
"jsdoc/newline-after-description": "off",
"max-classes-per-file": ["error", 1],
"new-parens": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-cond-assign": "error",
"no-console": "error",
"no-debugger": "error",
"no-empty": "error",
"no-eval": "error",
"no-fallthrough": "off",
"no-invalid-this": "off",
"no-new-wrappers": "error",

"no-shadow": ["error", {
hoist: "all",
}],

"no-throw-literal": "error",
"no-trailing-spaces": "error",
"no-undef-init": "error",
"no-underscore-dangle": "off",
"no-unsafe-finally": "error",
"no-unused-labels": "error",
"object-shorthand": "error",
"one-var": ["error", "never"],

"prefer-arrow/prefer-arrow-functions": ["warn", {
disallowPrototype: true,
singleReturnOnly: false,
classPropertiesAllowed: false,
}],

radix: "error",

"spaced-comment": ["error", "always", {
markers: ["/"],
}],

"use-isnan": "error",
"valid-typeof": "off",
},
}];
Loading

0 comments on commit 4977cca

Please sign in to comment.