Hi Matt,

We currently don't have a way of saying "this thing I previously declared
as global is not actually global here". If you're getting a particular
warning around this bit of code, you can disable the rule either at the
file level or by surrounding the code, such as:

/*eslint-disable no-unused-vars*/
var _ = require('lowdash');
/*eslint-enable no-unused-vars*/

(Replace "no-unused-vars" with whatever is complaining.)

Hope this helps.

-N

On Thu, Nov 6, 2014 at 10:11 AM, Matthew Forrester <[email protected]>
wrote:

> Hi,
>
> I have a project where in general I want to have a variable as global, so
> my root configuration is:
>
> {
>   "globals": {
>     "_": false
>   }
> }
>
> However one specific sub directory "_" is not global, but becomes a
> variable which is just assigned like normal...
>
> var _ =require('lowdash');
>
> I cannot see that there is a way for me to mark that "_" variable as non
> global as the true/false has been used for whether writes are allowed to
> that global or not. I can use the following configuration in the sub
> directory to work around the problem however I am not re-assigning the
> global, which is what the configuration implies.
>
> {
>   "globals": {
>     "_": true
>   }
> }
>
> I am highlighting the issue to find if there is a more elegant work-around
> and because I am unsure whether it is a a bug or unintended functionality???
>
> Thanks
>
> Matt
>
> --
> You received this message because you are subscribed to the Google Groups
> "ESLint" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>



-- 

______________________________
Nicholas C. Zakas
@slicknet

Author, Professional JavaScript for Web Developers
Buy it at Amazon.com:
http://www.amazon.com/Professional-JavaScript-Developers-Nicholas-Zakas/dp/1118026691/ref=sr_1_3

-- 
You received this message because you are subscribed to the Google Groups 
"ESLint" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to