Namespaced global variables
See original GitHub issueI would like to solicit feedback about implications of adding this potential extension to the globals configuration.
What version are you using? 4.10.0
What problem do you want to solve?
Create a configuration that will allow global variables to be defined dynamically using a namespace. This would allow a namespaced set of global variables that can be used within a context where no-undef
is otherwise enforced.
What’s your take on the correct solution to problem? Allow for a configuration along the lines of:
{
"globals": {
"somename_": {
"namespace": true,
"prefix": true
}
}
}
And any global variables prefixed with somename_
would be allowed in files within which they are not declared.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (4 by maintainers)
Top Results From Across the Web
C++ global variable in namespace [duplicate] - Stack Overflow
This is caused by the initialization order of global static variables. It is undefined and is known as static initialization order fiasco.
Read more >about Namespace and global variables - C++ Forum
`Use variables in an unnamed namespace instead of using static global variables. when I am learning c++, i read these two sentences above,...
Read more >Global Namespace (The GNU Awk User's Guide)
In standard awk , there is a single, global, namespace. This means that all function names and global variable names must be unique....
Read more >6.4 — Introduction to global variables - Learn C++
Global variables have file scope (also informally called global scope or global namespace scope), which means they are visible from the ...
Read more >26. Global vs. Local Variables and Namespaces
While in many or most other programming languages variables are treated as global if not declared otherwise, Python deals with variables the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, I think I used the wrong message (edited my comment above). As you said, this probably would have needed to be a core change and not a custom rule.
Gotcha. Thanks again!