获取 VSCode 智能感知以在编辑样式组件时仅显示 React Native 属性?

Gol*_*Jer 7 react-native visual-studio-code styled-components

在 VSCode 中,当在 React Native 项目中使用 Styled-Components 时,我们可以通过创建一个js/tsconfig.json包含以下内容的文件来添加缺少的自动完成属性。

{
  "compilerOptions": {
    "plugins": [
      {
        "NOTE": "https://github.com/microsoft/typescript-styled-plugin/issues/58",
        "name": "typescript-styled-plugin",
        "lint": {
          "validProperties": [
            "aspect-ratio",
            "box-shadow",
            "elevation",
            "margin-vertical",
            "margin-horizontal",
            "padding-horizontal",
            "padding-vertical",
            "resize-mode",
            "shadow-color",
            "shadow-opacity",
            "shadow-offset",
            "shadow-radius",
            "text-align-vertical",
            "tint-color"
          ]
        }
      }
    ]
  }
}

Run Code Online (Sandbox Code Playgroud)

这修复了使用 React Native 特定属性时的 linting 错误。

但是自动完成仍然充满了仅限网络的属性。

React Native 项目中的 web css 属性

我不时发现自己在 React Native 项目中不小心使用了这些 Web 属性之一。我希望自动完成只显示有效的 React Native 属性。

如何?