-
Notifications
You must be signed in to change notification settings - Fork 34
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
jQuery's extend method ($.extend) is treated as a styled component #33
Comments
Thank you for reporting @evankim390 ! |
LGTM, thank you! |
The fix is in version 1.3.0 has been published. |
I am running into the exact same issue with Backbone views such as this one: MyView.extend({
...
}) produces
Edit: Put up a preliminary PR here - #47. |
Hi Igor, thanks for creating this package - overall it works great and the code is well written.
I'm trying to use this in my team's project, but I noticed that instances of jQuery's
$.extend
are treated as styled components and get expanded to$.extend.withConfig
. I believe this is due to theisValidComponentName
method increateTransformer.ts
, which checks eligibility based on whether the first letter of the component name is a capital one. In my case,'$' === '$'.toUpperCase()
which is causing the issue. To verify, I changed theisValidComponentName
method toreturn name[0] === name[0].toUpperCase() && name !== "$";
, which fixes the problem, but isn't a great solution. This will also be problematic in other popular libraries with a single character namespace like lodash_.extend
.I'm not sure what direction you'd like to take here, but one choice is to have a new option
identifierExcludes
which takes an array of identifiers to ignore.What are your thoughts? Happy to work with you to get a patch in if you're short on time.
The text was updated successfully, but these errors were encountered: