Replies: 2 comments 1 reply
This comment was marked as low quality.
This comment was marked as low quality.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
I noticed that among the built-in rules in Biome.js, there is a noExcessiveNestedCallbacks, which is a rule implemented directly in Rust.
I’d now like to implement a similar check for JSX nesting depth—if a
JSXElementis nested more than n levels deep, it should trigger a warning prompting the user or AI agent to refactor their code. I haven’t found a similar built-in check, though I hope I haven’t overlooked it.I’m not sure if this rule is planned for implementation, so I’m considering using a GritQL plugin to implement it (though I’d be happy to submit a PR if the community plans to implement it). My initial idea was based on GritQL functions, but GritQL doesn’t seem to support arithmetic operations like addition, subtraction, multiplication, and division, nor does it support numerical comparisons. Support for recursion and loops is also somewhat difficult to understand. I’m not sure if this is because it hasn’t been implemented yet or if it’s by design, so I’m currently using a very inelegant solution:
Does Biome.js plan to support this rule? Or is there a better way to write this in GritQL?
Any response will be appreciate.
All reactions