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.

updating .eslintrc doesn't invalidate the cache

See original GitHub issue

Expected Behavior

Updating linting rules/config should invalidate linting cache.

Current Behavior

When running eslint it’ll show the cached output even though .eslintrc (workspace root) was changed.

❯ nx lint akita

> nx run akita:lint 

>  NX   NOTE  Cached Output:

Linting "akita"...

Failure Information (for bugs)

Steps to Reproduce

I’m not sure when the cache kicks in, but once it does you can reproduce this.

  1. nx lint stuff
  2. watch cache kick in
  3. add a new rule to the rules section in the root .eslintrc
  4. nx lint stuff
  5. observe the previous cached and now invalid response

Context

>  NX  Report complete - copy this into the issue template

  @nrwl/angular : 9.2.2
  @nrwl/cli : 9.2.2
  @nrwl/cypress : 9.2.2
  @nrwl/eslint-plugin-nx : 9.2.2
  @nrwl/express : 9.2.2
  @nrwl/jest : 9.2.2
  @nrwl/linter : 9.2.2
  @nrwl/nest : Not Found
  @nrwl/next : Not Found
  @nrwl/node : 9.2.2
  @nrwl/react : 9.2.2
  @nrwl/schematics : Not Found
  @nrwl/tao : 9.2.2
  @nrwl/web : 9.2.2
  @nrwl/workspace : 9.2.2
  typescript : 3.8.3

“eslint”: “6.8.0”, “@typescript-eslint/eslint-plugin”: “2.28.0”, “@typescript-eslint/parser”: “2.28.0”,

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
vsavkincommented, May 29, 2020

Sorry. The issue was marked by mistake. I removed the label.

1reaction
rarmateicommented, Apr 15, 2020

adding "runtimeCacheInputs": ["echo .eslintrc"] doesn’t help.

After adding it I ran linting until it gave me the cached output, then I changed a rule from “off” to “warn” and ran linting again nx lint <project> but I still got the cached output

yes, I did remember to save the file 😃

Can you please try cat .eslintrc instead of echo ? Echo will print out the file name, but we want to print out the contents, so it invalidates the cache when they change (as Jack mentioned)

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cache invalidation - Sitefinity CMS Setup and maintenance
Cache is invalidated when item of a particular type with provided custom key is created, updated, or deleted. Under the hood DataItemCacheDependency works...
Read more >
Invalidation from Mutations | TanStack Query Docs
Usually when a mutation in your app succeeds, it's VERY likely that there are related queries in your application that need to be...
Read more >
Discussion of Cache Busting a React App - DEV Community ‍ ‍
My understanding is EVEN with a refresh, some applications are cached, hence various solutions used to invalidate cache. In my react app, if...
Read more >
Gajus on Twitter: "TIL that #eslint --cache is _not_ enabled by ...
My guess is because it is not particularly smart, e.g. changing .eslintrc will not invalidate cache. It would only be a safe default...
Read more >
eslint | Yarn - Package Manager
Make sure your plugins (and ESLint) are both in your project's package.json as devDependencies (or dependencies, if your project uses ESLint at runtime)....
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