Closed zebra0303 closed 2 months ago
I never tried but using https://github.com/ArnaudBarre/eslint-plugin-react-refresh?tab=readme-ov-file#allowexportnames-v044 with ["getServerSideProps"]
should works?
I never tried but using https://github.com/ArnaudBarre/eslint-plugin-react-refresh?tab=readme-ov-file#allowexportnames-v044 with
["getServerSideProps"]
should works?
@ArnaudBarre, Thanks for your reply. It works fine after I changed the plugin options as below.
'react-refresh/only-export-components': [
'warn',
{
allowConstantExport: true,
allowExportNames: ['getServerSideProps'],
},
],
Hello, I'm trying to use the eslint-plugin-react-refresh rule for a team project. However, an eslint error occurs even when exporting getServerSideProps in the page component of Next.js. Is there anyone who has solved this issue or knows a solution without creating a new getServerSideProps function file?
[package.json]
[ESLint Config]
[Page Code Sample]