Skip to content

Commit

Permalink
Remove FBT Babel workarounds
Browse files Browse the repository at this point in the history
It should no longer be needed, see: facebook/fbt@ecc647d

There is another issue though in Eslint which needs to be fixed, see: #2005
  • Loading branch information
mrtnzlml authored and kodiakhq[bot] committed Mar 18, 2021
1 parent 249d7e5 commit 0478859
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 80 deletions.
1 change: 1 addition & 0 deletions src/eslint-config-adeira/CHANGELOG.md
@@ -1,6 +1,7 @@
# Unreleased

- Our custom rule `adeira/no-internal-flow-type` has been migrated to official `flowtype/no-internal-flow-type` (https://github.com/gajus/eslint-plugin-flowtype/pull/469). There should be no changes in behavior.
- Rule `react/forbid-dom-props` has been temporarily disabled because it causes problems with [FBT](https://facebook.github.io/fbt/) tags, see: https://github.com/adeira/universe/issues/2005

# 5.1.0

Expand Down
Expand Up @@ -743,15 +743,7 @@ Object {
"react/destructuring-assignment": 0,
"react/display-name": 0,
"react/forbid-component-props": 0,
"react/forbid-dom-props": Array [
2,
Object {
"forbid": Array [
"class",
"for",
],
},
],
"react/forbid-dom-props": 0,
"react/forbid-elements": 0,
"react/forbid-foreign-prop-types": 0,
"react/forbid-prop-types": 0,
Expand Down
10 changes: 1 addition & 9 deletions src/eslint-config-adeira/ourRules.js
Expand Up @@ -361,15 +361,7 @@ module.exports = ({
'react/destructuring-assignment': OFF,
'react/display-name': OFF,
'react/forbid-component-props': OFF,
'react/forbid-dom-props': [
ERROR,
{
forbid: [
'class', // https://reactjs.org/docs/dom-elements.html#classname
'for', // https://reactjs.org/docs/dom-elements.html#htmlfor
],
},
],
'react/forbid-dom-props': OFF,
'react/forbid-elements': OFF,
'react/forbid-foreign-prop-types': OFF,
'react/forbid-prop-types': OFF,
Expand Down
13 changes: 1 addition & 12 deletions src/sx-design/.babelrc.js
Expand Up @@ -2,16 +2,5 @@

module.exports = {
presets: ['@adeira/babel-preset-adeira'],
plugins: [
[
'babel-plugin-fbt',
{
extraOptions: {
__self: true,
__source: true,
},
},
],
'babel-plugin-fbt-runtime',
],
plugins: ['babel-plugin-fbt', 'babel-plugin-fbt-runtime'],
};
13 changes: 1 addition & 12 deletions src/sx-design/.storybook/.babelrc.js
Expand Up @@ -2,16 +2,5 @@

module.exports = {
presets: ['@adeira/babel-preset-adeira'],
plugins: [
[
'babel-plugin-fbt',
{
extraOptions: {
__self: true,
__source: true,
},
},
],
'babel-plugin-fbt-runtime',
],
plugins: ['babel-plugin-fbt', 'babel-plugin-fbt-runtime'],
};
14 changes: 1 addition & 13 deletions src/ya-comiste-backoffice/.babelrc.js
Expand Up @@ -2,17 +2,5 @@

module.exports = {
presets: ['next/babel', '@adeira/babel-preset-adeira'],
plugins: [
[
'babel-plugin-fbt',
{
extraOptions: {
__self: true,
__source: true,
},
},
],
'babel-plugin-fbt-runtime',
'relay',
],
plugins: ['babel-plugin-fbt', 'babel-plugin-fbt-runtime', 'relay'],
};
20 changes: 7 additions & 13 deletions src/ya-comiste-backoffice/src/pos/ProductsSelected.js
@@ -1,6 +1,6 @@
// @flow

import { Money, MoneyFn } from '@adeira/sx-design';
import { Money } from '@adeira/sx-design';
import { fbt } from 'fbt';
import * as React from 'react';
import sx from '@adeira/sx';
Expand Down Expand Up @@ -46,18 +46,12 @@ export default function ProductsSelected(): React.Node {
))}
</div>
<div className={styles('stats')}>
{/* TODO: https://github.com/facebook/fbt/pull/137 */}
{fbt(
`${fbt.param('totalSelectedItems', stats.totalSelectedItems)} items for ${fbt.param(
'totalPrice',
MoneyFn({
locale: 'en-US', // TODO
priceUnitAmount: stats.totalPrice,
priceUnitAmountCurrency: 'MXN',
}),
)}`,
'summary of selected items in POS',
)}
<fbt desc="summary of selected items in POS">
<fbt:param name="totalSelectedItems">{stats.totalSelectedItems}</fbt:param> items for{' '}
<fbt:param name="totalPrice">
<Money priceUnitAmount={stats.totalPrice} priceUnitAmountCurrency="MXN" />
</fbt:param>
</fbt>
</div>
<div className={styles('checkout')}>
<Link
Expand Down
24 changes: 12 additions & 12 deletions src/ya-comiste-backoffice/translations/source_strings.json
Expand Up @@ -215,9 +215,9 @@
"X15wJnkWMiCincs1C+MeFw==": "Did you receive the money?"
},
"filepath": "src/pos/POSCheckoutPageLayout.js",
"line_beg": 90,
"line_beg": 89,
"col_beg": 8,
"line_end": 90,
"line_end": 89,
"col_end": 88,
"desc": "checkout question before continuing",
"project": "",
Expand All @@ -229,9 +229,9 @@
"MfLT6Yq4YBMxi+dW96zMNg==": "Yes, finish checkout"
},
"filepath": "src/pos/POSCheckoutPageLayout.js",
"line_beg": 99,
"line_beg": 98,
"col_beg": 10,
"line_end": 99,
"line_end": 98,
"col_end": 77,
"desc": "process checkout button text",
"project": "",
Expand All @@ -243,9 +243,9 @@
"P3UvwgozOxL8sg8ODM5D/A==": "No, start over"
},
"filepath": "src/pos/POSCheckoutPageLayout.js",
"line_beg": 107,
"line_beg": 106,
"col_beg": 10,
"line_end": 107,
"line_end": 106,
"col_end": 69,
"desc": "reset checkout button text",
"project": "",
Expand Down Expand Up @@ -313,10 +313,10 @@
"EAFd1PD0L8GS/sTNRO5dzA==": "{totalSelectedItems} items for {totalPrice}"
},
"filepath": "src/pos/ProductsSelected.js",
"line_beg": 54,
"col_beg": 9,
"line_end": 64,
"col_end": 9,
"line_beg": 49,
"col_beg": 8,
"line_end": 54,
"col_end": 14,
"desc": "summary of selected items in POS",
"project": "",
"type": "text",
Expand All @@ -327,9 +327,9 @@
"nIpABsKUotYCJOCxk8ZWTg==": "Proceed to checkout"
},
"filepath": "src/pos/ProductsSelected.js",
"line_beg": 72,
"line_beg": 62,
"col_beg": 10,
"line_end": 72,
"line_end": 62,
"col_end": 69,
"desc": "checkout button title",
"project": "",
Expand Down

0 comments on commit 0478859

Please sign in to comment.