From: Jérôme Benoit Date: Mon, 14 Aug 2023 12:27:54 +0000 (+0200) Subject: build: switch to rome for code formatting X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=6f08178ea990841b8c3c642abcb3a3435768cad2;p=benchmarks-js.git build: switch to rome for code formatting Signed-off-by: Jérôme Benoit --- diff --git a/.lintstagedrc.js b/.lintstagedrc.js index b842793..eddb147 100644 --- a/.lintstagedrc.js +++ b/.lintstagedrc.js @@ -1,8 +1,8 @@ module.exports = { '*.{js,jsx,cjs,mjs}': [ - 'prettier --cache --write', + 'rome format --write', 'standard --fix', 'eslint --cache --fix' ], - '*.{json,md,yml,yaml}': ['prettier --cache --write'] + '!(.vscode/**)*.{json,md,yml,yaml}': ['rome format --write'] } diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index 697b382..0000000 --- a/.prettierignore +++ /dev/null @@ -1,2 +0,0 @@ -pnpm-lock.yaml -benchmark/results/ diff --git a/.prettierrc.json b/.prettierrc.json deleted file mode 100644 index 80901f7..0000000 --- a/.prettierrc.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "$schema": "https://json.schemastore.org/prettierrc", - "semi": false, - "singleQuote": true, - "trailingComma": "none" -} diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 1b4f357..93f80c7 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -2,8 +2,9 @@ // See https://go.microsoft.com/fwlink/?LinkId=827846 // for the documentation about the extensions.json format "recommendations": [ - "eamodio.gitlens", "EditorConfig.EditorConfig", - "streetsidesoftware.code-spell-checker" + "eamodio.gitlens", + "standard.vscode-standard", + "streetsidesoftware.code-spell-checker", ] } diff --git a/package.json b/package.json index 5102636..c41f7c0 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "benchmark:fibonacci": "node fibonacci.mjs", "benchmark:random": "node random.mjs", "benchmark:uuid-generator": "node uuid-generator.mjs", - "format": "prettier . --cache --write; standard . --fix", + "format": "rome format . --write; standard . --fix", "lint": "eslint . --cache", "lint:fix": "eslint . --cache --fix", "test": "echo \"Error: no test specified\" && exit 1" @@ -73,7 +73,7 @@ "eslint-plugin-promise": "^6.1.1", "husky": "^8.0.3", "lint-staged": "^13.3.0", - "prettier": "^3.0.1", + "rome": "^12.1.3", "standard": "^17.1.0", "typescript": "^5.1.6" } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 04bef66..46b122c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -61,9 +61,9 @@ devDependencies: lint-staged: specifier: ^13.3.0 version: 13.3.0 - prettier: - specifier: ^3.0.1 - version: 3.0.1 + rome: + specifier: ^12.1.3 + version: 12.1.3 standard: specifier: ^17.1.0 version: 17.1.0 @@ -194,6 +194,54 @@ packages: fastq: 1.15.0 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 + /@types/json5@0.0.29: resolution: {integrity: sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==} dev: true @@ -1889,12 +1937,6 @@ packages: engines: {node: '>= 0.8.0'} dev: true - /prettier@3.0.1: - resolution: {integrity: sha512-fcOWSnnpCrovBsmFZIGIy9UqK2FaI7Hqax+DIO0A9UxeVoY4iweyaFjS5TavZN97Hfehph0nhsZnjlVKzEQSrQ==} - engines: {node: '>=14'} - hasBin: true - dev: true - /prop-types@15.8.1: resolution: {integrity: sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==} dependencies: @@ -1985,6 +2027,20 @@ packages: glob: 7.2.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 + /run-parallel@1.2.0: resolution: {integrity: sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==} dependencies: diff --git a/rome.json b/rome.json new file mode 100644 index 0000000..d45bc64 --- /dev/null +++ b/rome.json @@ -0,0 +1,27 @@ +{ + "$schema": "https://docs.rome.tools/schemas/12.1.3/schema.json", + "organizeImports": { + "enabled": false + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true + } + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentSize": 2 + }, + "javascript": { + "formatter": { + "quoteStyle": "single", + "trailingComma": "none", + "semicolons": "asNeeded" + } + }, + "files": { + "ignore": [".vscode/", "pnpm-lock.yaml", "benchmark/results/"] + } +}