'lint-staged generates new .eslintcache file on commit

I'm creating a new Vue project via npm init vue@latest and select everything (Eslint with Prettier)

I'm using the following setup

  • OS: Win11
  • node: v17.4
  • npm: v8.4

I setup lint-staged via npx mrm@2 lint-staged. For testing purposes I add a new file inside the src directory

// calc.js

function 
add
(numOne, 
  numTwo) {
  return numOne + 
  
              numTwo;
}

When committing the new file the linter fixes the code style as expected. But after that I manually have to delete a generated .eslintcache file.

Older posts say I should add

*.eslintcache

to the .gitignore file. But I compared the generated .gitignore file with the generated one from the Vue CLI and both don't have this line. When using the Vue CLI the cache file doesn't appear.

So are there any other solutions or is there something I missed?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source