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

Stop using babel-plugin-jsx-pragmatic #827

Merged
merged 2 commits into from
Apr 27, 2018
Merged

Stop using babel-plugin-jsx-pragmatic #827

merged 2 commits into from
Apr 27, 2018

Conversation

edmorley
Copy link
Member

@edmorley edmorley commented Apr 27, 2018

Since:

  • the plugin is not maintained and does not have a version that officially supports Babel 7 (it seems to work, but does so by pulling in Babel 6 dependencies that would presumably end up causing issues in the future)
  • the automatic imports break being able to import other things from React
  • explicit is better than implicit (python -m this <3)

Also enables eslint-plugin-react if using ESLint with @neutrinojs/preact, for parity with 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 - and fixes #821).

@edmorley edmorley self-assigned this Apr 27, 2018
@edmorley edmorley added this to the v9 milestone Apr 27, 2018
@eliperelman
Copy link
Member

We also need to change the places in the docs where it says et al:

Automatic import of React.createElement, no need to import react or React.createElement yourself

@edmorley
Copy link
Member Author

Good point :-)

Since:
* the plugin is not maintained and does not have a version that
  officially supports Babel 7 (it seems to work, but does so by
  pulling in Babel 6 dependencies that would presumably end up
  causing issues in the future)
* the automatic imports break being able to import other things
  from `React`
* explicit is better than implicit (`python -m this` <3)

Users will need to add the missing imports when they upgrade to
Neutrino 9, but the airbnb preset will warn them (if they use it),
and we'll call it out in the migration guide.
`@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.
@edmorley edmorley merged commit f9a2d27 into neutrinojs:master Apr 27, 2018
@edmorley edmorley deleted the rm-jsx-pragmatic branch April 27, 2018 23:11
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

Issues with the Preact preset linting config
2 participants