-
Notifications
You must be signed in to change notification settings - Fork 3
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
[Feature Request] Replace on match, but prepend others #28
Comments
Hey @daymxn , First off, thanks for filing such a clear issue and proposal. This is a great idea. To me, it has a "upsert/compare if match" vibe. You also caught me at a pretty good time: I'm converting a lot of my older repos to typescript so I can maintain them a little better. I do always offer the issue filer to create their own MR, but if not: I like this idea and want to do this within the next 2-4 weeks. Let me know if that works for you. Best, |
Hey! That's great to hear! I'd be open to creating a PR/MR for it, but it may be worth doing the typescript migration first- as that'd make adding the feature easier. It'd also make the typescript migration less painful. If you haven't already started, I could also create a PR for converting the repo to TS? I already have a branch with most of the migration done anyhow- but if you've already got your own WIP branch, then I can hold off on it :) |
Hey @daymxn, |
Hey @daymxn, did you get my email? And if not, is there another email other than |
If there's an existing header that isn't correct, but is of the same type, then I'd like to update the header. But if there's a header that is not the same type, then I'd like to prepend or append- depending on the context.
Example
Given the file:
I'd like to only update the year, while preserving the eslint pragma:
Edge case
If the string isn't a pragma, and there's a license missing, then ideally the license would be prepended to the start of the file.
For example:
Would become:
Proposal
This may be leading into "too complex of a use-case" territory, but a possible solution could be having support for multiple
onNonMatchingHeader
with configurable regex and tolerance.The text was updated successfully, but these errors were encountered: