Giter Site home page Giter Site logo

Comments (4)

arendjr avatar arendjr commented on July 21, 2024 1

@Sec-ant Good shout! I think that will help as a workaround, though I would still agree with the report since it doesn’t make sense semantically to specify the function rather than the prop. The ignore syntax is currently indeed stricter than the actual dependency verification, so there’s at least some improvement to be made here.

That said, this improvement may not be particularly easy to implement, since the rule instances (props.myArr.map in this case) get handed to the analyzer, which matches them against the specified ignores without specialized knowledge of the rule that reported it…

PS.: The syntax is new since 1.8 ;)

from biome.

arendjr avatar arendjr commented on July 21, 2024 1

I think I may see a solution: Instead of passing rule instances as Strings, we could create a RuleInstancePath type that holds a Vec<String>. Then this instance could be reported as:

RuleInstancePath {
    parts: vec!["props", "myArr", "map"]
}

This would give the analyzer a good agnostic method of matching on parts of ignored instances. The only “magic” still involved is that the analyzer would parse the ignore instance props.myArr and treat the dot as a separator. Choosing the dot as separate works well for this case, but it may turn out to be awkward for other situations. Even a case like props.myArr[0] is already finicky, since [0] should be its own part too. May need to put some thought into this 🤔

from biome.

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

I don't think we support this kind of ignore syntax? https://biomejs.dev/linter/#ignoring-code

Ah, I was wrong: https://biomejs.dev/linter/rules/use-exhaustive-dependencies/#ignoring-a-specific-dependency

from biome.

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

As suggested, the dependency is props.myArr.map, so this works: https://biomejs.dev/playground/?code=aQBtAHAAbwByAHQAIAB7ACAAdQBzAGUAQwBhAGwAbABiAGEAYwBrACAAfQAgAGYAcgBvAG0AIAAnAHIAZQBhAGMAdAAnADsACgAKAHQAeQBwAGUAIABQAHIAbwBwAHMAIAA9ACAAewAKACAAIAByAGUAYQBkAG8AbgBsAHkAIABtAHkAQQByAHIAOgAgAHIAZQBhAGQAbwBuAGwAeQAgAHMAdAByAGkAbgBnAFsAXQA7AAoAfQAKAAoAZQB4AHAAbwByAHQAIABjAG8AbgBzAHQAIABDAG8AbQBwACAAPQAgACgAcAByAG8AcABzADoAIABQAHIAbwBwAHMAKQAgAD0APgAgAHsACgAgACAALwAvACAAYgBpAG8AbQBlAC0AaQBnAG4AbwByAGUAIABsAGkAbgB0AC8AYwBvAHIAcgBlAGMAdABuAGUAcwBzAC8AdQBzAGUARQB4AGgAYQB1AHMAdABpAHYAZQBEAGUAcABlAG4AZABlAG4AYwBpAGUAcwAoAHAAcgBvAHAAcwAuAG0AeQBBAHIAcgAuAG0AYQBwACkAOgAgAEIAbABhAGIAbABhAAoAIAAgAHUAcwBlAEMAYQBsAGwAYgBhAGMAawAoACgAKQAgAD0APgAgAHsACgAgACAAIAAgAGMAbwBuAHMAbwBsAGUALgBsAG8AZwAoAHAAcgBvAHAAcwAuAG0AeQBBAHIAcgAuAG0AYQBwACgAaQAgAD0APgAgAGkAKQApAAoAIAAgAH0ALAAgAFsAXQApADsACgB9AA%3D%3D

Does it solve your issue?

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.