build: switch to rome for code formatting
authorJérôme Benoit <jerome.benoit@sap.com>
Mon, 14 Aug 2023 12:27:54 +0000 (14:27 +0200)
committerJérôme Benoit <jerome.benoit@sap.com>
Mon, 14 Aug 2023 12:27:54 +0000 (14:27 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@sap.com>
.lintstagedrc.js
.prettierignore [deleted file]
.prettierrc.json [deleted file]
.vscode/extensions.json
package.json
pnpm-lock.yaml
rome.json [new file with mode: 0644]

index b8427937a014975025fc04d4d79bfb7f02bafb64..eddb147c5b41aeb5811423b139b685e8b952dd10 100644 (file)
@@ -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 (file)
index 697b382..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-pnpm-lock.yaml
-benchmark/results/
diff --git a/.prettierrc.json b/.prettierrc.json
deleted file mode 100644 (file)
index 80901f7..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-{
-  "$schema": "https://json.schemastore.org/prettierrc",
-  "semi": false,
-  "singleQuote": true,
-  "trailingComma": "none"
-}
index 1b4f357fff2a455120c7aa7cfb68e1fadd266e0a..93f80c7caf0804bf851c367da2e525b3a9c04f35 100644 (file)
@@ -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",
   ]
 }
index 5102636f4d735d51d4cea2f4523cde8d6c7522b1..c41f7c0c42661bd4581ddb01f3abf967aeb14790 100644 (file)
@@ -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"
   }
index 04bef66305be7f35f85ce91b3b295e957f10ed31..46b122c68fd1139007ff83e10882f4652464716d 100644 (file)
@@ -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 (file)
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/"]
+  }
+}