jscs-dev/node-jscs

does not support async methods

graingert opened this issue · 5 comments

Using the airbnb preset with:

import ham from 'ham';

class Foo {
  async blah() {}
}

I get:

Expected token type "Punctuator" but "Identifier" found at test/webdriver.js :
     1 |import ham from 'ham';
--------^
     2 |
     3 |class Foo {

It works fine with:

import ham from 'ham';

async function blah() {};

class Foo {
  blah() { return this::blah(); }
}

Fixed in cst repo

How do I use the cst repo?
On 13 Jun 2016 23:16, "Oleg Gaidarenko" notifications@github.com wrote:

Fixed in cst repo


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#2270 (comment),
or mute the thread
https://github.com/notifications/unsubscribe/AAZQTB2yE_LB63hP-qff-qMgq0nJFNLhks5qLdaqgaJpZM4I0arw
.

Wait until cst is updated in jscs, hence this ticket is still open

I still get this issue. See related issue filed with AtomLinter AtomLinter/linter-jscs#282 for more info.

Sample Code:

import shortid from 'shortid';

const rootResolvers = () => {
  return {
    Query: {
      async test(root, args, context) {
        return test;
      },
    },
  };
};

export default rootResolvers;

JSCS CLI Export:

jscs resolvers.js -c airbnb.json
Expected token type "Punctuator" but "Identifier" found at resolvers.js :
     1 |import shortid from 'shortid';
--------^
     2 |
     3 |const rootResolvers = () => {


1 code style error found.
jscs --version
3.0.7

Those are different issues - you are talking about object method whereas original issue is about class method, created - cst/cst#133