Skip to content
This repository was archived by the owner on Mar 23, 2024. It is now read-only.

v2.10.0 - requireSpaceBeforeKeywords reports on a keyword not in its list #2135

Closed
ljharb opened this issue Feb 15, 2016 · 8 comments
Closed
Labels

Comments

@ljharb
Copy link
Contributor

ljharb commented Feb 15, 2016

In my config file, I have:

       "requireSpaceBeforeKeywords": [
         "do",
         "for",
         "if",
         "else",
         "switch",
         "case",
         "try",
         "catch",
         "finally",
         "while",
         "with",
         "return"
       ],

However, upon upgrading to v2.10.0, I get output like:

Missing space before "typeof" keyword at index.js :
    32 |module.exports = function isCallable(value) {
    33 | if (!value) { return false; }
    34 | if (typeof value !== 'function' && typeof value !== 'object') { return false; }
-------------^
    35 | if (hasToStringTag) { return tryFunctionObject(value); }
    36 | if (isES6ClassFn(value)) { return false; }

Missing space before "typeof" keyword at test.js :
    96 |test('Typed Arrays', function (st) {
    97 | forEach(typedArrayNames, function (typedArray) {
    98 |  if (typeof global[typedArray] !== 'undefined') {
--------------^
    99 |   st.ok(isCallable(global[typedArray]), typedArray + ' is callable');
   100 |  }

Note that "typeof" is not in my array of things I want a space before, and this was not an error in v2.9.x.

@hzoo
Copy link
Member

hzoo commented Feb 15, 2016

Ok that is really weird.. I haven't checked all the commits so will look through. @markelog

@ljharb
Copy link
Contributor Author

ljharb commented Feb 15, 2016

I do note in the changelog that this rule was changed - perhaps it's an unintended consequence?

@hzoo
Copy link
Member

hzoo commented Feb 15, 2016

Yeah definitely needs a fix.

@hzoo
Copy link
Member

hzoo commented Feb 15, 2016

Ok probably #2063

@ljharb ljharb mentioned this issue Feb 15, 2016
@ljharb
Copy link
Contributor Author

ljharb commented Feb 15, 2016

commented on the line responsible, hopefully the fix includes a regression test ;-)

@ljharb
Copy link
Contributor Author

ljharb commented Feb 15, 2016

Thanks, any idea how long before a v2.10.1?

@hzoo
Copy link
Member

hzoo commented Feb 15, 2016

Was busy, I think we were making sure it was correct

@ljharb
Copy link
Contributor Author

ljharb commented Feb 15, 2016

Sounds good, just looking for a timeline :-) thanks for the fast responses everyone!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants