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

eslint: fix no-undef for static properties #23382

Merged
merged 2 commits into from
Mar 16, 2018
Merged

Conversation

samouri
Copy link
Contributor

@samouri samouri commented Mar 16, 2018

@eliorivero today reported getting (false) no-undef warnings in eslint. It was caused by upgrading babel-eslint which has this bug in it. downgrading seems to fix it.

To Test

  1. checkout this branch and do an npm install
  2. run node_modules/.bin/eslint client/signup/step-wrapper/index.jsx. You shouldn't get any errors

@matticbot
Copy link
Contributor

@samouri samouri self-assigned this Mar 16, 2018
@samouri samouri added [Type] Bug [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 16, 2018
Copy link
Contributor

@gwwar gwwar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@gwwar
Copy link
Contributor

gwwar commented Mar 16, 2018

Desktop breakage looks a little odd. Maybe we need to clear a cache?

Bundling app and server
fs.js:646
  return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
                 ^

Error: ENOENT: no such file or directory, open '/Users/distiller/wp-desktop/calypso/.babelrc'
    at Object.fs.openSync (fs.js:646:18)
    at Object.fs.readFileSync (fs.js:551:33)
    at Object.<anonymous> (/Users/distiller/wp-desktop/webpack.shared.js:11:36)
    at Module._compile (module.js:643:30)

Copy link
Contributor

@eliorivero eliorivero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works fine 🐑
Tested:

node_modules/.bin/eslint client/signup/step-wrapper/index.jsx                                                                                                                            

and got

The react/jsx-space-before-closing rule is deprecated. Please use the react/jsx-tag-spacing rule with the "beforeSelfClosing" option instead.

And also added a change like

static defaultProps = {
	foo: 'bar',
};

and committed, which is similar to the original case where I found this, and got no issues.

@eliorivero eliorivero added [Status] Ready to Merge and removed [Status] Needs Review The PR is ready for review. This also triggers e2e canary tests and wp-desktop tests automatically. labels Mar 16, 2018
@samouri samouri merged commit 007c377 into master Mar 16, 2018
@samouri samouri deleted the fix/babel-eslint-integration branch March 16, 2018 21:38
@jsnajdr
Copy link
Member

jsnajdr commented Mar 16, 2018

@nosolosw tried to upgrade our eslint to 4.0 few months ago (around the GM) and had to revert it because of errors. And I'm pretty sure that it was something with class properties, too. Maybe exactly the same error.

If we resolve this, could we try the eslint 4.0 upgrade again soon?

rclations pushed a commit that referenced this pull request Mar 18, 2018
* downgrade babel-eslint

* shrinkwrap
@oandregal
Copy link
Contributor

I'm at my support rotation this week, so I've got limited bandwith. FWIW, #18106 is the issue I ran into.

@oandregal
Copy link
Contributor

Note that babel-eslint still reports that is not compatible with ESLint4, and the original issue is still open.

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

Successfully merging this pull request may close these issues.

None yet

6 participants