Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues working with Standard + Flow/ Flowtype (question/ asking for help!) #1139

Closed
frednomoon opened this issue May 21, 2018 · 2 comments

Comments

@frednomoon
Copy link

commented May 21, 2018

What version of standard?
standard@10.0.3
eslint@4.19.1
eslint-plugin-flowtype@2.46.3

What operating system, Node.js, and npm version?

npm 5.6.9
node 10.1.0
macos 10.12.6

What did you expect to happen?

I'm trying to use flow to enforce some interface types in my code, but struggling to get standard to recognise valid flow syntax.

Currently I have written:


interface Response {
  email: string;
  nickname: string;
  id: number;
}

var val: Response = {
  email: "1",
  nickname: "123",
  id: 1,
}

Which should return no errors

What actually happened?

Standard is underlining Response just after the keyword interface with the message:
[standard] Response is not defined. (no-undef).

In my package.json I have added the following as instructed by the docs

  "standard": {
    "parser": "babel-eslint",
    "plugins": [
      "flowtype"
    ]
  },

I expect I am lacking some config somewhere, but have had no luck getting to the bottom of this! Any help / suggestions much appreciated

@feross

This comment has been minimized.

Copy link
Member

commented May 23, 2018

According to this comment #984 (comment), the best workaround is to pin babel-eslint to 7.2.1.

As far as I'm aware, this is a bug in babel-eslint.

@feross feross closed this May 23, 2018

@feross feross added the question label May 23, 2018

@frednomoon

This comment has been minimized.

Copy link
Author

commented May 23, 2018

thanks @feross that has sorted it

@lock lock bot locked as resolved and limited conversation to collaborators Aug 21, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
2 participants
You can’t perform that action at this time.