Skip to content

Eslint's --cache-strategy argument is not supported #29926

@OKinane

Description

@OKinane

What version of Next.js are you using?

11.1.2

What version of Node.js are you using?

14.16.1

What browser are you using?

Chrome

What operating system are you using?

Windows 10

How are you deploying your application?

next start

Describe the Bug

--cache-strategy is an argument introduced in ESLint v7.21.0, which can be set to either content or metadata. Before its addition, the default behavior was metadata, which doesn't help in CI context where the repository is cloned every time (the modification date of all the files are is to the clone time).
Using the content value for the argument, we can have an ESLint cache that works in CI.

Unfortunately, next doesn't support this argument yet, ie we can't pass it down to ESLint through next lint.

Expected Behavior

No error when using --cache-strategy argument

To Reproduce

Run in project root:

> yarn run next lint --cache --cache-strategy content --cache-location .cicache/eslint/.cache.json

Output:

yarn run v1.22.10
$ Path\to\project\node_modules\.bin\next lint --cache --cache-strategy content --cache-location .cicache/eslint/.cache.json
Unknown or unexpected option: --cache-strategy
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIssue was opened via the bug report template.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy