-
Notifications
You must be signed in to change notification settings - Fork 27.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Unknown property 'jsx' found react/no-unknown-property #40321
Labels
Linting
Related to `next lint` or ESLint with Next.js.
Comments
11 tasks
I could verify this and opened a PR to fix it. For now, you can force |
1 task
ijjk
pushed a commit
that referenced
this issue
Sep 8, 2022
~(PR jsx-eslint/eslint-plugin-react#3377) introduced a change in `eslint-plugin-react@7.31.2` that will now show an error when unknown properties appear on elements. We can opt out of this by overriding the default.~ As discussed internally, we are turning `react/no-unknown-property` off, as it might be confusing even if different props are being used, (eg.: `css` for `emotion`). It's easy to fix https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md#rule-options, but it might not be clear at first glance that Next.js is using `eslint-plugin-react` internally. If the user wants to enforce this rule, they can still add it to their own `rules` config. Fixes #40321, ref: #40269, #38333
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. |
# for free
to subscribe to this conversation on GitHub.
Already have an account?
#.
Verify canary release
Provide environment information
Operating System:
Platform: linux
Arch: x64
Version: Ubuntu 20.04.0 LTS Wed Sep 07 2022 17:34:02 GMT+0100 (West Africa Standard Time)
Binaries:
Node: 16.14.2
npm: 7.17.0
Yarn: 1.22.10
pnpm: 7.9.5
Relevant packages:
next: 12.2.6-canary.10
eslint-config-next: 12.2.5
react: 17.0.1
react-dom: 17.0.1
What browser are you using? (if relevant)
Chrome 105 on Windows 10
How are you deploying your application? (if relevant)
Vercel
Describe the Bug
I created some components using the next-js styled-jsx <style jsx> worked fine on
v11
of next-js, but after upgrading tov12
I get an error when usingyarn lint
oryarn build
with the message:For clarity, I have reproduced this on - stackblitz - run
yarn lint or yarn build
to see the error.Expected Behavior
Next-js shouldn't throw an error because on default it supports styled components. In other words, this -
<style jsx></style>
should be recognized as valid.Link to reproduction
https://stackblitz.com/edit/nextjs-syp4l9?file=pages/index.js
To Reproduce
Spin up a next js app the usual way:
your package.json should look like so below, ensure you are on at least next-js
version 12
Create a sample component like below in
pages/index.js
in terminal run
next build
ornext lint
next-js should throw an errorEither way, you can't build to production because the error breaks the build process.
The text was updated successfully, but these errors were encountered: