Modify overrides to also override/add globals
See original GitHub issueThe version of ESLint you are using. v4.19.1
The problem you want to solve.
For test files within our lib directory, we’d like to specify mocha-specific globals like it
and describe
, but ideally we wouldn’t allow those globals in product code.
Your take on the correct solution to problem.
It seems like overrides
provides the perfect solution here – but as far as I can tell it only overrides rules
right now, so we can’t use it to add globals
. Can overrides
easily be modified to define a new set of globals as well?
Thanks!
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Global Override Add-on
This add-on allows you to override some of the settings of notifications directly when editing a post, page, or custom post type. You...
Read more >Create overrides for a collection in your render layer | Maya ...
To create an override, middle-mouse drag and drop an attribute from the Attribute Editor to the Property Editor. You can also disable an ......
Read more >Knowing When to Use Override and New Keywords - C# ...
The override modifier extends the base class virtual method, and the new modifier hides an accessible base class method.
Read more >Installing & Configuring our Cancel Override Add-on
To set per membership cancel override, open the membership edit page in the MemberPress → Memberships page, scroll down to Membership Options, ...
Read more >How to Override Existing React Components
The sub-components also receive sharedProps . The latter is a set of props concerning the component state, and these props are used to...
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
Hi @thomascmost, thanks for the issue.
At the very least, you should be able to use environments (
env
) to enable the Mocha environment, which enables the Mocha globals (although, unfortunately, you don’t get fine-grained control of what globals to allow and disallow-- you could useno-restricted-globals
to work around that if needed).That said, it would be nice to handle globals in overrides. I’ll mark this as a core enhancement request.
overrides
supportsglobals
and other properties sincev4.1.0
.