`no-new-object`: warns on non-global Object instantiation
See original GitHub issueTell us about your environment
What did you expect to happen? No warning.
What actually happened? Please include the actual, raw output from ESLint.
The object literal notation {} is preferrable. eslint(no-new-object)
Are you willing to submit a pull request to fix this bug? Sure.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Warning C26427 | Microsoft Learn
Global objects may be initialized in an inconsistent or undefined order, which means that interdependency between them is risky and should be ...
Read more >C++ global initialization order ignores dependencies?
1) Init order depends on object files order passed to linker. Straight or reverse -not matter. You may create test application to detect...
Read more >Switch to warn of global variables in a C++ shared object
A switch to warn of global variables in a compilation unit would be very helpful for those who are aware of the issue...
Read more >Global Object Constructors | Reference - Particle docs
Any class that depends on another globally initialized class instance. The reason is that the order that the compiler initializes global objects varies,...
Read more >6.8 — Why (non-const) global variables are evil - Learn C++
When developers tell you that global variables are evil, they're usually not talking about all global variables. They're mostly talking ...
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 FreeTop 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
Top GitHub Comments
I’ll open an issue for globals, it would be nice to unify that.
As for this issue with
no-new-objects
, it looks safe for now to just fix the shadowing bug, withoutReferenceTracker
?@ljharb Agreed that this case is a bug.
@mdjermanovic Thanks for digging into this! Could we create a new meta issue with all the differences in how we handle globals at the moment?