Next.js Discord

Discord Forum

Nextjs Eslint React Compiler

Answered
Jboncz posted this in #help-forum
Open in Discord
I have not tried to extend eslint within nextjs before, has anyone gotten the eslint react compiler rules setup properly in nextjs?


https://react.dev/learn/react-compiler#installing-eslint-plugin-react-compiler
https://nextjs.org/docs/app/building-your-application/configuring/eslint#additional-configurations
Answered by Jboncz
npm install eslint-plugin-react-compiler --save-dev

.eslintrc.json
{
  "extends": "next/core-web-vitals",
  "plugins": [
    "@next/next",
    "react-compiler"
  ],
  "rules": {
    "react-compiler/react-compiler": "error"
  }
}


Seems to have done the trick. Ill leave this open for a few hours to make sure no one has any input on how i did it.
View full answer

1 Reply

npm install eslint-plugin-react-compiler --save-dev

.eslintrc.json
{
  "extends": "next/core-web-vitals",
  "plugins": [
    "@next/next",
    "react-compiler"
  ],
  "rules": {
    "react-compiler/react-compiler": "error"
  }
}


Seems to have done the trick. Ill leave this open for a few hours to make sure no one has any input on how i did it.
Answer