Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
OKinane opened this issue Oct 14, 2021 · 1 comment · Fixed by #29928
Closed

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

OKinane opened this issue Oct 14, 2021 · 1 comment · Fixed by #29928
Labels
bug Issue was opened via the bug report template.

Comments

@OKinane
Copy link
Contributor

OKinane commented Oct 14, 2021

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.
@OKinane OKinane added the bug Issue was opened via the bug report template. label Oct 14, 2021
styfle added a commit that referenced this issue Nov 8, 2021
* fix: support --cache-strategy ESLint argument

* add integration tests for --cache-strategy

* fix: add cacheStrategy to eslintOptions

* minor adjustments in next lint help message for --cache-strategy

Co-authored-by: Steven <steven@ceriously.com>
@balazsorban44
Copy link
Member

This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@vercel vercel locked as resolved and limited conversation to collaborators Jan 27, 2022
natew pushed a commit to natew/next.js that referenced this issue Feb 16, 2022
…ercel#29928)

* fix: support --cache-strategy ESLint argument

* add integration tests for --cache-strategy

* fix: add cacheStrategy to eslintOptions

* minor adjustments in next lint help message for --cache-strategy

Co-authored-by: Steven <steven@ceriously.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants