halfnelson / nativescript-source-to-jsx-def

Walk nativescript source to generate JSX types for `svelte-type-checker-vscode`
Other
4 stars 1 forks source link

Attributes are all lower-cased #7

Closed shirakaba closed 4 years ago

shirakaba commented 4 years ago

If this is purely to support the Svelte idiom, could you please also distribute an alternative typings file that preserves the casing of the properties as expected by JS (e.g. marginTop).

I'd prefer that the event handler props preserve the casing of the event name (e.g. if the event name is doubleTap, then I'd prefer for the synthesised attribute to be spelled as onDoubleTap).

If the event names were naturally lower-case (as they are on Web), then ondoubletap would make sense, but they're not. I bring this up as there's no way for my renderer to transform a fully lower-cased event name back to its appropriate capitalisation, so I need the capitalisation to be preserved.

Yes, we'll lose the capitalisation of the first letter by writing events as onDoubleTap, but I think it's safe enough to assume that the very first character of the event name will always be lower-case just due to convention. I wouldn't go so far in preserving capitalisation as to ask for it to be concatenated fully faithfully ("on" + event_name, e.g. ondoubleTap).