Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove immutable state vars from var-name-mixedcase #270

Closed
gitpusha opened this issue Nov 5, 2020 · 5 comments
Closed

Remove immutable state vars from var-name-mixedcase #270

gitpusha opened this issue Nov 5, 2020 · 5 comments

Comments

@gitpusha
Copy link

gitpusha commented Nov 5, 2020

Like constant state vars I also like to snake-case my immutable state vars because it makes it easier to spot in my code where I am relying on immutable values.

image

However, currently this clashes with two rules I also use:

  1. var-name-mixedcase forces me to also make immutable mixed-case

  2. const-name-snakecase does not force me to make immutable snake-case

I would like to propose one of the following alterantives as feature requests:

Alternative 1: New rule: immutable-name-snakecase that when turned on overrides the var-name-mixedcase rules.

Alternative 2: strict option for var-name-mixedcase which when false does not include immutable vars && strict option for const-name-snakecase that when true also forces immutable vars to be snakecase

@frangio
Copy link

frangio commented Nov 20, 2020

I ran into this as well.

I would actually suggest that immutable variables should be treated exactly like constant variables as far as these rules are concerned (var-name-mixedcase and const-name-snakecase).

I don't think new rules or options are necessary.

@gitpusha
Copy link
Author

I guess some people still like to make immutable vars mixed-case because they do not have to be initialized like constant vars and that sort of sets them apart.

So I think having the extra immutable-name-snakecase rule would be benificial for both groups.

@hellwolf
Copy link
Contributor

yes please!

@BravoNatalie
Copy link

How are we on this?
I had this issue too, and I also support the idea of having immutable-name-snakecase.

@dbale-altoros
Copy link
Collaborator

see this PR
#458
will add new rule to treat immutable as constants or mixed case as needed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants