Skip to content
This repository has been archived by the owner on Feb 18, 2024. It is now read-only.

Commit

Permalink
preact: Enable eslint-plugin-react if using ESLint
Browse files Browse the repository at this point in the history
`@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.
  • Loading branch information
edmorley committed Apr 27, 2018
1 parent b77da34 commit b552e40
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion packages/preact/index.js
Expand Up @@ -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'
}
}
}
});
});
};

0 comments on commit b552e40

Please sign in to comment.