diff --git a/Makefile b/Makefile index 1490017..2aec9c9 100644 --- a/Makefile +++ b/Makefile @@ -7,12 +7,11 @@ ifdef GOTOOLCHAIN else GO_VERSION=$(shell go mod edit -json | jq -r .Toolchain | sed -e 's/go//') endif -DOCKER_BUILD_IMAGE=gotify/build +DOCKER_BUILD_IMAGE=docker.io/gotify/build DOCKER_WORKDIR=/proj DOCKER_RUN=docker run --rm -e LD_FLAGS="$$LD_FLAGS" -v "$$PWD/.:${DOCKER_WORKDIR}" -v "`go env GOPATH`/pkg/mod/.:/go/pkg/mod:ro" -w ${DOCKER_WORKDIR} DOCKER_GO_BUILD=go build -mod=readonly -a -installsuffix cgo -ldflags "$$LD_FLAGS" DOCKER_TEST_LEVEL ?= 0 # Optionally run a test during docker build -NODE_OPTIONS=$(shell if node --help | grep -q -- "--openssl-legacy-provider"; then echo --openssl-legacy-provider; fi) test: test-coverage test-js check: check-go check-swagger check-js @@ -116,7 +115,7 @@ _build_within_docker: ${DOCKER_GO_BUILD} -o ${OUTPUT} build-js: - (cd ui && NODE_OPTIONS="${NODE_OPTIONS}" yarn build) + (cd ui && yarn build) build-linux-amd64: ${DOCKER_RUN} ${DOCKER_BUILD_IMAGE}:$(GO_VERSION)-linux-amd64 make _build_within_docker OUTPUT=${BUILD_DIR}/gotify-linux-amd64 diff --git a/ui/.eslintignore b/ui/.eslintignore deleted file mode 100644 index a0eb34e..0000000 --- a/ui/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -src/setupTests.ts -src/registerServiceWorker.ts diff --git a/ui/.eslintrc.yml b/ui/.eslintrc.yml deleted file mode 100644 index a5d545b..0000000 --- a/ui/.eslintrc.yml +++ /dev/null @@ -1,91 +0,0 @@ ---- -extends: - - eslint:recommended - - plugin:@typescript-eslint/eslint-recommended - - plugin:@typescript-eslint/recommended - - plugin:@typescript-eslint/recommended-requiring-type-checking - - plugin:react/recommended - - plugin:import/errors - - plugin:import/typescript - - plugin:jest/recommended - - prettier -env: - browser: true - es6: true - node: true -parser: "@typescript-eslint/parser" -parserOptions: - project: tsconfig.json - sourceType: module -plugins: - - "@typescript-eslint" - - react - - import - - unicorn -settings: - react: - version: detect -rules: - consistent-return: error - default-case: error - default-param-last: error - no-loop-func: off - arrow-body-style: [error, as-needed] - - import/no-useless-path-segments: error - import/group-exports: off - import/extensions: [error, never] - import/no-duplicates: error - import/first: error - import/no-unused-modules: error - - unicorn/no-abusive-eslint-disable: off - unicorn/no-array-instanceof: error - unicorn/no-unreadable-array-destructuring: error - unicorn/no-zero-fractions: error - - react/jsx-key: error - react/jsx-pascal-case: error - react/destructuring-assignment: off - react/function-component-definition: off - react/no-array-index-key: error - react/no-deprecated: off - react/no-string-refs: error - react/no-this-in-sfc: error - react/no-typos: error - react/no-unknown-property: error - react/prefer-stateless-function: off - react/prop-types: off - - jest/expect-expect: off - jest/no-jasmine-globals: off - "@typescript-eslint/require-await": off - "@typescript-eslint/restrict-template-expressions": off - - "@typescript-eslint/array-type": [error, {default: array-simple}] - "@typescript-eslint/await-thenable": error - "@typescript-eslint/no-unused-vars": error - "@typescript-eslint/no-use-before-define": off - "@typescript-eslint/no-unsafe-call": off - "@typescript-eslint/consistent-type-assertions": [error, {assertionStyle: as}] - - "@typescript-eslint/no-extra-non-null-assertion": error - "@typescript-eslint/no-inferrable-types": error - "@typescript-eslint/no-this-alias": error - "@typescript-eslint/no-throw-literal": error - "@typescript-eslint/no-non-null-assertion": off - "@typescript-eslint/prefer-nullish-coalescing": error - "@typescript-eslint/prefer-optional-chain": error - "@typescript-eslint/prefer-readonly": off - "@typescript-eslint/unbound-method": error - "@typescript-eslint/no-empty-function": off - "@typescript-eslint/explicit-module-boundary-types": off - "@typescript-eslint/ban-ts-comment": off - "@typescript-eslint/no-floating-promises": off - "@typescript-eslint/no-unsafe-member-access": off - "@typescript-eslint/no-unsafe-return": off - "@typescript-eslint/no-unsafe-assignment": off - "@typescript-eslint/restrict-plus-operands": off - "@typescript-eslint/no-misused-promises": off - - "@typescript-eslint/no-explicit-any": error diff --git a/ui/eslint.config.mjs b/ui/eslint.config.mjs new file mode 100644 index 0000000..31a349c --- /dev/null +++ b/ui/eslint.config.mjs @@ -0,0 +1,6 @@ +// @ts-check + +import eslint from '@eslint/js'; +import tseslint from 'typescript-eslint'; + +export default tseslint.config(eslint.configs.recommended, tseslint.configs.recommended); diff --git a/ui/public/index.html b/ui/index.html similarity index 93% rename from ui/public/index.html rename to ui/index.html index 5ea8d02..6d88a28 100644 --- a/ui/public/index.html +++ b/ui/index.html @@ -4,7 +4,7 @@ - +