question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Flag --cache does not work in --stdin mode

See original GitHub issue

Tell 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:closed
  • Created 3 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
utrumocommented, Sep 4, 2020

I solved my eslint performance problem - began to use eslint_d npm package, now eslint works extremely fast.

1reaction
mdjermanoviccommented, Aug 19, 2020

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 file mtime .

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why is reading lines from stdin much slower in C++ than ...
The problem is synchronization with stdio -- see my answer. Since nobody seems to have mentioned why you get an extra line with...
Read more >
Command Line Interface - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >
Variant Effect Predictor Running VEP - Ensembl
If not specified, VEP will attempt to read from STDIN. ... in offline mode (--offline), and optional with some performance increase in cache...
Read more >
11.2 dd : Convert and copy a file - GNU.org
When reading from standard input or writing to standard output, the ' nofollow ' and ' noctty ' flags should not be specified,...
Read more >
sys — System-specific parameters and functions — Python ...
They are not suitable for implementing a “sandbox”. In particular, malicious code can trivially disable or bypass hooks added using this function.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found