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

Optimze both either description #2368

Merged
merged 3 commits into from
Jan 27, 2022

Conversation

adispring
Copy link
Member

No description provided.

@adispring adispring force-pushed the optimze-both-either-description branch from b70fe7a to 99cf77c Compare October 25, 2017 00:03
kedashoe
kedashoe previously approved these changes Oct 29, 2017
@customcommander
Copy link
Member

@adispring You have a merge conflict ;)

@CrossEye
Copy link
Member

Definitely a good idea. I'm still triaging issues, but if no one has gotten around to it before I get a chance, I'll clean up the conflicts.

@adispring
Copy link
Member Author

The conflict has been fixed.

@customcommander
Copy link
Member

@adispring would you mind fixing the linter errors as well?

@adispring
Copy link
Member Author

Ok, I'll see what happened.

@adispring
Copy link
Member Author

There is a eslint error in test/test.js, so I have to add a babel-eslint parser to fix this problem: https://stackoverflow.com/questions/51936079/eslint-how-to-ignore-parsing-error-invalid-regular-expression-flag

.eslintrc Outdated
@@ -7,6 +7,7 @@
"mocha": true,
"es6": true
},
"parser": "babel-eslint",
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure this is necessary? I didn't see any linter errors in your last push; only a failing test. So I am bit confused here.

Copy link
Member Author

Choose a reason for hiding this comment

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

As this stackoverflow said, regex symbol s is a ecmascript 2018 feature, eslint's default parser can not parse /***/s to a valid AST, and can not lint it.

There's 2 ways to fix this:

  1. Add "ecmaVersion": 6 to .eslintrc, but this will cause other eslint problems related to ecam version.
  2. add babel-eslint parser to parse /***/s .

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

Sorry I must be missing something here.

I know that #3158 introduced the s flag but last time I checked your pull request failed for exactly the same reason master is failing right now:

This is the only test that is failing on master:

Screenshot 2022-01-23 at 09 01 02

I'm failing to see how this relates to the regex flag.

That same test used to fail on your pull request however you have now chosen to disable that test.

Copy link
Member

Choose a reason for hiding this comment

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

What I am trying to say is that your pr didn't fail because of that regex flag you mention but because of that unit test failure.

Copy link
Member

Choose a reason for hiding this comment

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

Ok ignore this last comment. I just figured out that adding that babel-eslint was intended to fix a lint issue. But it does seem that we can fix that lint error without depending on another third-party plugin, we can just set the parser options in the eslint config file. See my other comment.

Copy link
Member

Choose a reason for hiding this comment

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

So I spent some time trying to figure out the issue with that test and I think that the test simply can't work at all considering the implementation of swap. I opened a PR to fix the linter and tests failures so that this PR can focus on just the documentation. See #3224

test/swap.js Outdated Show resolved Hide resolved
package.json Outdated
"devDependencies": {
"@babel/cli": "^7.4.4",
"@babel/core": "^7.4.5",
"@babel/preset-env": "^7.7.4",
"@babel/register": "^7.4.4",
"@babel/types": "^7.4.4",
"@rollup/plugin-babel": "^5.0.4",
"babel-eslint": "^10.1.0",
Copy link
Member

Choose a reason for hiding this comment

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

I played with the .eslintrc config and found that we don't need a plugin to fix the s regex flag issue. This seems to work fine too:

  "parserOptions": {
    "sourceType": "module",
    "ecmaVersion": 2018 <-- HERE
  },

@customcommander
Copy link
Member

@adispring: With #3224 merged only this commit of yours should be necessary now: 99cf77c

I can help you rebasing this branch (and others) if you don't have the time right now.

@adispring adispring force-pushed the optimze-both-either-description branch from f21e035 to 0426e96 Compare January 26, 2022 12:20
@adispring
Copy link
Member Author

Just reset to the first PR commit. @customcommander

@CrossEye CrossEye merged commit dc3e7e7 into ramda:master Jan 27, 2022
@adispring adispring mentioned this pull request Apr 7, 2023
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.

None yet

4 participants