【发布时间】:2019-02-07 11:19:43
【问题描述】:
我开始使用react-native-animatable。它类似于Animate.css,为 React Native 提供了许多预定义的动画。记住所有不同的动画名称很棘手,我如何在 VSCode 中为不同的动画名称设置自动完成:
该项目有一个definition file。我没有使用 Typescript,但我想自动完成不会介意,对吧?如何设置?
到目前为止我已经尝试过:
我在根目录中添加了一个名为 tsconfig.json 的文件:
{
"allowJs": true,
"compilerOptions": {
"noUnusedLocals": true,
"module": "commonjs",
"noImplicitAny": true,
"removeComments": true,
"preserveConstEnums": true,
"sourceMap": true
},
"files": ["typings/react-native-animatable.d"]
}
我已将第 3 方的定义复制到名为“typings”的目录中。
还是没有运气。
【问题讨论】:
-
由于项目有定义文件,您不需要创建该 tsconfig 文件。您是否获得属性名称的智能感知?您如何在代码中导入
Animatable? -
我使用 import * as Animatable from 'react-native-animatable';
标签: autocomplete visual-studio-code