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

does not support async methods #2270

Closed
graingert opened this issue Jun 13, 2016 · 5 comments
Closed

does not support async methods #2270

graingert opened this issue Jun 13, 2016 · 5 comments

Comments

@graingert
Copy link

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(); }
}
@markelog
Copy link
Member

Fixed in cst repo

@graingert
Copy link
Author

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
.

@markelog
Copy link
Member

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

@purplecones
Copy link

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

@markelog
Copy link
Member

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

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

Successfully merging a pull request may close this issue.

3 participants