Home >Web Front-end >Front-end Q&A >How to turn off eslint in react
Method: 1. Use "npm run eject" to copy all dependency files and corresponding dependencies to the project; 2. Modify the code of the ""eslintConfig"" project in "package.json"; 3. If Dependencies are missing and you need to reinstall them. Just use "npm start" to restart the project.
The operating environment of this tutorial: Windows 10 system, react17.0.1 version, Dell G3 computer.
The first step: npm run eject
npm run eject
npm run eject will copy all dependent files and corresponding dependencies (webpack , babel, etc.) to your project. It is a one-way operation. Once ejected, the operation of npm run eject is irreversible
Step 2: Modify the code in package.json
"eslintConfig": { "extends": "react-app", "rules": { "no-undef": "off", "no-restricted-globals": "off", "no-unused-vars": "off" } }
Step 3: Restart the project
npm start
If there are missing dependencies, then you need to reinstall the dependencies.
Recommended learning: "react video tutorial"
The above is the detailed content of How to turn off eslint in react. For more information, please follow other related articles on the PHP Chinese website!