roxiness / routify-starter

https://example.routify.dev/
198 stars 55 forks source link

semicolons in code #74

Closed brgrz closed 3 years ago

brgrz commented 3 years ago

My eyes hurt due to all the missing semicolons. What's the guidance on this?

braebo commented 3 years ago

@brgrz You can run your formatter to adjust for your semicolon preference no?

brgrz commented 3 years ago

If I'm not missing something VS Code only gives option to insert semicolons in JS projects with TS installed and in actual TS projects. Routify template is neither..

braebo commented 3 years ago

A .prettierrc file with

{
    "semi": true
}

will add the semis for you. I'm pretty sure other formatters will too if you don't like prettier.

brgrz commented 3 years ago

😉

thanks

You're actually right I don't use Prettier but Beautify which doesn't have the option to manipulate semis :)

So I guess I'm off to svelte template and use the method of adding Routify to existing app, then?

braebo commented 3 years ago

If you just want a blank starter, you can delete the example folder and you'd only need to add a few semis to App, Layout, and Fallback files.

jakobrosenberg commented 3 years ago

Not counting the example folder, it seems only _fallback.svelte and index.svelte are missing semis.

brgrz commented 3 years ago

I used the auth template, there are a bit more of them.

ghostdevv commented 3 years ago

@brgrz You could always add the missing semi-colons and then make a pr

jakobrosenberg commented 3 years ago

@ghostdevv that probably wouldn't get merged. I really dislike semi-colons. 😅

I think the best option is to run a CLI formatter after cloning the template.

ghostdevv commented 3 years ago

@jakobrosenberg that's fair enough, there really isn't a need for them in most of it. That is a good idea (the cli formatter)

jakobrosenberg commented 3 years ago

I'm sure there's a one-liner somewhere along the (madeup) lines of npx prettier --semi false src/**.

ghostdevv commented 3 years ago

Something like this maybe? idk https://www.npmjs.com/package/pretty-quick (npx don't work for me with this)