【发布时间】:2019-01-17 00:57:40
【问题描述】:
我正在用 React.JS 编写小项目。每次我运行:npm run start,它都会记录:
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
Watching: /Users/John/Projects/myProject/src
Starting the development server...
ts-loader: Using typescript@2.9.2 and /Users/John/Projects/myProject/tsconfig.json
没有为 TypeScript 文件指定有效规则
Compiled successfully!
You can now view book-viewer-test in the browser.
Local: http://localhost:3000/
我已经突出显示了错误所在的行。一切都很好,但我担心当项目变得更大更复杂时它会产生影响。
这是什么警告/错误?我该如何解决?
这是我的 tsconfig.json 文件:
{
"compilerOptions": {
"baseUrl": "./",
"outDir": "build/dist",
"module": "esnext",
"target": "es5",
"lib": ["es7", "dom"],
"sourceMap": true,
"allowJs": true,
"jsx": "react",
"moduleResolution": "node",
"rootDir": "src",
"forceConsistentCasingInFileNames": true,
"noImplicitReturns": true,
"noImplicitThis": true,
"noImplicitAny": true,
"strictNullChecks": true,
"suppressImplicitAnyIndexErrors": true,
"noUnusedLocals": true,
"experimentalDecorators": true
},
"exclude": [
"node_modules",
"build",
"scripts",
"acceptance-tests",
"webpack",
"jest",
"src/setupTests.ts"
]
}
还有 tslint.json 文件:
{
"jsRules": {
"no-empty": true
}
}
感谢您的建议。
【问题讨论】:
标签: javascript json reactjs typescript npm