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 randomly started enforcing new rule which is incorrect and breaking my builds #40245

Closed
1 task done
tr1s opened this issue Sep 6, 2022 · 8 comments · Fixed by #40246
Closed
1 task done

ESLint randomly started enforcing new rule which is incorrect and breaking my builds #40245

tr1s opened this issue Sep 6, 2022 · 8 comments · Fixed by #40246
Labels
bug Issue was opened via the bug report template. Linting Related to `next lint` or ESLint with Next.js. Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).

Comments

@tr1s
Copy link

tr1s commented Sep 6, 2022

Verify canary release

  • I verified that the issue exists in the latest Next.js canary release

Provide environment information

Node version: v16.15.1
npm version: 8.19.0
Local ESLint version: 8.23.0
Global ESLint version: N/A
Operating System: macOS Big Sur / M1 Mac

What browser are you using? (if relevant)

N/A

How are you deploying your application? (if relevant)

Vercel

Describe the Bug

ESLint is enforcing a rule which is breaking my build.

File Vercel Build Error
ESLint_ERRORS ESLint-ERRORS-2

I went through my old vercel builds and found where it stopped working—I updated some packages and that was it. I just tried to revert back to all the old package versions where the builds were working fine and I still am getting the errors now.

I'm not sure why ESLint decided to enforce this rule randomly or why it's throwing an error even though it's a real property. I know I can ignore it with next.js configs but I'm instead trying to figure out what's happening here.

I also have an identical personal portfolio project with the same setup code and up-to-date packages in which I'm not having this issue. I can't understand why it's only happening on this repo.

If you have any ideas as to what's happening please let me know, thank you.

I have made an issue over at ESLint's repo too as I'm not sure which would be more appropriate.

Expected Behavior

Builds should pass.

Link to reproduction

https://github.com/tr1s/nightizm

To Reproduce

Run npm run lint and see that these errors are showing up. They shouldn't be showing up at all.

@tr1s tr1s added the bug Issue was opened via the bug report template. label Sep 6, 2022
@RareSecond
Copy link
Contributor

We've been getting the exact same issue
image

A workaround on our end was updating eslint-plugin-react, but this shouldn't be necessary since it's a dependency of eslint-config-next, so this should be handled in that package.

@ljharb
Copy link

ljharb commented Sep 6, 2022

See my comments on the eslint issue; this should be closed as it's an issue with eslint-plugin-react (which has been fixed). See jsx-eslint/eslint-plugin-react#3380.

eslint-config-next surely uses ^ so it's 100% fine for you to have to update eslint-plugin-react.

@RareSecond
Copy link
Contributor

@ljharb this shouldn't be closed, as eslint-plugin-react is a dependency of eslint-config-next and is currently not a direct dependency of our project. Next should update the version range to not include the broken dependency.

@tr1s
Copy link
Author

tr1s commented Sep 6, 2022

yeah @JDansercoer @ljharb looks like esling-config-next is using the old version of eslint-plugin-react:

CleanShot 2022-09-06 at 01 56 27@2x

I will keep the issue open until my eslint-config-next get's updated. It's currently 12.2.5 and 12.2.6 is in canary still (assuming this update will have the correctly updated package).

@ljharb
Copy link

ljharb commented Sep 6, 2022

That’s not how transitive deps work.

The next config is using ^ to depend on the react plugin, so you already updated it beyond v7.29.4, just not far enough to include the fixed version. It’s on you to update it farther.

@icyJoseph
Copy link
Contributor

What should be done about #40269, which flags styled-jsx tags, <style jsx>.

@balazsorban44
Copy link
Member

As @ljharb suggests, this is not a Next.js issue, so I'll close it. You just have to make sure that your dependencies are up-to-date.

As for jsx on style @icyJoseph, it's a special property allowed by Next.js, so a separate issue is needed, which has been opened already here #40321, and a PR fixing that issue can be found here #40331

@balazsorban44 balazsorban44 added Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.). Linting Related to `next lint` or ESLint with Next.js. labels Sep 8, 2022
kodiakhq bot pushed a commit that referenced this issue Sep 13, 2022
`eslint-plugin-react` has a broken version between v7.31.2-6. Upping the version range ensure that only functioning packages get installed.

Fixes #40245



## Bug

- [x] Related issues linked using `fixes #number`
- [ ] Integration tests added
- [ ] Errors have helpful link attached, see `contributing.md`


Co-authored-by: JJ Kasper <[email protected]>
@github-actions
Copy link
Contributor

github-actions bot commented Oct 8, 2022

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 8, 2022
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. Linting Related to `next lint` or ESLint with Next.js. Upstream Related to using Next.js with a third-party dependency. (e.g., React, UI/icon libraries, etc.).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants