From 4e49e2d635fb37406e57c9711cb39198dc82a60a Mon Sep 17 00:00:00 2001 From: laraproto Date: Sat, 2 Nov 2024 16:45:41 +0200 Subject: [PATCH] bruh --- .eslintrc.js | 28 ----------------- .github/workflows/push-code.yml | 4 +-- eslint.config.mjs | 54 +++++++++++++++++++++++++++++++++ package.json | 3 ++ pnpm-lock.yaml | 9 ++++++ 5 files changed, 68 insertions(+), 30 deletions(-) delete mode 100644 .eslintrc.js create mode 100644 eslint.config.mjs diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index 4ba6dfe6..00000000 --- a/.eslintrc.js +++ /dev/null @@ -1,28 +0,0 @@ -module.exports = { - root: true, - env: { - node: true, - browser: true, - es6: true, - }, - extends: ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"], - parser: "@typescript-eslint/parser", - plugins: ["@typescript-eslint"], - rules: { - "@typescript-eslint/no-explicit-any": 0, - "@typescript-eslint/ban-ts-comment": 0, - "@typescript-eslint/no-non-null-assertion": 0, - "no-async-promise-executor": 0, - "@typescript-eslint/no-empty-interface": 0, - "no-constant-condition": ["error", { - checkLoops: false, - }], - "prefer-const": ["error", { - destructuring: "all", - ignoreReadBeforeAssign: true, - }], - "@typescript-eslint/no-namespace": ["error", { - allowDeclarations: true, - }], - }, -}; diff --git a/.github/workflows/push-code.yml b/.github/workflows/push-code.yml index 950ccec5..213d93b2 100644 --- a/.github/workflows/push-code.yml +++ b/.github/workflows/push-code.yml @@ -16,6 +16,6 @@ jobs: echo "${{ secrets.ZAPPYZEP_KEY }}" > ~/.ssh/id_ed25519 ssh-keyscan -H zappyzep.xyz > ~/.ssh/known_hosts - name: connect and pull - run: ssh zappyzep@zappyzep.xyz "cd Zeppelin && git checkout working-commit && git pull && docker compose -f docker-compose.standalone.yml down && docker image rm zeppelin-prod-{api,dashboard,bot,migrate,nginx} && docker compose -f docker-compose.standalone.yml up -d && exit" + run: ssh zappyzep@zappyzep.xyz "cd Zeppelin && git checkout working-commit && git pull && docker compose -f docker-compose.standalone.yml down && docker image rm zeppelin-prod-{api,dashboard,bot,migrate,nginx,revampdashboard} && docker compose -f docker-compose.standalone.yml up -d && exit" - name: cleanup - run: rm -rf ~/.ssh \ No newline at end of file + run: rm -rf ~/.ssh diff --git a/eslint.config.mjs b/eslint.config.mjs new file mode 100644 index 00000000..9c3574c7 --- /dev/null +++ b/eslint.config.mjs @@ -0,0 +1,54 @@ +import typescriptEslint from "@typescript-eslint/eslint-plugin"; +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("eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"), + { + plugins: { + "@typescript-eslint": typescriptEslint, + }, + + languageOptions: { + globals: { + ...globals.node, + ...globals.browser, + }, + + parser: tsParser, + }, + + rules: { + "@typescript-eslint/no-explicit-any": 0, + "@typescript-eslint/ban-ts-comment": 0, + "@typescript-eslint/no-non-null-assertion": 0, + "no-async-promise-executor": 0, + "@typescript-eslint/no-empty-interface": 0, + + "no-constant-condition": ["error", { + checkLoops: false, + }], + + "prefer-const": ["error", { + destructuring: "all", + ignoreReadBeforeAssign: true, + }], + + "@typescript-eslint/no-namespace": ["error", { + allowDeclarations: true, + }], + }, + }, +]; \ No newline at end of file diff --git a/package.json b/package.json index 969558bb..3a134d11 100644 --- a/package.json +++ b/package.json @@ -12,10 +12,13 @@ "start-dashboard": "cd dashboard && node serve.js" }, "devDependencies": { + "@eslint/eslintrc": "^3.1.0", + "@eslint/js": "^9.14.0", "@typescript-eslint/eslint-plugin": "^8.12.2", "@typescript-eslint/parser": "^8.12.2", "eslint": "^9.14.0", "eslint-config-prettier": "^9.1.0", + "globals": "^15.0.0", "husky": "^3.0.9", "lint-staged": "^9.4.2", "prettier": "^2.8.4", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 253a8090..62e00f60 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,6 +12,12 @@ importers: specifier: ^0.3.20 version: 0.3.20(mysql2@3.11.3)(ts-node@10.9.2(@types/node@22.8.6)(typescript@5.6.3)) devDependencies: + '@eslint/eslintrc': + specifier: ^3.1.0 + version: 3.1.0 + '@eslint/js': + specifier: ^9.14.0 + version: 9.14.0 '@typescript-eslint/eslint-plugin': specifier: ^8.12.2 version: 8.12.2(@typescript-eslint/parser@8.12.2(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3))(eslint@9.14.0(jiti@1.21.6))(typescript@5.6.3) @@ -24,6 +30,9 @@ importers: eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@9.14.0(jiti@1.21.6)) + globals: + specifier: ^15.0.0 + version: 15.11.0 husky: specifier: ^3.0.9 version: 3.1.0