Added a bunch more details on how this rule should work to the issue for 
this enhancement:

https://github.com/nzakas/eslint/issues/324

The meta point there is that JSHint is more aggressive than is necessary 
for this rule. We can certainly try to reach for parity, but there are two 
JSHint issues that want this rule relaxed for cases where there is no 
ambiguity or chance for errors. The only real example I found that this 
rule is meant to protect is at the beginning of Section 7 of the ECMAScript 
standard. 


On Wednesday, September 4, 2013 10:09:41 AM UTC-7, Nicholas Zakas wrote:
>
> Hmmm, could be. Anton, any idea what pattern using "yield" would result in 
> W092 in JSHint?
>
>
> On Wed, Sep 4, 2013 at 10:00 AM, Ian Christian Myers 
> <[email protected]<javascript:>
> > wrote:
>
>> That's what I thought would do it too, but instead it gives the following 
>> warnings:
>>
>> - Expected an identifier and instead saw '.'.
>> - Expected an assignment or function call and instead saw an expression.
>>
>> Perhaps it's a bug in JSHint?
>>
>>
>> On Sep 4, 2013, at 9:54 AM, Nicholas Zakas 
>> <[email protected]<javascript:>> 
>> wrote:
>>
>> It seems like this would cause it:
>>
>> function* foo(bar) { yield /test/.test(bar); }
>>
>> Not so?
>>
>>
>> On Tue, Sep 3, 2013 at 10:28 AM, Ian Christian Myers 
>> <[email protected]<javascript:>
>> > wrote:
>>
>>> I've been looking into this JSHint rule to continue the long march 
>>> toward parity: W092 Wrap the /regexp/ literal in parens to disambiguate 
>>> the slash operator.
>>>
>>> The W092 warning is raised 2 times in the JSHint codebase. The first 
>>> time is in the following case where a regex directly follows a return 
>>> statement:
>>>
>>> function foo(bar) { return /test/.test(bar); }
>>>
>>> The second case appears to have something to do with a yield expression, 
>>> but I cannot for the life of me figure out how to get a yield expression to 
>>> cause the W092 warning. Here is a link to the line where the W092 warning 
>>> is being raised: 
>>> https://github.com/jshint/jshint/blob/master/src/jshint.js#L3920
>>>
>>> Does anyone have an example of some code that would raise this warning?
>>>
>>> Thanks,
>>>
>>> Ian
>>>
>>> -- 
>>> 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] <javascript:>.
>>> For more options, visit https://groups.google.com/groups/opt_out.
>>>
>>
>>
>>
>> -- 
>>
>> ______________________________
>> 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
>>  
>>
>>
>>
>
>
> -- 
>
> ______________________________
> 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/groups/opt_out.

Reply via email to