How to use eslint to format code

I am configuring eslint for the project, but encountered difficulties. The main issue is that most of the code in strapi is automatically generated. Even if I try to automatically format the code in commit hook, every time I start the project, the code will be regenerated and does not follow eslint rules. This causes git to show many modified files. I have searched for solutions but did not find relevant information. Is there any good solution🙏?