-
Notifications
You must be signed in to change notification settings - Fork 137
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
Fix MD Hyperlink Regex for nested cases #407
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested with the following examples:
[Text text] more text ([link [square brackets within] here](www.google.com))
[Text text] more text ([link (parenthesis within) here](www.google.com))
[Text text] more text [link here](www.google.com)
[Text text] more text ([link here](www.google.com))
[Text text] more text ([link here ](www.google.com))
[Text text] more text (([link here](www.google.com)))
[Text text] more text [([link here](www.google.com))]
[Text text] more text ([link here](www.google.com))[Text text] more text ([link here](www.google.com))
All of them seem to have worked fine:
Ran the test locally, they work fine.
Thanks, @aldo-expensify for running additional test cases! Appreciate your help. Can we merge this then? So that I can raise a PR for App with updated hash? |
@tgolen do you want to do a quick review before I merge? |
@aldo-expensify I added your additional test cases to the code itself. This will ensure future changes don't break these. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code changes look good. I'm a little confused by the lint errors that are showing up. Would you please merge main
into your branch to ensure you're on the latest version of our lint rules? It was recently updated. We recently had a change that increases the max-len
rule and should make these warnings go away.
@tgolen Yeah I did see many warnings and I did take the latest master branch for Previous PRs that are merged also show up the same warnings. |
Ah, good catch, I think https://github.com/Expensify/expensify-common/blob/master/package.json#L36 Since these aren't introduced in your PR, I'm OK with merging this and we can update the dependency in another PR. |
Thanks. I'll update the PR for App and link the GH issue. |
hmmm so did I miss updating something and the change is not really applied in the projects? |
I'm not really sure how NPM resolves this, but there are competing versions of the linter in this repo. I think the real proper way to change it is to go to expensify-common and change the eslint config to be a peer dependency instead of a normal dependency. That way, it will rely on the dependency from |
hmmmm but right now it's in dev dependencies... so if I move it to peer dependency, wouldn't that mean it will get installed in non dev? |
Not that I know of, no... as long as the peer ( |
But App does not have expensify-common as dev dependency.... |
This is beside the point. All we need is to have App list I'm not fully up to speed with how peer dependencies work, but I have worked with @kidroca on this with Onyx. See this example: https://github.com/Expensify/react-native-onyx/blob/master/package.json#L45-L48 (and more context in the original discussion can be found here). Onyx depends on React and React-Async-Storage. When those were listed as a normal dependency, and the version was not in sync with App, when you installed App, it would install and use two different versions of React. Not good, right? So, we modified Onyx to use a peer dependency instead, which means it will only use React from the host application. That's the same thing we want to do here. If that's still confusing, or if you have more questions, I would advise to do your own research on peer-dependency (and maybe we both learn more from it, because I could still be wrong). You could also bring this up in the open source channel on Slack and discuss it with Kidroca because he seems to have a good understanding of how this works (more than me for sure). |
Hey I think I can shine some light into this 1. dev dependencies can't be moved to peerDependenciesTechnically they can but they shouldn't 2. the pipeline for
|
If you don't want to keep the updating the hash across projects, you can define an eslint config (or a base config) in E.g. create a folder module.exports = {
extends: 'expensify-common/eslint/base', //or es6, react etc...
} Or it can be as simple as reusing the config in common module.exports = {
extends: 'expensify-common/eslintrc',
} I know
|
hmmmm 🤔 I think I agree with you that we should add eslint-config as dev dependency everywhere, so they can be independent and we don't have to update common to update the config for the other projects. |
A case for peer dependencies is the dependency to Even though In fact that's how it's advised to write eslint-config packages
|
Actually yeah, if you put it in |
OK, I'd be down with that. Thanks for chiming in @kidroca! Did any of this ever explain why this PR is showing eslint errors when it shouldn't? 😬 |
Ohhh, this PR? Yes, I know, because we never really update the package in this repo it's pointing to a super old version |
@tgolen will you please review this?
Updated markdown regex to avoid nested cases
Fixed Issues
$ Expensify/App
Tests
QA