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

Fixes eslint config #90

Closed
wants to merge 8 commits into from
Closed

Fixes eslint config #90

wants to merge 8 commits into from

Conversation

jeffrey-xiao
Copy link

No description provided.

.eslintrc.js Outdated
@@ -1,6 +1,9 @@
module.exports = {
'extends': 'airbnb',
'rules': {
'react/jsx-filename-extension': [1, { "extensions": [".js", ".jsx"] }],

Choose a reason for hiding this comment

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

Do we want to allow files with both these extensions to have JSX? Is this for tests?

Also, could you use "warn" instead of "1"?

Copy link
Author

Choose a reason for hiding this comment

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

Well we should not have .jsx extensions right? This is for tests.

Choose a reason for hiding this comment

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

Sorry, if you're saying we shouldn't have .jsx extensions, shouldn't we only be allowing .js extensions then?

Copy link
Author

Choose a reason for hiding this comment

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

Isn't not having .jsx extensions the status quo for js at Yelp?

Copy link
Contributor

Choose a reason for hiding this comment

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

@jeffrey-xiao @adityavohra7 What would the recommendation be for a test that has jsx? .jsx or .js?

I believe @jeffrey-xiao is suggesting tests can have jsx in .js files for tests, hence the whitelisted extension. This generalized rule does seem to be ill suited for components and containers where we want to enforce jsx to be only in .jsx files.

Choose a reason for hiding this comment

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

We've gone with .js everywhere at Yelp because of this reasoning. I personally think allowing two file extensions is confusing, but it isn't that big of a deal either way!

package.json Outdated
@@ -25,7 +25,7 @@
"eslint-config-airbnb": "^15.0.1",
"eslint-loader": "^1.6.1",
"eslint-plugin-import": "^2.2.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-jsx-a11y": "^5.1.1",

Choose a reason for hiding this comment

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

Could you clarify why you're down-pinning this?

Copy link
Author

Choose a reason for hiding this comment

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

Choose a reason for hiding this comment

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

Cool! Did you run this command to update the deps?

(
  export PKG=eslint-config-airbnb;
  npm info "$PKG@latest" peerDependencies --json | command sed 's/[\{\},]//g ; s/: /@/g' | xargs npm install --save-dev "$PKG@latest"
)

Copy link
Author

Choose a reason for hiding this comment

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

No, but I think that's the latest version of eslint-plugin-jsx-a11y that's compatible with eslint-config-airbnb

Copy link
Contributor

Choose a reason for hiding this comment

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

@jeffrey-xiao you can remove this portion from the PR, @sjhworkman separated this into another PR that is now merged

* 'master' of https://github.com/Yelp/beans:
  Save multiple participants for a meeting into db + refactoring (Yelp#100)
  method to get a dictionary of {user_pair:previous meeting count} (Yelp#98)
  downgrade react-router to v3.0.0 and a11y to v5.1.1 (Yelp#99)
  Revert eslint-plugin-jsx-a11y version to 5.1.1 to deal webpack errors (Yelp#97)
  Only disallow a pair if they matched earlier for the same subscription (Yelp#94)
  Devme (Yelp#92)
  Import PropTypes from prop-types package instead of react
  Created new module for matching. Renamed match.py to pair_match.py
@@ -26,13 +26,13 @@ module.exports = {
rules: [
{
use: 'eslint-loader?{fix: true}',
test: /\.jsx?$/,
test: /\.js?$/,

Choose a reason for hiding this comment

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

This should just be /\.js$/. Same for the others.

@@ -42,7 +42,7 @@ module.exports = {
contentBase: './',
},
resolve: {
Copy link

@adityavohra7 adityavohra7 Jul 28, 2017

Choose a reason for hiding this comment

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

I think you can remove this entirely. The defaults handle this.

@@ -0,0 +1,7391 @@
{

Choose a reason for hiding this comment

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

Delete this file? Or add it in another CR?

@kentwills
Copy link
Contributor

@adityavohra7 Do we still consider this to be the appropriate way to move forward?

@kentwills
Copy link
Contributor

Closing this fix as it is out of date with the current master. Will merge in changes and submit in a new pull request.

@kentwills kentwills closed this Jan 30, 2018
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants