marcoroth/stimulus-lsp

Diagnostic: Warn if `Application.register()` gets called with "invalid" controller identifier

Opened this issue · 0 comments

import { application } from "./application"

application.register("camelCased", controller)
//                   ^^^^^^^^^^^^
//                   Use dasherized instead of camelCased controller identifiers. 
//                   Quick-Fix: Rename to `camel-cased`

Similar with underscored idedentifiers:

import { application } from "./application"

application.register("under_scored", controller)
//                   ^^^^^^^^^^^^^^
//                   Use dasherized instead of under_scored controller identifiers. 
//                   Quick-Fix: Rename to `under-scored`

Inspired by:

https://x.com/george_kettle/status/1721945825968902160