-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
Hi @lukyth, thanks for contributing a fix to Draft.js! 🎉 Unfortunately I had already started working on this change with #2076 a few days earlier, but I like your change to add the babel plugin to the Jest preprocessor better: process(src, filename) {
var options = {
presets: [fbjsConfigurePreset({rewriteModules: {map: moduleMap}})],
+ plugins: [require('@babel/plugin-proposal-nullish-coalescing-operator')],
filename: filename,
retainLines: true,
}; whereas I added a |
Hi @claudiopro :) Thank you for your comments! I rebased the branch against I tried to upgrade |
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.
Please take a look at my comments. Since you're configuring the babel plugin @babel/plugin-proposal-nullish-coalescing-operator
in the Jest preprocessor, you should remove the .babelrc
file which is not necessary anymore.
@claudiopro I took care of |
Cool stuff! I want to see what the internal linters say about this. |
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.
@mrkev has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
@mrkev Thanks for checking it out :) |
There's a linter warning, but it should be fine. I'll try to get this merged today. |
…ator (facebookarchive#2083) Summary: **Summary** I want to upgrade ESLint and Flow on this project. I ended up with - Remove unused `eslint-plugin-relay` - Upgrade all ESLint packages to the latest version and fix all the new lint errors afterward. - `eslint-config-fbjs` - `eslint-config-prettier` - `eslint-plugin-babel` - `eslint-plugin-flowtype` - `eslint-plugin-jsx-a11y` - `eslint-plugin-prettier` - `eslint-plugin-react` - Upgrade Flow (`flow-bin`) to the `0.115.0`. ~Then I found that `yarn test` is failing at~ ``` src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js: Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (70:40) ``` ~So I added `babel/plugin-proposal-nullish-coalescing-operator` to jest preprocessor as well.~ Move plugins in `.babelrc` to jest preprocessor as facebookarchive#2083 (comment) **Test Plan** `yarn lint`, `yarn flow`, and `yarn test` should all pass. Pull Request resolved: facebookarchive#2083 Reviewed By: claudiopro Differential Revision: D19398251 Pulled By: mrkev fbshipit-source-id: 4fc2f6dd6e0cd44266d061455b7b6a433231715a
…ator (facebookarchive#2083) Summary: **Summary** I want to upgrade ESLint and Flow on this project. I ended up with - Remove unused `eslint-plugin-relay` - Upgrade all ESLint packages to the latest version and fix all the new lint errors afterward. - `eslint-config-fbjs` - `eslint-config-prettier` - `eslint-plugin-babel` - `eslint-plugin-flowtype` - `eslint-plugin-jsx-a11y` - `eslint-plugin-prettier` - `eslint-plugin-react` - Upgrade Flow (`flow-bin`) to the `0.115.0`. ~Then I found that `yarn test` is failing at~ ``` src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js: Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (70:40) ``` ~So I added `babel/plugin-proposal-nullish-coalescing-operator` to jest preprocessor as well.~ Move plugins in `.babelrc` to jest preprocessor as facebookarchive#2083 (comment) **Test Plan** `yarn lint`, `yarn flow`, and `yarn test` should all pass. Pull Request resolved: facebookarchive#2083 Reviewed By: claudiopro Differential Revision: D19398251 Pulled By: mrkev fbshipit-source-id: 4fc2f6dd6e0cd44266d061455b7b6a433231715a
…ator (#2083) Summary: **Summary** I want to upgrade ESLint and Flow on this project. I ended up with - Remove unused `eslint-plugin-relay` - Upgrade all ESLint packages to the latest version and fix all the new lint errors afterward. - `eslint-config-fbjs` - `eslint-config-prettier` - `eslint-plugin-babel` - `eslint-plugin-flowtype` - `eslint-plugin-jsx-a11y` - `eslint-plugin-prettier` - `eslint-plugin-react` - Upgrade Flow (`flow-bin`) to the `0.115.0`. ~Then I found that `yarn test` is failing at~ ``` src/component/handlers/composition/__tests__/DraftEditorCompostionHandler-test.js: Support for the experimental syntax 'nullishCoalescingOperator' isn't currently enabled (70:40) ``` ~So I added `babel/plugin-proposal-nullish-coalescing-operator` to jest preprocessor as well.~ Move plugins in `.babelrc` to jest preprocessor as facebookarchive/draft-js#2083 (comment) **Test Plan** `yarn lint`, `yarn flow`, and `yarn test` should all pass. Pull Request resolved: facebookarchive/draft-js#2083 Reviewed By: claudiopro Differential Revision: D19398251 Pulled By: mrkev fbshipit-source-id: 4fc2f6dd6e0cd44266d061455b7b6a433231715a
Summary
I want to upgrade ESLint and Flow on this project. I ended up with
Remove unused
eslint-plugin-relay
Upgrade all ESLint packages to the latest version and fix all the new lint errors afterward.
eslint-config-fbjs
eslint-config-prettier
eslint-plugin-babel
eslint-plugin-flowtype
eslint-plugin-jsx-a11y
eslint-plugin-prettier
eslint-plugin-react
Upgrade Flow (
flow-bin
) to the0.115.0
.Then I found thatyarn test
is failing atSo I added@babel/plugin-proposal-nullish-coalescing-operator
to jest preprocessor as well.Move plugins in
.babelrc
to jest preprocessor as #2083 (comment)Test Plan
yarn lint
,yarn flow
, andyarn test
should all pass.