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

让人想犯罪 __ 提交于 2019-12-12 13:20:35

问题


I have a React - Typescript created with:

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

It compiles fine, but every time I see this message or warning:

No valid rules have been specified for JavaScript files

Any ideas how to get rid of it?

> 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.

My tscongif.json and tslint.json files can be found here: https://gist.github.com/JulianG/be82d9fa20f48f60ce10371fa5095230


回答1:


After reading https://github.com/palantir/tslint/issues/3735#issuecomment-383115457 I found the following:

Because my tsconfig.json contained "allowJs": true, a jsRules key was needed in my tslint.json.

The solution was to simply add a rule to tslint.json like this:

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

Thanks to @explosion-pills for point to the answer.



来源:https://stackoverflow.com/questions/50518306/what-does-no-valid-rules-have-been-specified-for-javascript-files-mean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!