From 76935de8e20a8c4786b4d0861654afe1099b124e Mon Sep 17 00:00:00 2001 From: Keyan Zhang Date: Sun, 24 Jul 2016 14:19:58 -0700 Subject: [PATCH] Explicitly specify ESLint config path for editor plugins in package.json (#149) * explicitly specify ESLint config path for editor plugins * changed to use single quote --- scripts/eject.js | 5 +++++ scripts/init.js | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/scripts/eject.js b/scripts/eject.js index c8c3250540..efdff07400 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 be5d58b158..4837174541 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)