Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

function-name: add private static method regex #498

Closed
ckhatri opened this issue Sep 6, 2018 · 2 comments
Closed

function-name: add private static method regex #498

ckhatri opened this issue Sep 6, 2018 · 2 comments
Labels
Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Status: In Discussion Please continue discussing the proposed change before sending a pull request. Type: Rule Feature Adding a feature to an existing rule.
Milestone

Comments

@ckhatri
Copy link
Member

ckhatri commented Sep 6, 2018

If you have a private static method, currently I believe the linter reads it as private first and then uses the private regex. But I believe it should still use the static regex, since its a static method and its a great way to show that it is.

so private static methods currently are linted to be: getPotatoes() instead of GET_POTATOES().

Was wondering if y'all agree.

@JoshuaKGoldberg
Copy link

Great catch, thanks for posting this! This feels like something that should be configurable. Relevant options:

  • Validate private statics as privates
  • Validate private statics as statics
  • Validate private statics as both both privates and statics

Thoughts?

@JoshuaKGoldberg JoshuaKGoldberg added Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Status: In Discussion Please continue discussing the proposed change before sending a pull request. Type: Rule Feature Adding a feature to an existing rule. labels Sep 6, 2018
@ckhatri
Copy link
Member Author

ckhatri commented Sep 6, 2018

I think we should validate private statics as statics, to keep the ALL_CAPS consistent between all statics, no matter the type of the static. That way you can immediately tell its a static method, regardless of if its private/public/protected.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Difficulty: Easy Someone with little to no experience in TSLint should be able to send a pull request for this issue. Status: In Discussion Please continue discussing the proposed change before sending a pull request. Type: Rule Feature Adding a feature to an existing rule.
Projects
None yet
Development

No branches or pull requests

2 participants