Unify ESLint and Prettier across xplat/yoga (#1335)

Summary: Pull Request resolved: https://github.com/facebook/yoga/pull/1335

Reviewed By: christophpurrer

Differential Revision: D47459866

fbshipit-source-id: fd6b4e4e2518d91968ac7180b32129b3f70edf88
This commit is contained in:
Nick Gerleman
2023-07-17 14:27:32 -07:00
committed by Facebook GitHub Bot
parent 05b2edfb85
commit 44507ec62e
35 changed files with 2064 additions and 1559 deletions

View File

@@ -96,7 +96,9 @@ function getLayoutCode(
}`,
);
lines.push(indent + ` newWithView:{}`);
lines.push(indent + ` size:{${getValue(node.width)},${getValue(node.height)}}`);
lines.push(
indent + ` size:{${getValue(node.width)},${getValue(node.height)}}`,
);
const CKFlexboxComponentStyle = [
'direction',

View File

@@ -27,9 +27,11 @@ export const JSEnumLookup = {
};
function getEnum(yogaEnum: string, value: string | number): string {
return `yoga.${Object.keys(yoga)
.filter(key => key.toLowerCase().startsWith(yogaEnum.toLowerCase()))
.find(key => yoga[key] === value) || value}`;
return `yoga.${
Object.keys(yoga)
.filter(key => key.toLowerCase().startsWith(yogaEnum.toLowerCase()))
.find(key => yoga[key] === value) || value
}`;
}
function setProperty(

View File

@@ -8,7 +8,6 @@
* @format
*/
import {Record, List} from 'immutable';
import type {RecordOf} from 'immutable';
import PositionRecord from './PositionRecord';

View File

@@ -57,10 +57,7 @@ export default class YogaEnumSelect extends Component<Props> {
getTitle = (property: string, key: string): string => {
const replacer = new RegExp(`^${property}_`);
return key
.replace(replacer, '')
.replace('_', ' ')
.toLowerCase();
return key.replace(replacer, '').replace('_', ' ').toLowerCase();
};
render() {

View File

@@ -244,13 +244,8 @@ export default class YogaNode extends Component<Props, State> {
}
render() {
const {
layoutDefinition,
className,
path,
selectedNodePath,
label,
} = this.props;
const {layoutDefinition, className, path, selectedNodePath, label} =
this.props;
// $FlowFixMe
const computedLayout: ComputedLayout =

View File

@@ -137,10 +137,7 @@ const AboutSectionOne = () => (
<img src={ComponentKitLogo} />
<h3>ComponentKit</h3>
</a>
<a
href="https://reactnative.dev"
target="_blank"
className="logo">
<a href="https://reactnative.dev" target="_blank" className="logo">
<img src={ReactNativeLogo} />
<h3>React Native</h3>
</a>