-
Notifications
You must be signed in to change notification settings - Fork 1
chore(jsx): add jsx transformer #181
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
plugins/react.js
Outdated
babelOptions: { | ||
plugins: [ | ||
jsxDevTransform | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No resorting to preset: '@babel/preset-react
. We only needed @babel/plugin-transform-react-jsx-development
to make this work for svg-icons
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use the preset, which doesn't require the eslint-disable
clauses (inside the eslint-config 😬)?
Also, this should be added to the index where jsx: true
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After a convo offline, we will go with @babel/preset-react
as the simplest option.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, this should be added to the index where
jsx: true
.
Also per offline convo, might be best to consolidate all the react/jsx stuff right here. In which case, we handle the peers a bit differently (aka, they aren't spelled out in the package.json)
plugins/react.js
Outdated
babelOptions: { | ||
plugins: [ | ||
jsxDevTransform | ||
] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why not just use the preset, which doesn't require the eslint-disable
clauses (inside the eslint-config 😬)?
Also, this should be added to the index where jsx: true
.
"@babel/core": "^7.16.0", | ||
"@babel/eslint-parser": "^7.15.0", | ||
"@babel/preset-react": "^7.16.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Garden devDependencies
need to be specific (and latest), not hat-range, versions.
}, | ||
requireConfigFile: false, | ||
babelOptions: { | ||
presets: ['@babel/preset-react'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't want this requireConfigFile
setting here. The existence of the config file is generally desirable; we turn it off for the repos where it is known not to exist.
But this is raising a larger question for me... I had verified the @babel/eslint-parser
upgrade against both react-components
and react-containers
. I'm back to wondering if this is a JSX support preset that actually should live here?
After re-reading https://www.npmjs.com/package/@babel/eslint-parser re: requireConfigFile
, I'm convinced that the majority case is that repos with React/JSX will also have a Babel config that the @babel/eslint-parser
will follow. And svg-icons
is the minority case that should have this babelOptions: { presets: ... }
setting as a one-off.
A 1000 humble apologies for the whip around on this @mtomcal. But, as a centralized config for all of Garden, I think it is worth worrying about getting this right. tldr; I'm thinking we don't need this PR and should keep the added babelOptions
config local to svg-icons
.
closed by zendeskgarden/svg-icons#246 |
Description
We had difficulties with upgrading
svg-icons
library due to recent breaking changes frombabel-eslint
to@babel/eslint-parser
. We introduced the JSX transformer in order to properly parse JSX files for ESLint given the new Babel change.