Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

509
Visualizações
How to delete .eslintcache file in react?

I'm new to React. I have a problem I can not solve. I have an ".eslintcache" file, which was created for me automatically as soon as I created a new app in React using "create-react-app". I do not know why I have this file. I tried to delete it but it always comes back. I ran this command - "npm uninstall -g eslint --save" - to delete eslint's directory but it does not help. I do not know how to handle it, I did not find a solution to it, I would be happy to help.

enter image description here

over 4 years ago · Santiago Trujillo
6 Respostas
Responde à pergunta

0

This is part of the new version in react. I also had files "reportWebVitals" and "setupTests", I deleted them and everything works properly.

With "reportWebVitals" you can track real user performance on your site. And with "setupTests" you are Initializing Test Environment

this feature is available with react-scripts@4.0.0 and higher

I do not need these properties, just deleted them and that's it, the eslintcache can not be deleted is part of the bundle.

over 4 years ago · Santiago Trujillo Relatório

0

It seems as new issue in React App (this issue opened on Nov 27, 2020)

Put .eslintcache in .gitignore also do:

git rm -rf --cached .eslintcache
git add .

git rm: remove files from working tree ...

-r: recursive removal in case of a directory name ...

-f or -force: Override the up-to-date check.

Details: https://git-scm.com/docs/git-rm

over 4 years ago · Santiago Trujillo Relatório

0

This file is part of the new version of create-react-app package, you can't avoid it to be added, just like other files being added. This is the bundle.

over 4 years ago · Santiago Trujillo Relatório

0

It is part of the CRA bundle. I'd recommend just adding it to the .gitignore file if it isn't in there already.

From the ESLint docs:

Store the info about processed files in order to only operate on the changed ones. The cache is stored in .eslintcache by default. Enabling this option can dramatically improve ESLint's running time by ensuring that only changed files are linted.

over 4 years ago · Santiago Trujillo Relatório

0

I faced the problem, tried putting .eslintcache in .gitignore and implement the command git add . but was not enough, because you should do git add . after every change in your code, and that's not sence at all of course, this is not a clean workround anyway.

So, simply i downgraded the react-scripts to @4.0.0, and that problem disapeared completely I think the react-scripts@4+ isn't stable yet

over 4 years ago · Santiago Trujillo Relatório

0

I ended up writing a custom plugin to delete the .eslintcache before each watch compile:

var exec = require("child_process").execSync;

module.exports = class ESLintClearPlugin {
  constructor(options) {
    this.options = options;
  }
  apply(compiler) {
    compiler.hooks.watchRun.tap("ESLintClearPlugin", () => {
      exec("del .eslintcache");
    });
  }
};

Then you use it in your webpack config:

const ESLintClearPlugin = require("./pathtofile");
// webpack config    
plugins: [new ESLintClearPlugin()]
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda