From ed84b101ebb1db9bea476c757c94f723f6aa0bcb Mon Sep 17 00:00:00 2001 From: ThatOneCalculator Date: Fri, 1 Sep 2023 16:46:00 -0700 Subject: [PATCH] chore: :hammer: rome -> biome Biome is the new, continued fork of Rome (now discontinued) --- .vscode/extensions.json | 30 ++-- biome.json | 50 +++++++ package.json | 2 +- packages/backend/package.json | 4 +- packages/backend/src/global.d.ts | 2 +- packages/backend/src/services/chart/core.ts | 2 +- packages/backend/src/services/note/create.ts | 2 +- packages/client/package.json | 4 +- packages/firefish-js/package.json | 4 +- packages/megalodon/package.json | 4 +- packages/sw/package.json | 4 +- pnpm-lock.yaml | 136 ++++++++++--------- rome.json | 30 ---- 13 files changed, 150 insertions(+), 124 deletions(-) create mode 100644 biome.json delete mode 100644 rome.json diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 6971c840ad..87fb0c9405 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,18 +1,18 @@ { "recommendations": [ - "editorconfig.editorconfig", - "rome.rome", - "vue.volar", - "vue.vscode-typescript-vue-plugin", - "arcanis.vscode-zipfs", - "orta.vscode-twoslash-queries", - "antfu.iconify", - "vivaxy.vscode-conventional-commits", - "ms-azuretools.vscode-docker", - "gitlab.gitlab-workflow", - "mrmlnc.vscode-json5", - "esbenp.prettier-vscode", - "redhat.vscode-yaml", - "yoavbls.pretty-ts-errors" - ] + "editorconfig.editorconfig", + "vue.volar", + "vue.vscode-typescript-vue-plugin", + "arcanis.vscode-zipfs", + "orta.vscode-twoslash-queries", + "antfu.iconify", + "vivaxy.vscode-conventional-commits", + "ms-azuretools.vscode-docker", + "gitlab.gitlab-workflow", + "mrmlnc.vscode-json5", + "esbenp.prettier-vscode", + "redhat.vscode-yaml", + "yoavbls.pretty-ts-errors", + "biomejs.biome" + ] } diff --git a/biome.json b/biome.json new file mode 100644 index 0000000000..f47b83deaa --- /dev/null +++ b/biome.json @@ -0,0 +1,50 @@ +{ + "$schema": "https://biomejs.dev/schemas/1.0.0/schema.json", + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + }, + "ignore": [ + "packages/firefish-js/api-extractor.json", + "packages/*/tsconfig.json", + "packages/*/built", + "packages/megalodon/lib", + "packages/*/package-lock.json", + "packages/backend/src/server/web/manifest.ts", + "packages/megalodon/src/misskey/web_socket.ts", + "packages/megalodon/src/misskey/api_client.ts", + "packages/backend/built/", + "*/model.json", + "*.md", + "*.png", + "*.jpeg", + "*.jpg", + "**/tsconfig.json", + "*/.yml" + ] + }, + "formatter": { + "ignore": [ + "packages/firefish-js/api-extractor.json", + "packages/*/tsconfig.json", + "packages/*/built", + "packages/megalodon/lib", + "packages/*/package-lock.json", + "packages/backend/src/server/web/manifest.ts", + "packages/megalodon/src/misskey/web_socket.ts", + "packages/megalodon/src/misskey/api_client.ts", + "packages/backend/built/", + "*/model.json", + "*.md", + "*.png", + "*.jpeg", + "*.jpg", + "**/tsconfig.json", + "*/.yml" + ] + } +} diff --git a/package.json b/package.json index b9229878f0..1d881ac896 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "seedrandom": "^3.0.5" }, "devDependencies": { + "@biomejs/biome": "1.0.0", "@types/gulp": "4.0.13", "@types/gulp-rename": "2.0.2", "@types/node": "20.4.9", @@ -59,7 +60,6 @@ "gulp-replace": "1.1.4", "gulp-terser": "2.1.0", "install-peers": "^1.0.4", - "rome": "^12.1.3", "start-server-and-test": "1.15.2", "typescript": "5.1.6" } diff --git a/packages/backend/package.json b/packages/backend/package.json index 81fdaab4f4..b2bcfe9be5 100644 --- a/packages/backend/package.json +++ b/packages/backend/package.json @@ -16,10 +16,10 @@ "build": "pnpm swc src -d built -D", "build:debug": "pnpm swc src -d built -s -D", "watch": "pnpm swc src -d built -D -w", - "lint": "pnpm rome check --apply **/*.ts ; pnpm run format", + "lint": "pnpm biome check --apply **/*.ts ; pnpm run format", "mocha": "cross-env NODE_ENV=test TS_NODE_FILES=true TS_NODE_TRANSPILE_ONLY=true TS_NODE_PROJECT=\"./test/tsconfig.json\" mocha", "test": "pnpm run mocha", - "format": "pnpm rome format * --write" + "format": "pnpm biome format * --write" }, "optionalDependencies": { "@swc/core-android-arm64": "1.3.11", diff --git a/packages/backend/src/global.d.ts b/packages/backend/src/global.d.ts index 503e26eb60..6c5a22e4b4 100644 --- a/packages/backend/src/global.d.ts +++ b/packages/backend/src/global.d.ts @@ -1,2 +1,2 @@ -// rome-ignore lint/suspicious/noExplicitAny: i have no idea +// biome-ignore lint/suspicious/noExplicitAny: i have no idea type FIXME = any; diff --git a/packages/backend/src/services/chart/core.ts b/packages/backend/src/services/chart/core.ts index 36fe373269..9462a6321e 100644 --- a/packages/backend/src/services/chart/core.ts +++ b/packages/backend/src/services/chart/core.ts @@ -473,7 +473,7 @@ export default abstract class Chart { protected commit(diff: Commit, group: string | null = null): void { for (const [k, v] of Object.entries(diff)) { if (v == null || v === 0 || (Array.isArray(v) && v.length === 0)) - // rome-ignore lint/performance/noDelete: needs to be deleted not just set to undefined + // biome-ignore lint/performance/noDelete: needs to be deleted not just set to undefined delete diff[k]; } this.buffer.push({ diff --git a/packages/backend/src/services/note/create.ts b/packages/backend/src/services/note/create.ts index 689bd66162..b39a857836 100644 --- a/packages/backend/src/services/note/create.ts +++ b/packages/backend/src/services/note/create.ts @@ -169,7 +169,7 @@ export default async ( data: Option, silent = false, ) => - // rome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME + // biome-ignore lint/suspicious/noAsyncPromiseExecutor: FIXME new Promise(async (res, rej) => { const dontFederateInitially = data.visibility === "hidden"; diff --git a/packages/client/package.json b/packages/client/package.json index ef28a5db69..d7cfe4e6c4 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -5,9 +5,9 @@ "watch": "pnpm vite build --watch --mode development", "build": "pnpm vite build", "build:debug": "pnpm run build", - "lint": "pnpm rome check **/*.ts --apply ; pnpm run lint:vue", + "lint": "pnpm biome check **/*.ts --apply ; pnpm run lint:vue", "lint:vue": "pnpm eslint src --fix '**/*.vue' --cache ; pnpm run format", - "format": "pnpm rome format * --write && pnpm prettier --write '**/*.{scss,vue}' --cache --cache-strategy metadata" + "format": "pnpm biome format * --write && pnpm prettier --write '**/*.{scss,vue}' --cache --cache-strategy metadata" }, "devDependencies": { "@discordapp/twemoji": "14.1.2", diff --git a/packages/firefish-js/package.json b/packages/firefish-js/package.json index 7cdd419ec7..8e8f659d4b 100644 --- a/packages/firefish-js/package.json +++ b/packages/firefish-js/package.json @@ -12,8 +12,8 @@ "api": "pnpm api-extractor run --local --verbose", "api-prod": "pnpm api-extractor run --verbose", "api-doc": "pnpm api-documenter markdown -i ./etc/", - "lint": "pnpm rome check --apply *.ts", - "format": "pnpm rome format --write *.ts", + "lint": "pnpm biome check --apply *.ts", + "format": "pnpm biome format --write *.ts", "jest": "jest --coverage --detectOpenHandles", "test": "pnpm jest && pnpm tsd" }, diff --git a/packages/megalodon/package.json b/packages/megalodon/package.json index e9e30abe12..3403b94b47 100644 --- a/packages/megalodon/package.json +++ b/packages/megalodon/package.json @@ -6,8 +6,8 @@ "scripts": { "build": "tsc -p ./", "build:debug": "pnpm run build", - "lint": "pnpm rome check **/*.ts --apply", - "format": "pnpm rome format --write src/**/*.ts", + "lint": "pnpm biome check **/*.ts --apply", + "format": "pnpm biome format --write src/**/*.ts", "doc": "typedoc --out ../docs ./src", "test": "NODE_ENV=test jest -u --maxWorkers=3" }, diff --git a/packages/sw/package.json b/packages/sw/package.json index 6118e249a2..cca0256b4a 100644 --- a/packages/sw/package.json +++ b/packages/sw/package.json @@ -5,8 +5,8 @@ "build": "webpack", "build:debug": "pnpm run build", "watch": "pnpm swc src -d built -D -w", - "lint": "pnpm rome check **/*.ts --apply", - "format": "pnpm rome format * --write" + "lint": "pnpm biome check **/*.ts --apply", + "format": "pnpm biome format * --write" }, "devDependencies": { "@swc/cli": "^0.1.62", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc0f034111..aa58fd08fc 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -30,6 +30,9 @@ importers: specifier: ^3.0.5 version: 3.0.5 devDependencies: + '@biomejs/biome': + specifier: 1.0.0 + version: 1.0.0 '@types/gulp': specifier: 4.0.13 version: 4.0.13 @@ -69,9 +72,6 @@ importers: install-peers: specifier: ^1.0.4 version: 1.0.4 - rome: - specifier: ^12.1.3 - version: 12.1.3 start-server-and-test: specifier: 1.15.2 version: 1.15.2 @@ -1556,6 +1556,74 @@ packages: resolution: {integrity: sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==} dev: true + /@biomejs/biome@1.0.0: + resolution: {integrity: sha512-Y5CND1QZ5pF6hc4dFw5ItDutv9KJO91ksLdBIFyvHL7LmXN0UomqyyRWryvrqq+YlA8Q58cR6sqjjQuMp9E2Ig==} + engines: {node: '>=14.*'} + hasBin: true + requiresBuild: true + optionalDependencies: + '@biomejs/cli-darwin-arm64': 1.0.0 + '@biomejs/cli-darwin-x64': 1.0.0 + '@biomejs/cli-linux-arm64': 1.0.0 + '@biomejs/cli-linux-x64': 1.0.0 + '@biomejs/cli-win32-arm64': 1.0.0 + '@biomejs/cli-win32-x64': 1.0.0 + dev: true + + /@biomejs/cli-darwin-arm64@1.0.0: + resolution: {integrity: sha512-3v7kEyxkf3D246esH+q/lDK5wWn+xLCXZpHCuc1itAmC35GkEc6S7um6C1VD3XKXLx6N0sJR/rTmjKiRGV32Ig==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-darwin-x64@1.0.0: + resolution: {integrity: sha512-uxIMt/X7TQWicjsImkqMvUUEqaFZTOJJrtEhlHl/eIaETWJmK3uAR7ihIWctpGJnN16sUgpLgwczc7FETqu/PQ==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-arm64@1.0.0: + resolution: {integrity: sha512-kJWtu3Xr4MdHV2Yn4U+eZudAGPgv0kRCjWAyzLRewJiqE5TLPrX08imB9SU1n3+VxNO8e2JJ0tWWBHo4J+aSEg==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-linux-x64@1.0.0: + resolution: {integrity: sha512-FK6hYZ0Lkk39eXYx1+2ZWtLkApc0RdOpcjDVM96JbvI0bxqvNnm193BPXuxh5A/fCl6N28RNUvcKnZ5LbgZ0Yw==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-arm64@1.0.0: + resolution: {integrity: sha512-kE+OY2isEJHBodiLPMlybZckHkl3CQWsvXuJEvSxkoMhLbGDPEV3yZ/0lEph3BlxP3KP5vUO3hOFGaTvHFOuqQ==} + engines: {node: '>=14.*'} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@biomejs/cli-win32-x64@1.0.0: + resolution: {integrity: sha512-Ko6ZsbmbScPMEnh/xz4mwDSCZIUCAEjbbbnUVApgAAL2+1Hoe7Vnhh2RiwYRqy3tHrBIMDwXkSxj0vlf1G3EHg==} + engines: {node: '>=14.*'} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@bull-board/api@5.7.2(@bull-board/ui@5.7.2): resolution: {integrity: sha512-sYAa2Cdjlh5Rz5VntMcdtZ3ng0CswUyxprBUx6VyLI7L1vreaguQYVVsDG1kWw7ylKwL3PcYYI0+xe2rCKsbSg==} peerDependencies: @@ -3229,54 +3297,6 @@ packages: rollup: 3.28.1 dev: true - /@rometools/cli-darwin-arm64@12.1.3: - resolution: {integrity: sha512-AmFTUDYjBuEGQp/Wwps+2cqUr+qhR7gyXAUnkL5psCuNCz3807TrUq/ecOoct5MIavGJTH6R4aaSL6+f+VlBEg==} - cpu: [arm64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@rometools/cli-darwin-x64@12.1.3: - resolution: {integrity: sha512-k8MbWna8q4LRlb005N2X+JS1UQ+s3ZLBBvwk4fP8TBxlAJXUz17jLLu/Fi+7DTTEmMhM84TWj4FDKW+rNar28g==} - cpu: [x64] - os: [darwin] - requiresBuild: true - dev: true - optional: true - - /@rometools/cli-linux-arm64@12.1.3: - resolution: {integrity: sha512-X/uLhJ2/FNA3nu5TiyeNPqiD3OZoFfNfRvw6a3ut0jEREPvEn72NI7WPijH/gxSz55znfQ7UQ6iM4DZumUknJg==} - cpu: [arm64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@rometools/cli-linux-x64@12.1.3: - resolution: {integrity: sha512-csP17q1eWiUXx9z6Jr/JJPibkplyKIwiWPYNzvPCGE8pHlKhwZj3YHRuu7Dm/4EOqx0XFIuqqWZUYm9bkIC8xg==} - cpu: [x64] - os: [linux] - requiresBuild: true - dev: true - optional: true - - /@rometools/cli-win32-arm64@12.1.3: - resolution: {integrity: sha512-RymHWeod57EBOJY4P636CgUwYA6BQdkQjh56XKk4pLEHO6X1bFyMet2XL7KlHw5qOTalzuzf5jJqUs+vf3jdXQ==} - cpu: [arm64] - os: [win32] - requiresBuild: true - dev: true - optional: true - - /@rometools/cli-win32-x64@12.1.3: - resolution: {integrity: sha512-yHSKYidqJMV9nADqg78GYA+cZ0hS1twANAjiFibQdXj9aGzD+s/IzIFEIi/U/OBLvWYg/SCw0QVozi2vTlKFDQ==} - cpu: [x64] - os: [win32] - requiresBuild: true - dev: true - optional: true - /@rushstack/node-core-library@3.59.4(@types/node@20.3.1): resolution: {integrity: sha512-YAKJDC6Mz/KA1D7bvB88WaRX3knt/ZuLzkRu5G9QADGSjLtvTWzCNCytRF2PCSaaHOZaZsWul4F1KQdgFgUDqA==} peerDependencies: @@ -16554,20 +16574,6 @@ packages: fsevents: 2.3.3 dev: true - /rome@12.1.3: - resolution: {integrity: sha512-e+ff72hxDpe/t5/Us7YRBVw3PBET7SeczTQNn6tvrWdrCaAw3qOukQQ+tDCkyFtS4yGsnhjrJbm43ctNbz27Yg==} - engines: {node: '>=14.*'} - hasBin: true - requiresBuild: true - optionalDependencies: - '@rometools/cli-darwin-arm64': 12.1.3 - '@rometools/cli-darwin-x64': 12.1.3 - '@rometools/cli-linux-arm64': 12.1.3 - '@rometools/cli-linux-x64': 12.1.3 - '@rometools/cli-win32-arm64': 12.1.3 - '@rometools/cli-win32-x64': 12.1.3 - dev: true - /rss-parser@3.13.0: resolution: {integrity: sha512-7jWUBV5yGN3rqMMj7CZufl/291QAhvrrGpDNE4k/02ZchL0npisiYYqULF71jCEKoIiHvK/Q2e6IkDwPziT7+w==} dependencies: diff --git a/rome.json b/rome.json deleted file mode 100644 index 7e62ff0823..0000000000 --- a/rome.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "./node_modules/rome/configuration_schema.json", - "linter": { - "enabled": true, - "rules": { - "recommended": true - } - }, - "formatter": { - "ignore": [ - "packages/firefish-js/api-extractor.json", - "packages/*/tsconfig.json", - "packages/*/built", - "packages/megalodon/lib", - "packages/*/package-lock.json", - "packages/backend/src/server/web/manifest.ts", - "packages/megalodon/src/misskey/web_socket.ts", - "packages/megalodon/src/misskey/api_client.ts", - "packages/backend/built/", - "*/model.json", - "*.md", - "*.spec.ts", - "*.png", - "*.jpeg", - "*.jpg", - "**/tsconfig.json", - "*/.yml" - ] - } -}