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

Latest release breaks test #969

Closed
zemirco opened this issue Aug 9, 2017 · 10 comments

Comments

@zemirco
Copy link

commented Aug 9, 2017

I've got a simple React component:

export default class MyComponent extends React.Component {
  state = {
    active: false
  }

  render () {
    return (
      <div />
    )
  }
}

It always worked as expected but suddenly my tests at Travis are failing

'state' is not defined

Do I have to change anything in my config for the latest release? Here is the important part from my package.json. I'm using version "standard": "^10.0.2"

  "standard": {
    "parser": "babel-eslint"
  }

After removing node_modules and reinstalling everything I also get the error on my local machine.

@bcomnes

This comment has been minimized.

Copy link
Member

commented Aug 9, 2017

Is your babel set up to handle class properties? Thats the first thing that comes to mind.

@zemirco

This comment has been minimized.

Copy link
Author

commented Aug 9, 2017

Here is our .babelrc

{
  "env": {
    "test": {
      "presets": [
        ["env", {
          "modules": "commonjs"
        }]
      ],
      "plugins": ["transform-class-properties"]
    }
  },
  "presets": [
    "react",
    ["env", {
      "targets": {
        "browsers": ["last 2 versions", "safari >= 9"]
      },
      "useBuiltIns": true,
      "debug": true
    }]
  ],
  "plugins": ["transform-object-rest-spread", "transform-class-properties"]
}

Did you change anything with the latest release? It was working fine before.

@bcomnes

This comment has been minimized.

Copy link
Member

commented Aug 9, 2017

We updated to the latest standard JSX plugin to fix some other reported issues d22676e which had a few minor changes https://github.com/standard/eslint-config-standard-jsx/commits/master.

@vpcvdc

This comment has been minimized.

Copy link

commented Aug 11, 2017

Workaround solution

Remove parser property from standard object in package.json file

{
  "standard": {
    "parser": "babel-eslint"
  }
}

Add parser option in command line, like this
standard --parser babel-eslint

@Secretmapper

This comment has been minimized.

Copy link

commented Aug 21, 2017

@vpcvdc's workaround does not work for me.

This is a pretty big showstopper for us as currently we have a lot of fails in Travis + force committing (standard is part of my precommit hook). Any ETA as to when this gets fixed? @bcomnes

@gillesdemey

This comment has been minimized.

Copy link

commented Aug 23, 2017

Related to #944?

@feross

This comment has been minimized.

Copy link
Member

commented Nov 7, 2017

I think I just ran into this too. Started happening when I installed another package that had eslint@4 as a dependency alongside standard. In my case it was @sonarwhal/sonar.

Looks like standard is somehow using the wrong eslint version (we're still on eslint@3 as of standard@10.0.2) Removing that package solved the problem.

You can find other packages using eslint by running npm ls eslint in your project folder.

@Flet

This comment has been minimized.

Copy link
Member

commented Dec 15, 2017

I believe this will be fixed in the next version of standard where eslint and all plugins are bumped to the latest version.

Can you give it a try? npm install standard@beta

@Flet Flet added the v11 release label Dec 15, 2017

@xcv58

This comment has been minimized.

Copy link

commented Dec 20, 2017

I verified this is fixed by standard@11.0.0-beta.0, details:
xcv58/standard-issue-969@1ce51e3

@feross feross added this to the standard v11 milestone Feb 17, 2018

@feross

This comment has been minimized.

Copy link
Member

commented Feb 19, 2018

🗣 Standard 11 is released! Run npm install standard@latest --save-dev to update to the latest version. This will also update the version in package.json

Changelog: https://github.com/standard/standard/blob/master/CHANGELOG.md#1100---2018-02-18

@feross feross closed this Feb 19, 2018

@lock lock bot locked as resolved and limited conversation to collaborators May 25, 2018

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