Coder Social home page Coder Social logo

Comments (5)

remcohaszing avatar remcohaszing commented on May 24, 2024 1

postcss-image-set-function uses module.exports =, but its type definitions specify export default.

https://arethetypeswrong.github.io/[email protected]

from arethetypeswrong.github.io.

andrewbranch avatar andrewbranch commented on May 24, 2024

Is there an example of this in a real package I can look at?

from arethetypeswrong.github.io.

andrewbranch avatar andrewbranch commented on May 24, 2024

Ah, I thought this would be an easy fix, but it looks like I should probably address this note:

// Also need to check for `default` property on `jsModule["export="]`?

before expanding the scope of this rule, which requires bringing the type checker into play, like #22 also requires. Turning the rule on for other resolution modes (I think it was an accident that I didn’t before) made postcss really blow up, because it can’t identify the pattern:

module.exports = AtRule
AtRule.default = AtRule

that they use throughout, which should not trigger the FalseDefaultExport problem.

I started some work on type checking / whole program support a few days ago, but I’m still just working on this in my spare time.

from arethetypeswrong.github.io.

remcohaszing avatar remcohaszing commented on May 24, 2024

Another one is [email protected]. (It’s fixed in newer versions.) It’s reported as an issue for ESM, but really it’s an issue for CJS.

When compiling a default import to CJS consuming that package, those types are fine. However, when manually writing CJS and using checkJs, it’s not nice to use such types.

It’s different though, because unlike postcss-image-set-function, [email protected] at least could be used without esModuleInterop.

from arethetypeswrong.github.io.

not-my-profile avatar not-my-profile commented on May 24, 2024

I think it would make sense to display a ? for the node16 (from CJS) row instead of a ✅ until this issue has been fixed since claiming that the types are ok when they're not is misleading and confusing.

Or perhaps add a disclaimer that all ✅ are to be taken with a grain of salt since this tool doesn't yet support type checking.

from arethetypeswrong.github.io.

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.