svelthree icon indicating copy to clipboard operation
svelthree copied to clipboard

Use camelCase for exposed / public props and methods (Svelte's code convention)

Open vatro opened this issue 3 years ago • 2 comments

I like snake case. The question is what to use for exposed props and methods. I've started with camel, then here and there switched to snake if I've found it more readable.

Especially interesting:

  • based on shadowMapSize -> shadowMap vs. shadowmap (shadowmap snake wins)
  • on_pointerout (current) -> vs. onPointerOut vs. onPointerout (snake wins)

hm...

shadowMapSize -> shadowmap_size ? lookAt -> lookat ? castShadow-> cast_shadow ? receiveShadow-> receive_shadow ? boxParams -> box_params ? renderTarget -> render_target vs. rendertarget ? renderTargetParams -> render_target_params vs. rendertarget_params ? tabindex vs, tabIndex aniauto vs. aniAuto

onDestroy_inject_before -> 👀 ?!

vatro avatar Jun 21 '22 07:06 vatro

Ok, no wild things here, let's use Svelte's code conventions

  • snake_case for internal variable names and methods.
  • camelCase for public variable names and methods.

vatro avatar Oct 17 '22 14:10 vatro

I've already done a lot of this, just needs a final check + there are some props that still need to be changed.

vatro avatar Dec 21 '22 01:12 vatro