【发布时间】:2021-09-07 03:14:10
【问题描述】:
我是 vim 的新手。我只是想用 react 检查我的配置,因为我使用 typescript 和 react,所以我尝试创建一个简单的演示应用程序,所以我运行了 npx create-react-app demo --template typescript。
之后,我在目录中运行了nvim .,但是当我选择任何组件时,我得到了这个警告:
除非提供了 '--jsx' 标志,否则不能使用 JSX。 (修复)
即使在 tsconfig.json 文件中指定了
tsconfig.json 文件:
{
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noFallthroughCasesInSwitch": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
},
"include": [
"src"
]
}
我确实安装了一个 TS 插件,但我不知道为什么会发生这种情况
这是我到目前为止的 vim 配置 ez-config,我使用 :help nvim-from-vim 让 nvim 从文件中加载配置
【问题讨论】:
标签: reactjs typescript neovim