From f9a2d2745f4715ed764b5501b35a5dde54c198b3 Mon Sep 17 00:00:00 2001 From: Ed Morley <501702+edmorley@users.noreply.github.com> Date: Fri, 27 Apr 2018 22:10:38 +0100 Subject: [PATCH] preact: Enable eslint-plugin-react if using ESLint `@neutrinojs/preact` already had a dependency on `eslint-plugin-react`, but wasn't actually using it. Now the React ESLint plugin is enabled if an ESLint configuration is found - the same as for the React preset. This will make it easier for Preact users to realise what changes they need to make, now that we're not using `babel-plugin-jsx-pragmatic`. Fixes #821. --- packages/preact/index.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/packages/preact/index.js b/packages/preact/index.js index 08d43885c..a0a403c9d 100644 --- a/packages/preact/index.js +++ b/packages/preact/index.js @@ -43,7 +43,14 @@ module.exports = (neutrino, opts = {}) => { neutrino.config.when(neutrino.config.module.rules.has('lint'), () => { neutrino.use(loaderMerge('lint', 'eslint'), { - // TODO: Enable the React ESLint plugin + plugins: ['react'], + baseConfig: { + settings: { + react: { + pragma: 'h' + } + } + } }); }); };