-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Lint for lowerCamelCase non-constant identifiers (Style Guide). #57162
Comments
This should also be supported for constants but as a separate rule to make it possible to disable it for constants. |
is it possible to configure the linter to disagree with this rule and instead force the use of snake_case everywhere? http://dart-lang.github.io/linter/lints/non_constant_identifier_names.html |
There isn't currently any support for configuring the linter other than to enable or disable rules. If there were a rule to enforce the use of snake_case, then you could enable it and disable the other identifier-related rules (all rules are disabled by default, so disabling a rule amounts to not enabling it). However, there isn't such a rule at this time. |
Thank you Brian, |
@bwilkerson I just realized, a year later... when you say no rules are enabled by default, that's probably true for this linter and maybe for dart. |
created issue flutter/flutter#34532 |
As I understand it, Flutter doesn't enable any lint rules by default either. But when you create a flutter project many tools will create an analysis options file that In any case, you can control which lint rules are enabled by creating an analysis options file in your package that specifies which rules to enable. If you already have an options file that uses |
It does, using flutter 2.5.... I have disabled the lint but it still shows up.. Now in my organisation we have a SCREAMING_CASE convention for constants |
That suggests a configuration error or a bug on our side. If you want to follow-up with more details (your options file contents, the structure of your project and code that is triggering the lint), we can help sort out what's happening. |
Oh thank you! I got it to work by disabling that lint for the constants file. and it works, although its not as good as disabling from the analysis_options.yaml |
How did you manage to disable it for a file? What rule name did you use? I have tried adding |
For this I think you'd want:
|
DO name non-constant identifiers using lowerCamelCase.
Class members, top-level definitions, variables, parameters, and named parameters should capitalize the first letter of each word except the first word, and use no separators.
GOOD:
The text was updated successfully, but these errors were encountered: