SkyCrypt icon indicating copy to clipboard operation
SkyCrypt copied to clipboard

Variable name style

Open nstringham opened this issue 4 years ago • 6 comments

variable and constant names are very inconsistent.

we should make a style guide so we can all start doing the same thing

I like using camelCase for variables and constants and using PascalCase for classes and types.

nstringham avatar Mar 10 '22 04:03 nstringham

For object properties I would suggest snake_case

But yeah I noticed it too... for classes I think we always use PascalCase, variables mostly camelCase but there's some snake_case sometimes

dukio avatar Mar 10 '22 08:03 dukio

Can eslint check these things?

dukio avatar Mar 10 '22 08:03 dukio

For object properties I would suggest snake_case

I've never seen that before. any particular reason?

nstringham avatar Mar 10 '22 12:03 nstringham

Can eslint check these things?

It looks like TypeScript eslint can https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/eslint-plugin/docs/rules/naming-convention.md

nstringham avatar Mar 10 '22 12:03 nstringham

For object properties I would suggest snake_case

I've never seen that before. any particular reason?

not that I'm aware of... I just see them often around, but camelCase is fine too

dukio avatar Mar 10 '22 17:03 dukio

For object properties I would suggest snake_case

I've never seen that before. any particular reason?

not that I'm aware of... I just see them often around, but camelCase is fine too

Personally I think snake_case would be better for consistency with object properties from Hypixel, so we don't have to just go back and forward between snake_case and camelCase. For variables, I'm a user of snake_case, but I understand using camelCase as it's been used in most of the code.

So I'm suggesting going snake_case for object properties, camelCase for functions and variables, UPPER_CASE for globally defined variables and PascalCase for classes.

MartinNemi03 avatar Apr 23 '22 11:04 MartinNemi03

@metalcupcake5

DuckySoLucky avatar Aug 07 '23 16:08 DuckySoLucky