diff --git a/scripts/eject.js b/scripts/eject.js index c8c32505406..efdff07400c 100644 --- a/scripts/eject.js +++ b/scripts/eject.js @@ -104,6 +104,11 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi }); delete hostPackage.scripts['eject']; + // explicitly specify ESLint config path for editor plugins + hostPackage.eslintConfig = { + extends: './config/eslint.js', + }; + console.log('Writing package.json'); fs.writeFileSync( path.join(hostPath, 'package.json'), diff --git a/scripts/init.js b/scripts/init.js index be5d58b158f..48371745416 100644 --- a/scripts/init.js +++ b/scripts/init.js @@ -29,6 +29,11 @@ module.exports = function(hostPath, appName, verbose) { hostPackage.scripts[command] = 'react-scripts ' + command; }); + // explicitly specify ESLint config path for editor plugins + hostPackage.eslintConfig = { + extends: './node_modules/react-scripts/config/eslint.js', + }; + fs.writeFileSync( path.join(hostPath, 'package.json'), JSON.stringify(hostPackage, null, 2)