0

Typescript is failing to compile, in a create-react-app project with Typescript config. I wanna to typescript ignore one file (or all files .js), but it isn't happening.

I already tried:

  • "ignorePatterns": ["**/*.js"] at eslintrc
  • Set the erros as warns at eslintrc
  • "exclude": ["**/*.js"] at tsconfig
  • @ts-nocheck at the file I wanna ignore
  • *.js at eslintignore
  • "allowJs": true, "skipLibCheck": true, "checkJs": false at tsconfig

Errors (maybe eslint errors?): no-unused-expressions, no-undef

How do I make Typescript / ESLint ignore .js files on compile?

Error

2 Answers2

0

these are eslint errors.

You can turn them into warnings in order to eslint let you build, to fix them later.

See (I did not tried myself, if it's too old then try the eslint documentation) : this question

Romka
  • 144
  • 8
  • Thanks for your answer Romka! :) I already tried this, but it still don't working. –  Aug 19 '20 at 18:22
0

I managed to solve this adding the code bellow at the begging of the file, unfortunately .eslintignore still don't working.

/* eslint no-unused-expressions: 0 */
/* eslint no-restricted-globals: 0 */
/* eslint no-undef: 0 */