Browse Source

build: replace prettier with biome (#62054)

Yagiz Nizipli 1 year ago
parent
commit
31aac1b9b0

+ 5 - 0
.eslintrc.js

@@ -16,6 +16,7 @@ const strictRulesNotCi = {
 };
 
 module.exports = {
+  root: true,
   extends: [isRelaxed ? 'sentry-app' : 'sentry-app/strict'],
   globals: {
     require: false,
@@ -35,6 +36,10 @@ module.exports = {
   },
 
   overrides: [
+    {
+      files: ['tests/js/**/*.{ts,js}'],
+      extends: ['plugin:testing-library/react', 'sentry-app/strict'],
+    },
     {
       files: ['*.ts', '*.tsx'],
       rules: {},

+ 2 - 2
.github/workflows/scripts/deploy.js

@@ -20,8 +20,8 @@ module.exports = {
     const name = frontendOnly
       ? 'only frontend changes'
       : backendOnly
-      ? 'only backend changes'
-      : 'fullstack changes';
+        ? 'only backend changes'
+        : 'fullstack changes';
 
     if (!name) {
       return null;

+ 8 - 5
.pre-commit-config.yaml

@@ -112,15 +112,18 @@ repos:
       - id: debug-statements
       - id: name-tests-test
         args: [--pytest-test-first]
+  - repo: https://github.com/biomejs/pre-commit
+    rev: v0.1.0
+    hooks:
+      - id: biome-check
+        name: biome (javascript, typescript, json)
+        additional_dependencies: ['@biomejs/biome@1.5.3']
   - repo: https://github.com/pre-commit/mirrors-prettier
     rev: 'v3.0.3' # Use the sha or tag you want to point at
     hooks:
       - id: prettier
-        name: prettier (yaml, json, markdown)
-        types_or:
-          - json
-          - yaml
-          - markdown
+        name: prettier (yaml, markdown)
+        types: [yaml, markdown]
         # https://pre-commit.com/#regular-expressions
         exclude: |
           (?x)^($^

+ 0 - 3
.prettierignore

@@ -1,3 +0,0 @@
-# Avoid yarn and prettier fighting over formatting
-package.json
-**/*.trace.json

+ 0 - 11
.prettierrc

@@ -1,11 +0,0 @@
-{
-  "bracketSpacing": false,
-  "bracketSameLine": false,
-  "printWidth": 90,
-  "semi": true,
-  "singleQuote": true,
-  "tabWidth": 2,
-  "trailingComma": "es5",
-  "useTabs": false,
-  "arrowParens": "avoid"
-}

+ 1 - 1
.vercelignore

@@ -13,7 +13,7 @@
 !jest.config.js
 !now.json
 !package.json
-!.prettierrc
+!biome.json
 !stylelint.config.js
 !tsconfig.json
 !config

+ 1 - 1
.vscode/extensions.json

@@ -2,7 +2,7 @@
   // See https://go.microsoft.com/fwlink/?LinkId=827846
   // for the documentation about the extensions.json format
   "recommendations": [
-    "esbenp.prettier-vscode",
+    "biomejs.biome",
     "ms-python.python",
     "ms-python.black-formatter",
     "dbaeumer.vscode-eslint",

+ 38 - 11
.vscode/settings.json

@@ -17,18 +17,22 @@
   "files.trimFinalNewlines": true,
   "files.insertFinalNewline": true,
 
-  "editor.codeActionsOnSave": {
-    "source.fixAll.eslint": "explicit"
-  },
-
   "[javascript]": {
     "editor.formatOnSave": true,
-    "editor.tabSize": 2
+    "editor.tabSize": 2,
+    "editor.defaultFormatter": "biomejs.biome",
+    "editor.codeActionsOnSave": {
+      "quickfix.biome": true
+    }
   },
 
   "[typescript]": {
     "editor.formatOnSave": true,
-    "editor.tabSize": 2
+    "editor.tabSize": 2,
+    "editor.defaultFormatter": "biomejs.biome",
+    "editor.codeActionsOnSave": {
+      "quickfix.biome": true
+    }
   },
   // Exclude Specific Files from Auto-Imports
   "typescript.preferences.autoImportFileExcludePatterns": [
@@ -41,23 +45,33 @@
 
   "[typescriptreact]": {
     "editor.formatOnSave": true,
-    "editor.tabSize": 2
+    "editor.tabSize": 2,
+    "editor.defaultFormatter": "biomejs.biome",
+    "editor.codeActionsOnSave": {
+      "quickfix.biome": true
+    }
   },
 
   "[javascriptreact]": {
     "editor.formatOnSave": true,
-    "editor.tabSize": 2
+    "editor.tabSize": 2,
+    "editor.defaultFormatter": "biomejs.biome",
+    "editor.codeActionsOnSave": {
+      "quickfix.biome": true
+    }
   },
 
   "[less]": {
-    "editor.formatOnSave": true
+    "editor.formatOnSave": true,
+    "editor.codeActionsOnSave": {
+      "source.fixAll.eslint": "explicit"
+    }
   },
 
   "[python]": {
     "editor.formatOnSave": true,
     "editor.codeActionsOnSave": {
-      "source.organizeImports": "explicit",
-      "source.fixAll.eslint": "never"
+      "source.organizeImports": "explicit"
     },
     "editor.defaultFormatter": "ms-python.black-formatter"
   },
@@ -66,6 +80,19 @@
     "editor.formatOnSave": false
   },
 
+  "[json]": {
+    "editor.defaultFormatter": "biomejs.biome",
+    "editor.codeActionsOnSave": {
+      "quickfix.biome": true
+    }
+  },
+
+  "[markdown]": {
+    "editor.codeActionsOnSave": {
+      "source.fixAll.eslint": "explicit"
+    }
+  },
+
   "editor.tabSize": 4,
   "python.testing.pytestEnabled": true,
   "python.testing.unittestEnabled": false,

+ 1 - 1
LICENSE.md

@@ -53,7 +53,7 @@ Permitted Purposes specifically include using the Software:
 
 4. in connection with software development services or managed services that
    you provide to a licensee using the Software in accordance with these Terms
-and Conditions.
+   and Conditions.
 
 ### Patents
 

+ 6 - 1
api-docs/components/schemas/entries.json

@@ -193,7 +193,12 @@
                 "stacktrace": {
                   "type": "object",
                   "nullable": true,
-                  "required": ["frames", "framesOmitted", "registers", "hasSystemFrames"],
+                  "required": [
+                    "frames",
+                    "framesOmitted",
+                    "registers",
+                    "hasSystemFrames"
+                  ],
                   "properties": {
                     "frames": {
                       "type": "array",

Some files were not shown because too many files changed in this diff