运行 tsc 时,我得到许多TS2688: Cannot find type definition file for 'someLibrary'
这些库来自node_modules. 我尝试在 tsconfig 中排除node_modules和skipLibCheck,但它们都不适合我。知道为什么会发生这种情况吗?
这是我的 tsconfig.json
{
"ts-node": {
"files": true,
"emit": true,
"compilerHost": true
},
"compilerOptions": {
"experimentalDecorators": true,
"emitDecoratorMetadata": true,
"target": "es2016",
"sourceMap": true,
"typeRoots" : ["./node_modules","./node_modules/@types"],
"jsx": "react",
"allowSyntheticDefaultImports": true,
"skipLibCheck": true,
"esModuleInterop": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "commonJS",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
},
"exclude": [
"node_modules"
]
}
Run Code Online (Sandbox Code Playgroud) 我有这样的事情:
<TextInput
style={{height: 40, borderColor: 'gray', borderWidth: 1}}
value={0}
onChangeText={(input) => this.setState({ value: input })}
/>
Run Code Online (Sandbox Code Playgroud)
但是,加载后输入框总是空的,有什么想法吗?
我有一个带有范围列的模型
#<JobRequirement id: 1, age: 18...30>
Run Code Online (Sandbox Code Playgroud)
我怎样才能JobRequirement使用age: 20?
就像是
JobRequirement.where(age: 20)
Run Code Online (Sandbox Code Playgroud)