Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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 [email protected] 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

like image 280
JulianG Avatar asked Jan 29 '23 01:01

JulianG


1 Answers

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.

like image 79
JulianG Avatar answered Jan 30 '23 15:01

JulianG