-
Notifications
You must be signed in to change notification settings - Fork 57
Support for React-Native specific properties #58
Comments
This is now possible using the css-language-service api: microsoft/vscode-css-languageservice#111 This plugin can automatically contribute a list of valid react-native style properties. PRs welcome. Let me know if you have any questions about implementing this |
More than happy to help here. @mjbvz Is there a guide on how to add these properties? |
Pass a list of |
After inspecting source code of the plugin, I managed to find a working solution. Edit your {
"compilerOptions": {
"plugins": [
{
"name": "typescript-styled-plugin",
"lint": {
"validProperties": "shadow-color,shadow-opacity,shadow-offset"
}
}
]
}
} Maybe it helps. |
Any news on this ? |
Workaround provided by @lidonghua kind of works, does anyone have an exhaustive list of react-native specific properties to use until these become supported? |
@kallaspriit You can add |
@kallaspriit so far I have: |
This works for me:
notice |
Now how do you disallow properties which are not supported by RN, e.g. |
Could someone please submit a PR that documents |
So I have this warning too in VSCode: I set up a Any idea ? I updated the properties for those in needs
|
If your project isn't using TypeScript, create a Sample {
"compilerOptions": {
"plugins": [
{
"name": "typescript-styled-plugin",
"lint": {
"validProperties": [
"aspect-ratio",
"elevation",
"margin-vertical",
"margin-horizontal",
"padding-horizontal",
"padding-vertical",
"resize-mode",
"shadow-color",
"shadow-opacity",
"shadow-offset",
"shadow-radius",
"text-align-vertical",
"tint-color"
]
}
}
]
}
} |
Hey all. This issue was super helpful to fix missing My next question... I can put the list together but not sure if there's a place to put it. 😃 |
You can also disable the warnings for unknown properties (at your own risk of losing some intellisense) adding in your "compilerOptions": {
"plugins": [
{
"name": "typescript-styled-plugin",
"lint": {
"unknownProperties": "ignore" // "ignore" | "warning" | "error"
}
}
]
} Referring the official documentation: https://github.com/microsoft/typescript-styled-plugin#unknownproperties |
Any updates on this? |
This is the list I'm using.
|
Been 4 years. Are there any plans to add this to the official distribution config? |
@mjbvz Ok, since I'm also having this problem with I'm not sure if I'm doing this contribution correctly, but I opened a PR over here, only for the standard |
Closing as this package has been deprecated in favor of the official styled-components/typescript-styled-plugin fork After updating to that fork, follow up in the styled-components repo if this is still an issue |
There are several CSS properties that are specific to React-Native that are supported by
styled-components/native
. For example the following properties are part of React-Native but appear as errors when using this plugin:Would React-Native specific properties be something to consider supporting?
The text was updated successfully, but these errors were encountered: