Flag --cache does not work in --stdin mode
See original GitHub issueTell us about your environment
Node version: v14.8.0 npm version: v6.14.5 Local ESLint version: v7.7.0 (Currently used) Global ESLint version: Not found
- ESLint Version:
- Node Version:
- npm Version:
What parser (default, Babel-ESLint, etc.) are you using? babel-eslint Please show your full configuration:
Configuration
---
root: true
env:
browser: true
node: false
parser: babel-eslint
extends:
- airbnb
- airbnb/hooks
rules:
no-unused-vars:
- error
- args: after-used
argsIgnorePattern: ^_
no-underscore-dangle:
- off
react/jsx-props-no-spreading:
- off
react/jsx-fragments:
- off
camelcase:
- off
react/jsx-filename-extension:
- off
no-restricted-syntax:
- off
jsx-a11y/label-has-associated-control:
- error
- labelComponents:
- label
controlComponents:
- textarea
- output
settings:
import/resolver: webpack
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
I use eslint with neovim and coc-diagnostic plugin. It work with stdin mode. https://github.com/iamcco/coc-diagnostic/blob/301fd84a657594f22f751532bed9f78774919a13/src/config.ts#L12
In this mode, eslint --cache flag does not work and linting is very slow.
cat ./MyComponent.jsx | npx eslint --stdin --stdin-filename MyComponent.jsx --cache --cache-location /tmp/eslint-cache/
What did you expect to happen? That the --cache key works in stdin mode and and the cache file is created and used
What actually happened? Please include the actual, raw output from ESLint. Cache file is not created and not used, linting takes a lot of time any time /home/user/Projects/work/workProject/src/components/Datepicker/Datepicker.jsx 134:5 error Arrow function expected no return value consistent-return
✖ 1 problem (1 error, 0 warnings)
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (4 by maintainers)
Top GitHub Comments
I solved my eslint performance problem - began to use eslint_d npm package, now eslint works extremely fast.
Hi @utrumo, thanks for the issue!
ESLint’s caching doesn’t work in
--stdin
mode. Cache is only used when executing on files, and it’s based on filemtime
.Can you add –debug flag to see if something particular takes a lot of time. You can also set TIMING environment variable to see the ten longest-running rules.