Giter Site home page Giter Site logo

Comments (5)

Sec-ant avatar Sec-ant commented on July 21, 2024 1

I can reproduce from your repo. I narrowed it down and found it was triggered by the promotion of the once nursery rule useImportRestrictions when it is not the last rule in the nursery group. In your example it is followed by useSortedClasses. When I put it as the last rule of that group, or delete it from the group, the migration command succeeds.

This might be caused by the left over comma when a promoted rule was deleted from that object:

{
-  "ruleA": "error",
+  ,
   "ruleB": "error"
}

from biome.

ematipico avatar ematipico commented on July 21, 2024

Is it possible that you have a leading comma in biome.json and that you enabled it in the configuration file? e.g.

{
	"json": { "parser": { "allowTrailingCommas": true } }
}

from biome.

sparrowsl avatar sparrowsl commented on July 21, 2024

I have it in the javascript.formatter property section, and it is "trailingCommas": "es5"

from biome.

ematipico avatar ematipico commented on July 21, 2024

Could you share your biome.json file? Or a reproduction. Without more information we can't understand where the issue comes from

from biome.

sparrowsl avatar sparrowsl commented on July 21, 2024
{
  "$schema": "https://biomejs.dev/schemas/1.8.1/schema.json",
  "formatter": {
    "enabled": true,
    "formatWithErrors": false,
    "indentStyle": "space",
    "lineEnding": "lf",
    "lineWidth": 100,
    "ignore": [
      "node_modules",
      ".svelte-kit",
      ".husky",
      "**/.DS_Store",
      "**/node_modules",
      "./build",
      "./.svelte-kit",
      "./package",
      "**/.env",
      "**/.env.*",
      "**/*.db",
      "**/pnpm-lock.yaml",
      "**/package-lock.json",
      "**/yarn.lock"
    ]
  },
  "organizeImports": { "enabled": true },
  "linter": {
    "rules": {
      "recommended": true,
      "a11y": { "recommended": true },
      "complexity": {
        "recommended": true,
        "noUselessTernary": "error",
        "noVoid": "warn",
        "useSimplifiedLogicExpression": "warn"
      },
      "correctness": {
        "recommended": true,
        "noNewSymbol": "warn",
        "noUndeclaredVariables": "warn",
        "noUnusedImports": "warn",
        "noUnusedVariables": "warn",
        "useHookAtTopLevel": "error"
      },
      "nursery": {
        "recommended": true,
        "noDuplicateElseIf": "warn",
        "noDuplicateJsonKeys": "error",
        "useImportRestrictions": "warn",
        "useSortedClasses": {
          "level": "warn",
          "options": { "attributes": ["class"] }
        }
      },
      "performance": { "recommended": true },
      "security": { "recommended": true },
      "style": {
        "recommended": true,
        "noImplicitBoolean": "error",
        "noNegationElse": "warn",
        "noShoutyConstants": "error",
        "useBlockStatements": "error",
        "useCollapsedElseIf": "warn",
        "useForOf": "warn",
        "useFragmentSyntax": "warn",
        "useShorthandAssign": "warn",
        "useSingleCaseStatement": "error"
      },
      "suspicious": {
        "recommended": true,
        "noApproximativeNumericConstant": "error",
        "noConsoleLog": "warn",
        "noEmptyBlockStatements": "warn",
        "noMisrefactoredShorthandAssign": "error",
        "useAwait": "warn"
      }
    },
    "ignore": ["node_modules", ".svelte-kit", ".husky"]
  },
  "javascript": {
    "formatter": {
      "jsxQuoteStyle": "double",
      "quoteProperties": "asNeeded",
      "trailingCommas": "es5",
      "semicolons": "asNeeded",
      "arrowParentheses": "always",
      "bracketSpacing": true,
      "bracketSameLine": false,
      "quoteStyle": "double",
      "attributePosition": "auto"
    }
  },
  "overrides": [{ "include": ["*.svelte"] }]
}

This is the biome.json and this is the repo

from biome.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.