From e52a62571489d19666ed17fb60fbc674249d6da3 Mon Sep 17 00:00:00 2001 From: Sainan Date: Wed, 3 Jul 2024 12:47:26 +0200 Subject: [PATCH] improve: remove prettier workflow, instead error on formatting problems (#457) --- .eslintrc | 7 ++++--- .github/workflows/build.yml | 2 -- .github/workflows/prettier.yml | 23 ----------------------- 3 files changed, 4 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/prettier.yml diff --git a/.eslintrc b/.eslintrc index 70cbe0f1b..3f44db434 100644 --- a/.eslintrc +++ b/.eslintrc @@ -4,14 +4,13 @@ "plugin:@typescript-eslint/recommended", "plugin:@typescript-eslint/recommended-requiring-type-checking" ], - "plugins": ["@typescript-eslint"], + "plugins": ["@typescript-eslint", "prettier"], "env": { "browser": true, "es6": true, "node": true }, "rules": { - "@typescript-eslint/semi": "warn", "@typescript-eslint/explicit-function-return-type": "warn", "@typescript-eslint/explicit-module-boundary-types": "warn", "@typescript-eslint/restrict-template-expressions": "warn", @@ -25,7 +24,9 @@ "@typescript-eslint/no-explicit-any": "warn", "@typescript-eslint/no-loss-of-precision": "warn", "no-case-declarations": "warn", - "no-mixed-spaces-and-tabs": "warn" + "prettier/prettier": "error", + "@typescript-eslint/semi": "error", + "no-mixed-spaces-and-tabs": "error" }, "parser": "@typescript-eslint/parser", "parserOptions": { diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 0af70682d..ce910645a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -5,8 +5,6 @@ on: jobs: build: runs-on: ubuntu-latest - permissions: - contents: write steps: - name: Checkout uses: actions/checkout@v4.1.2 diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml deleted file mode 100644 index a2458fd81..000000000 --- a/.github/workflows/prettier.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Prettier -on: [push] -jobs: - format: - runs-on: ubuntu-latest - permissions: - contents: write - steps: - - name: Checkout - uses: actions/checkout@v4.1.2 - with: - ref: ${{ github.head_ref }} - - name: Setup Node.js environment - uses: actions/setup-node@v4.0.2 - with: - node-version: "20.x" - - run: npm ci - - run: npm run prettier - - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v5.0.0 - with: - commit_message: Apply prettier changes - branch: ${{ github.head_ref }}