Code Monkey home page Code Monkey logo

Comments (5)

7nik avatar 7nik commented on July 20, 2024

Technically, an event with whatever name can be dispatched on any element, so any on* handler must be allowed.
I see your point, and likely it could be more useful as an eslint rule.

from svelte.

jjones315 avatar jjones315 commented on July 20, 2024

My suggestion would be to catch it in the typings. I know most attributes are case insensitive. But these events are used by svelte and do not work with any casing

from svelte.

dummdidumm avatar dummdidumm commented on July 20, 2024

This is handled by typings already. Furthermore we can't know what custom events with weird typing someone might listen to. Enhancing the types for that in user land is a known pattern, if this was a warning inside the compiler we would need more options to silence it. Therefore closing

from svelte.

jjones315 avatar jjones315 commented on July 20, 2024

The casing is not handling by typings. Right now any casing is valid to the types but only full lowercase is valid to svelte. It seems like svelte should either work with any case or warn on invalid casing.

from svelte.

dummdidumm avatar dummdidumm commented on July 20, 2024

Oh right, language tools lowercases them - we need to stop doing that for event attributes in Svelte 5. Opened sveltejs/language-tools#2345 for that

from svelte.

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.