"No valid rules have been specified for JavaScript files" 是什么意思?

What does "No valid rules have been specified for JavaScript files" mean?

我有一个 React - Typescript 是用以下方法创建的:

create-react-app my-app --scripts-version=react-scripts-ts

它编译正常,但每次我看到这条消息或警告:

No valid rules have been specified for JavaScript files

有什么办法可以摆脱它吗?

> react-scripts-ts build

Creating an optimized production build...
Starting type checking and linting service...
Using 1 worker with 2048MB memory limit
ts-loader: Using typescript@2.8.3 and /Users/julian/my-app/tsconfig.json
No valid rules have been specified for JavaScript files
Compiled successfully.

我的 tscongif.json 和 tslint.json 文件可以在这里找到:https://gist.github.com/JulianG/be82d9fa20f48f60ce10371fa5095230

看完https://github.com/palantir/tslint/issues/3735#issuecomment-383115457我发现了以下内容:

因为我的 tsconfig.json 包含 "allowJs": true,我的 tslint.json 中需要一个 jsRules 密钥。

解决方案是简单地向 tslint.json 添加一个规则,如下所示:

    "jsRules": {
      "no-empty": true
    }

感谢@explosion-pills 指出答案。