From 0e344feeb7783ede0dd3bd74fceab44fbb4214d3 Mon Sep 17 00:00:00 2001 From: case Date: Sat, 30 Jul 2016 13:57:22 -0700 Subject: [PATCH] Rules Dir --- scripts/eject.js | 6 ++++++ scripts/init.js | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/scripts/eject.js b/scripts/eject.js index c8c32505406..856aa0c3954 100644 --- a/scripts/eject.js +++ b/scripts/eject.js @@ -104,6 +104,12 @@ 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', + rulesdir: './config/rules', + }; + console.log('Writing package.json'); fs.writeFileSync( path.join(hostPath, 'package.json'), diff --git a/scripts/init.js b/scripts/init.js index be5d58b158f..1564e93b0c4 100644 --- a/scripts/init.js +++ b/scripts/init.js @@ -29,6 +29,12 @@ 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', + rulesdir: './config/rules', + }; + fs.writeFileSync( path.join(hostPath, 'package.json'), JSON.stringify(hostPackage, null, 2)