5π
β
The .eslintcache
file is created from ESLintβs --cache
flag, which is included in the default linter command of lint-staged
:
// package.json
{
"lint-staged": { π
"*.{vue,js,jsx,cjs,mjs}": "eslint --cache --fix",
"*.{js,css,md}": "prettier --write"
}
}
You can either remove the --cache
flag:
// package.json
{
"lint-staged": {
"*.{vue,js,jsx,cjs,mjs}": "eslint --fix",
"*.{js,css,md}": "prettier --write"
}
}
β¦or set the cache file location with the --cache-location
flag (e.g., specify node_modules/.cache
):
// package.json
{
"lint-staged": { π
"*.{vue,js,jsx,cjs,mjs}": "eslint --cache --fix --cache-location ./node_modules/.cache/.eslintcache",
"*.{js,css,md}": "prettier --write"
}
}
π€tony19
Source:stackexchange.com