From f951a484195c61389dc905e12ec0d66de76cc983 Mon Sep 17 00:00:00 2001 From: Gnuxie <50846879+Gnuxie@users.noreply.github.com> Date: Thu, 2 Apr 2026 13:29:36 +0100 Subject: [PATCH] Broaden prettier to run on all files. (#1068) Closes https://github.com/the-draupnir-project/planning/issues/109. --- .changeset/README.md | 11 +++++++---- .github/workflows/ghcr-all-dev-branches.yml | 8 ++++++-- .github/workflows/ghcr-latest.yml | 7 +++++-- .github/workflows/ghcr-release.yml | 7 +++++-- .prettierignore | 4 +++- eslint.config.mjs | 21 +++++++++++++-------- package.json | 4 ++-- tsconfig.all.json | 4 +++- tsconfig.base.json | 6 ++---- tsconfig.json | 2 +- 10 files changed, 47 insertions(+), 27 deletions(-) diff --git a/.changeset/README.md b/.changeset/README.md index 654c6d47..e76a9ace 100644 --- a/.changeset/README.md +++ b/.changeset/README.md @@ -1,8 +1,11 @@ # Changesets -Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works -with multi-package repos, or single-package repos to help you version and publish your code. You can -find the full documentation for it [in our repository](https://github.com/changesets/changesets). +Hello and welcome! This folder has been automatically generated by +`@changesets/cli`, a build tool that works with multi-package repos, or +single-package repos to help you version and publish your code. You can find the +full documentation for it +[in our repository](https://github.com/changesets/changesets). -We have a quick list of common questions to get you started engaging with this project in +We have a quick list of common questions to get you started engaging with this +project in [our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md). diff --git a/.github/workflows/ghcr-all-dev-branches.yml b/.github/workflows/ghcr-all-dev-branches.yml index 6206c6c8..548ceeba 100644 --- a/.github/workflows/ghcr-all-dev-branches.yml +++ b/.github/workflows/ghcr-all-dev-branches.yml @@ -37,7 +37,9 @@ jobs: fetch-tags: true - name: Set lowercase image owner id: image_owner - run: echo "image_owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + run: + echo "image_owner=$(echo '${{ github.repository_owner }}' | tr + '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT # Needed for multi platform builds - name: Set up QEMU @@ -59,7 +61,9 @@ jobs: id: meta uses: docker/metadata-action@v6 with: - images: ghcr.io/${{ steps.image_owner.outputs.image_owner }}/${{ env.IMAGE_NAME }} + images: + ghcr.io/${{ steps.image_owner.outputs.image_owner }}/${{ + env.IMAGE_NAME }} tags: | type=ref,event=branch type=sha,prefix=sha- diff --git a/.github/workflows/ghcr-latest.yml b/.github/workflows/ghcr-latest.yml index 29b1cfff..c3ad528a 100644 --- a/.github/workflows/ghcr-latest.yml +++ b/.github/workflows/ghcr-latest.yml @@ -31,7 +31,9 @@ jobs: run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV - name: Set lowercase image owner id: image_owner - run: echo "image_owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + run: + echo "image_owner=$(echo '${{ github.repository_owner }}' | tr + '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT # Needed for multi platform builds - name: Set up QEMU @@ -74,6 +76,7 @@ jobs: id: attest uses: actions/attest@v4 with: - subject-name: ghcr.io/${{ steps.image_owner.outputs.image_owner }}/draupnir + subject-name: + ghcr.io/${{ steps.image_owner.outputs.image_owner }}/draupnir subject-digest: ${{ steps.push_ghcr.outputs.digest }} push-to-registry: true diff --git a/.github/workflows/ghcr-release.yml b/.github/workflows/ghcr-release.yml index a5033b6d..c71dbec8 100644 --- a/.github/workflows/ghcr-release.yml +++ b/.github/workflows/ghcr-release.yml @@ -32,7 +32,9 @@ jobs: run: echo "release_version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT - name: Set lowercase image owner id: image_owner - run: echo "image_owner=$(echo '${{ github.repository_owner }}' | tr '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT + run: + echo "image_owner=$(echo '${{ github.repository_owner }}' | tr + '[:upper:]' '[:lower:]')" >> $GITHUB_OUTPUT # Needed for multi platform builds - name: Set up QEMU @@ -75,6 +77,7 @@ jobs: id: attest uses: actions/attest@v4 with: - subject-name: ghcr.io/${{ steps.image_owner.outputs.image_owner }}/draupnir + subject-name: + ghcr.io/${{ steps.image_owner.outputs.image_owner }}/draupnir subject-digest: ${{ steps.push_ghcr.outputs.digest }} push-to-registry: true diff --git a/.prettierignore b/.prettierignore index 6557bb75..bdf44a06 100644 --- a/.prettierignore +++ b/.prettierignore @@ -1,6 +1,8 @@ # SPDX-FileCopyrightText: 2024 Gnuxie # -# SPDX-License-Identifier: AFL-3.0 +# SPDX-License-Identifier: 0BSD dist packages/matrix-protection-suite/docs +node_modules +package-lock.json diff --git a/eslint.config.mjs b/eslint.config.mjs index 92f4f729..ba8764f0 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -19,12 +19,12 @@ const ignores = [ "**/lib/**", "**/node_modules/**", "**/*.js", - "**/*.jsx" + "**/*.jsx", ]; export default tseslint.config( { - ignores + ignores, }, { // This is a typescript-eslint configurartion for typescript files. @@ -80,10 +80,7 @@ export default tseslint.config( // but other than using namespaces, we don't have granular enough modules // to be able to depend on their behaviour. This should be revisited. "@typescript-eslint/no-extraneous-class": "off", - "@typescript-eslint/unbound-method": [ - "error", - { ignoreStatic: true } - ], + "@typescript-eslint/unbound-method": ["error", { ignoreStatic: true }], // We want to be able to create infinite loops. "@typescript-eslint/no-unnecessary-condition": [ "error", @@ -100,7 +97,11 @@ export default tseslint.config( { allow: [ // Idk why they did this but whatever https://github.com/element-hq/matrix-bot-sdk/pull/66/changes#r2965217095 - { from: "package", name: "getRoomStateEvent", package: "@vector-im/matrix-bot-sdk" }, + { + from: "package", + name: "getRoomStateEvent", + package: "@vector-im/matrix-bot-sdk", + }, ], }, ], @@ -126,7 +127,11 @@ export default tseslint.config( { from: "file", name: "logMessage" }, { from: "file", name: "allocateProtection" }, // Idk why they did this but whatever https://github.com/element-hq/matrix-bot-sdk/pull/66/changes#r2965217095 - { from: "package", name: "getRoomStateEvent", package: "@vector-im/matrix-bot-sdk" }, + { + from: "package", + name: "getRoomStateEvent", + package: "@vector-im/matrix-bot-sdk", + }, ], }, ], diff --git a/package.json b/package.json index 173358f1..1f026308 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "build:all": "tsc -b tsconfig.all.json && npm run -ws build:assets --if-present", "build:clean": "tsc -b --clean", "test": "npm run -ws test --if-present && npm run -w apps/draupnir test:unit", - "lint": "eslint --cache 'packages/**/*.{ts,tsx}' 'apps/**/*.{ts,tsx}' && prettier --cache --ignore-unknown --check apps packages README.md CHANGELOG.md DEPENDENCIES.md" + "lint": "eslint --cache 'packages/**/*.{ts,tsx}' 'apps/**/*.{ts,tsx}' && prettier --cache --ignore-unknown --check ." }, "devDependencies": { "@changesets/cli": "^2.30.0", @@ -38,7 +38,7 @@ "@vector-im/matrix-bot-sdk": "0.8.0-element.3", "postgres": "3.4.7" }, - "engines": { + "engines": { "node": ">=24.0.0" } } diff --git a/tsconfig.all.json b/tsconfig.all.json index edaa41cb..f3b6c099 100644 --- a/tsconfig.all.json +++ b/tsconfig.all.json @@ -10,7 +10,9 @@ { "path": "./packages/matrix-basic-types/tsconfig.test.json" }, { "path": "./packages/interface-manager/tsconfig.test.json" }, { "path": "./packages/matrix-protection-suite/tsconfig.test.json" }, - { "path": "./packages/matrix-protection-suite-for-matrix-bot-sdk/tsconfig.test.json" }, + { + "path": "./packages/matrix-protection-suite-for-matrix-bot-sdk/tsconfig.test.json" + }, { "path": "./packages/mps-interface-adaptor/tsconfig.test.json" }, { "path": "./apps/draupnir/tsconfig.test.json" } ] diff --git a/tsconfig.base.json b/tsconfig.base.json index 1f3136dd..4daa3928 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -2,9 +2,7 @@ "compilerOptions": { "target": "es2024", "module": "node16", - "lib": [ - "es2024" - ], + "lib": ["es2024"], "declaration": true, "declarationMap": true, "exactOptionalPropertyTypes": true, @@ -21,6 +19,6 @@ "noImplicitThis": true, "noUncheckedIndexedAccess": true, "noUnusedLocals": true, - "noImplicitAny": true, + "noImplicitAny": true } } diff --git a/tsconfig.json b/tsconfig.json index 3f207eee..b1b94807 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -6,6 +6,6 @@ { "path": "./packages/matrix-protection-suite" }, { "path": "./packages/matrix-protection-suite-for-matrix-bot-sdk" }, { "path": "./packages/mps-interface-adaptor" }, - { "path": "./apps/draupnir"} + { "path": "./apps/draupnir" } ] }