Skip to content

Svelte should throw a compile time error when illegal characters are used in computed names #1083

@lnryan

Description

@lnryan

Computed values are transformed into functions so random-api becomes random-api(){} which is not allowed.

        computed:{
            "random-api":(pw_min,pw_max,passwords)=>{
                return `apiurlsomethingsomething`
            }
        }

The compiler should suggest an alternative like random_api, which is admittedly uglier 🤷‍♀️, but completely valid, and not svelte's fault obvi

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions