Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛maxAllowedComplexity doesn’t pass validation #643

Closed
1 task done
arendjr opened this issue Oct 31, 2023 · 5 comments · Fixed by #646
Closed
1 task done

🐛maxAllowedComplexity doesn’t pass validation #643

arendjr opened this issue Oct 31, 2023 · 5 comments · Fixed by #646
Assignees
Labels
S-Needs response Status: await response from OP

Comments

@arendjr
Copy link
Contributor

arendjr commented Oct 31, 2023

Environment information

$ /home/arendjr/Projects/monofiber/node_modules/.bin/biome rage
CLI:
  Version:                      1.3.3
  Color support:                true

Platform:
  CPU Architecture:             x86_64
  OS:                           linux

Environment:
  BIOME_LOG_DIR:                unset
  NO_COLOR:                     unset
  TERM:                         "xterm-256color"
  JS_RUNTIME_VERSION:           "v20.9.0"
  JS_RUNTIME_NAME:              "node"
  NODE_PACKAGE_MANAGER:         "yarn/1.22.19"

Biome Configuration:
  Error:                        The field maxAllowedComplexity must contain an integer between 1 and 254
  Status:                       Loaded with errors
  Formatter disabled:           false
  Linter disabled:              false
  Organize imports disabled:    false
  VCS disabled:                 true

Workspace:
  Open Documents:               0

Done in 0.69s.

What happened?

I have the following config:

{
  "linter": {
    "enabled": true,
    "rules": {
      "recommended": true,
      "complexity": {
        "noExcessiveCognitiveComplexity": {
          "level": "error",
          "options": { "maxAllowedComplexity": 15 }
        }
      },
      "correctness": {
        "useExhaustiveDependencies": "error",
        "useHookAtTopLevel": "error"
      },
      "style": {
        "noParameterAssign": "off"
      }
    }
  }
}

And I get the message The field maxAllowedComplexity must contain an integer between 1 and 254 despite the value that I specified being in the given range.

Expected result

I should not get an error.

Code of Conduct

  • I agree to follow Biome's Code of Conduct
@ematipico ematipico self-assigned this Oct 31, 2023
@ematipico ematipico added A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug labels Oct 31, 2023
@ematipico
Copy link
Member

I can't reproduce the bug. It seems your JSON is syntactically wrong, you miss a } at the end

@ematipico ematipico added S-Needs response Status: await response from OP and removed A-Project Area: project S-Bug-confirmed Status: report has been confirmed as a valid bug labels Oct 31, 2023
@arendjr arendjr changed the title 🐛 <TITLE> 🐛maxAllowedComplexity doesn’t pass validation Oct 31, 2023
@arendjr
Copy link
Contributor Author

arendjr commented Oct 31, 2023

Sorry, the missing } was because I wanted to only copy the relevant section of my config.

But if it works for you, I wonder if something is off in my package. I’m using the one from Arch’s AUR repository. I’ll try and dig a bit deeper, thanks!

@ematipico
Copy link
Member

Do you mind updating the rage command too? To reflect the correct configuration

@arendjr
Copy link
Contributor Author

arendjr commented Nov 1, 2023

I just tried with the Biome version pulled from NPM, and I get the same issue. I've updated the rage output.

@arendjr
Copy link
Contributor Author

arendjr commented Nov 1, 2023

And the same thing happens with a debug build I built locally. At least that should make it easier to debug what's going on...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-Needs response Status: await response from OP
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants