Skip to content

Commit 0e344fe

Browse files
committed
Rules Dir
1 parent a4d21a4 commit 0e344fe

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

scripts/eject.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,12 @@ prompt('Are you sure you want to eject? This action is permanent. [y/N]', functi
104104
});
105105
delete hostPackage.scripts['eject'];
106106

107+
// explicitly specify ESLint config path for editor plugins
108+
hostPackage.eslintConfig = {
109+
extends: './config/eslint.js',
110+
rulesdir: './config/rules',
111+
};
112+
107113
console.log('Writing package.json');
108114
fs.writeFileSync(
109115
path.join(hostPath, 'package.json'),

scripts/init.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,12 @@ module.exports = function(hostPath, appName, verbose) {
2929
hostPackage.scripts[command] = 'react-scripts ' + command;
3030
});
3131

32+
// explicitly specify ESLint config path for editor plugins
33+
hostPackage.eslintConfig = {
34+
extends: './node_modules/react-scripts/config/eslint.js',
35+
rulesdir: './config/rules',
36+
};
37+
3238
fs.writeFileSync(
3339
path.join(hostPath, 'package.json'),
3440
JSON.stringify(hostPackage, null, 2)

0 commit comments

Comments
 (0)