Git Product home page Git Product logo

Comments (4)

dsherret avatar dsherret commented on July 17, 2024

Once a symbol is used in the public api (in this case QrCode), then the entire symbol and therefore all its dependencies become part of the public api for type checking and documentation. It would be quiet complex (especially for documentation) and slower to make a more targeted approach like this.

In this scenario, I'd recommend extracting out the ERROR_CORRECTION_LEVEL to a separate declaration that can be shared by the private QrCode class and the public API (which the extracted declaration is now part of)

from deno.

lowlighter avatar lowlighter commented on July 17, 2024

But shouldn't the linter check whether the symbol is actually exported ?

Because I'd understand if the keyof typeof itself would be considered a slow type, but in this case it seems to be able to correctly infer the typing so it doesn't make sense that it makes extra effort to check the remaining of an unexported symbol...

I've rewritten my code anyways, but still feels like a bug. It should either work or just forbids the usage of unexported members in "implicitely public" api because it seems kind of unpredictable whether the slow type is going to be triggered or not

from deno.

dsherret avatar dsherret commented on July 17, 2024

But shouldn't the linter check whether the symbol is actually exported ?

No, it's extremely common for people to write typescript code using symbols that aren't exported, but are part of the public api.

It doesn't identify exported symbols, but symbols that are part of the public API.

because it seems kind of unpredictable whether the slow type is going to be triggered or not

Essentially it examines the exported types and then their dependencies and their dependencies, etc. So any symbol that is used even transitively by an exported type is part of the public API.

from deno.

lowlighter avatar lowlighter commented on July 17, 2024

Ok thank a lot for the explanations, make sense

from deno.

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.