Generic Exceptions to the camelcase rule?
See original GitHub issueWhat rule do you want to change? camelcase
Does this change cause the rule to produce more or fewer warnings? fewer
How will the change be implemented? (New option, new default behavior, etc.)? new option in the camelcase rule
Please provide some example code that this change will affect:
var vwoDefined = typeof window._vwo_code !== 'undefined';
var git_version_file = pathUtils.resolvePath('./GIT_VERSION');
What does the rule currently do for this code?
throws warning warning Identifier '_vwo_code' is not in camel case
What will the rule do after it’s changed? not throw a warning provided the exception in question is added in the configuration/option
Previous version of the issue:
Is there a way to add generic exceptions to the camelcase rule, like provide a list of items, a regex rule etc?(except adding a comment to disable the rule)
For example if there’s a global / window variable from a script we have no control over (GA, AB testing tools such as VWO etc)
My suggestion:
"camelcase":[
1,
['variable_here', 'other_variable']
]
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (6 by maintainers)
Is there value in reopening this issue now that React 16.4 has added
UNSAFE_
-prefixed lifecycle methods (e.g., https://reactjs.org/docs/react-component.html#unsafe_componentwillmount)? A lot of React developers will be disabling this rule as the old lifecycle methods are deprecated.@smably You’re welcome to open a new issue with this new context about React, and we’ll gladly take another look. Thanks! (Feel free to link back to this issue for context, if you think it worthwhile.)