Skip to content

Commit 4e1b48c

Browse files
committed
Run yarn lint:ts --fix and yarn prettier on all existing code
1 parent 29529a5 commit 4e1b48c

File tree

640 files changed

+6320
-5239
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

640 files changed

+6320
-5239
lines changed

packages/patternfly-3/patternfly-react-extensions/src/components/CatalogTile/CatalogTile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ class CatalogTile extends React.Component {
4242
}
4343

4444
this.descFullHeight = ref.clientHeight;
45-
}
45+
};
4646

4747
handleDescriptionSpanRef = ref => {
4848
if (!ref) {
4949
return;
5050
}
5151

5252
this.descLineHeight = parseInt(window.getComputedStyle(ref).getPropertyValue('line-height'), 10);
53-
}
53+
};
5454

5555
handleClick = e => {
5656
const { onClick, href } = this.props;
@@ -61,7 +61,7 @@ class CatalogTile extends React.Component {
6161
if (onClick) {
6262
onClick(e);
6363
}
64-
}
64+
};
6565

6666
renderBadges = badges => {
6767
if (!badges || !badges.length) {
@@ -75,7 +75,7 @@ class CatalogTile extends React.Component {
7575
))}
7676
</div>
7777
);
78-
}
78+
};
7979

8080
render() {
8181
const {

packages/patternfly-3/patternfly-react-extensions/src/components/CatalogTileView/CatalogTileViewCategory.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ class CatalogTileViewCategory extends React.Component {
5555
const rightSpacerWidth = this.categoryContainer.clientWidth % 235;
5656
this.setState({ numShown, rightSpacerWidth });
5757
}
58-
}
58+
};
5959

6060
handleRef = ref => {
6161
if (!ref) {
6262
return;
6363
}
6464
this.categoryContainer = ref;
65-
}
65+
};
6666

6767
render() {
6868
const { children, className, title, totalItems, viewAllText, viewAll, onViewAll, ...props } = this.props;

packages/patternfly-3/patternfly-react-extensions/src/components/CatalogTileView/__mocks__/mockCatalogTileViewExample.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class MockCatalogTileViewExample extends React.Component {
1717

1818
onViewAll = id => {
1919
this.setState({ showAll: id });
20-
}
20+
};
2121

2222
getBadges = item => {
2323
const badges = [];
@@ -39,13 +39,13 @@ class MockCatalogTileViewExample extends React.Component {
3939
}
4040

4141
return badges;
42-
}
42+
};
4343

4444
renderEmptyState = category => (
4545
<EmptyState className="blank-slate-content-pf">
4646
<EmptyState.Info>There are no items in this category.</EmptyState.Info>
4747
</EmptyState>
48-
)
48+
);
4949

5050
renderCategory = category => {
5151
const { showAll } = this.state;
@@ -80,7 +80,7 @@ class MockCatalogTileViewExample extends React.Component {
8080
}
8181

8282
return null;
83-
}
83+
};
8484

8585
render() {
8686
const { showAll } = this.state;

packages/patternfly-3/patternfly-react-extensions/src/components/DiffView/DiffView.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ const DiffView = ({
3434
const files = parseDiff(gitDiff);
3535
const hunk = files[0].hunks;
3636

37-
if (hunk.length === 0) { return emptyState; }
37+
if (hunk.length === 0) {
38+
return emptyState;
39+
}
3840
return hunk && <Diff className={classes} hunks={hunk} markEdits={markEdits} viewType={viewType} {...props} />;
3941
}
4042

@@ -53,7 +55,9 @@ const DiffView = ({
5355
/>
5456
);
5557

56-
if (patch === '') { return emptyState; }
58+
if (patch === '') {
59+
return emptyState;
60+
}
5761
return <div>{files.map(renderFile)}</div>;
5862
};
5963

packages/patternfly-3/patternfly-react-extensions/src/components/FilterSidePanel/_mocks_/mockFilterSidePanelExample.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ class MockFilterSidePanelExample extends React.Component {
5252
const showAllCategories = { ...this.state.showAllCategories };
5353
showAllCategories[id] = !showAllCategories[id];
5454
this.setState({ showAllCategories });
55-
}
55+
};
5656

5757
onFilterChange = (id, value) => {
5858
const activeFilters = { ...this.state.activeFilters };
5959
activeFilters[id] = value;
6060
this.setState({ activeFilters });
61-
}
61+
};
6262

6363
getStars = count => {
6464
const stars = [];
@@ -73,7 +73,7 @@ class MockFilterSidePanelExample extends React.Component {
7373
{stars}
7474
</span>
7575
);
76-
}
76+
};
7777

7878
render() {
7979
const { activeFilters, showAllCategories } = this.state;
@@ -259,7 +259,7 @@ class MockFilterSidePanelExample extends React.Component {
259259
checked={activeFilters.paymentDinersClub}
260260
onChange={e => this.onFilterChange('paymentDinersClub', e.target.checked)}
261261
>
262-
{'Diner\'s Club'}
262+
{"Diner's Club"}
263263
</FilterSidePanel.CategoryItem>
264264
</FilterSidePanel.Category>
265265
<FilterSidePanel.Category
@@ -301,7 +301,9 @@ class MockFilterSidePanelExample extends React.Component {
301301
count={8}
302302
checked={activeFilters.mileage10}
303303
onChange={e => this.onFilterChange('mileage10', e.target.checked)}
304-
>{'< 20'}</FilterSidePanel.CategoryItem>
304+
>
305+
{'< 20'}
306+
</FilterSidePanel.CategoryItem>
305307
</FilterSidePanel.Category>
306308
<FilterSidePanel.Category
307309
title="Rating"

packages/patternfly-3/patternfly-react-extensions/src/components/Select/SelectHelper.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ export const createItemProps = (item, selectedItem, className, onItemClick) => {
77
active: selectedItem.id === item.id
88
};
99

10-
if (item.disabled) { return { ...itemProps, disabled: true }; }
10+
if (item.disabled) {
11+
return { ...itemProps, disabled: true };
12+
}
1113
return { ...itemProps, onClick: e => onItemClick({ e, id: item.id, name: item.name }) };
1214
};

packages/patternfly-3/patternfly-react-extensions/src/components/Select/SelectInput.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class SelectInput extends React.Component {
1111
}
1212

1313
componentDidMount() {
14-
if (this.props.focus) { this.searchInput.current.focus(); }
14+
if (this.props.focus) {
15+
this.searchInput.current.focus();
16+
}
1517
}
1618

1719
render() {

packages/patternfly-3/patternfly-react-extensions/src/components/Select/StatefulWrapperSelect.js

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,12 @@ class StatefulWrapperSelect extends Component {
2020
const { options } = this.state;
2121
const results = [];
2222
options.forEach(opt => {
23-
if (opt.name.includes(search)) { results.push(opt); }
23+
if (opt.name.includes(search)) {
24+
results.push(opt);
25+
}
2426
});
2527
return results;
26-
}
28+
};
2729

2830
onSearch = e => {
2931
e.persist();
@@ -43,17 +45,21 @@ class StatefulWrapperSelect extends Component {
4345
}, 700);
4446
}
4547
);
46-
} else { this.setState({ isSearching: false, searchValue: '' }); }
47-
}
48+
} else {
49+
this.setState({ isSearching: false, searchValue: '' });
50+
}
51+
};
4852

4953
onClear = () => this.setState({ searchValue: '', isSearching: false });
5054

5155
onItemClick = host =>
52-
this.setState({ selected: { id: host.id, name: host.name }, open: false, isSearching: false, searchValue: '' })
56+
this.setState({ selected: { id: host.id, name: host.name }, open: false, isSearching: false, searchValue: '' });
5357

5458
handleClickOutside = () => {
55-
if (this.state.open === true) { this.onToggle(); }
56-
}
59+
if (this.state.open === true) {
60+
this.onToggle();
61+
}
62+
};
5763

5864
render() {
5965
const { open, isSearching, searchValue, selected, isLoading, options, matched } = this.state;

packages/patternfly-3/patternfly-react-extensions/src/components/TableGrid/_mocks_/mockTableGridExample.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ class MockTableGridExample extends React.Component {
5656
});
5757

5858
this.setState({ items, sortField: id, isAscending: updateAscending });
59-
}
59+
};
6060

6161
onSelect = (item, field) => {
6262
this.setState({ selectedItem: item, selectedField: field });
63-
}
63+
};
6464

6565
toggleSelection = item => {
6666
const { selectedItems } = this.state;
@@ -73,12 +73,12 @@ class MockTableGridExample extends React.Component {
7373
newSelections = [...selectedItems, item];
7474
}
7575
this.setState({ selectedItems: newSelections });
76-
}
76+
};
7777

7878
toggleAllSelections = () => {
7979
const { items, selectedItems } = this.state;
8080
this.setState({ selectedItems: selectedItems.length > 0 ? [] : [...items] });
81-
}
81+
};
8282

8383
renderItemRow = (item, index) => {
8484
const { selectType } = this.props;
@@ -121,7 +121,7 @@ class MockTableGridExample extends React.Component {
121121
</TableGrid.Col>
122122
</TableGrid.Row>
123123
);
124-
}
124+
};
125125

126126
render() {
127127
const { items, selectedItems, sortField, isAscending } = this.state;

packages/patternfly-3/patternfly-react-extensions/src/components/TableGrid/_mocks_/mockVirtualTableGridExample.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ class MockVirtualTableGridExample extends React.Component {
5656
});
5757

5858
this.setState({ items, sortField: id, isAscending: updateAscending });
59-
}
59+
};
6060

6161
onSelect = (item, field) => {
6262
this.setState({ selectedItem: item, selectedField: field });
63-
}
63+
};
6464

6565
toggleSelection = item => {
6666
const { selectedItems } = this.state;
@@ -73,12 +73,12 @@ class MockVirtualTableGridExample extends React.Component {
7373
newSelections = [...selectedItems, item];
7474
}
7575
this.setState({ selectedItems: newSelections });
76-
}
76+
};
7777

7878
toggleAllSelections = () => {
7979
const { items, selectedItems } = this.state;
8080
this.setState({ selectedItems: selectedItems.length > 0 ? [] : [...items] });
81-
}
81+
};
8282

8383
ItemHeader = tableData => {
8484
const { numItems, selectType, selectedItems, sortField, isAscending } = tableData;
@@ -134,7 +134,7 @@ class MockVirtualTableGridExample extends React.Component {
134134
</VirtualTableGrid.ColumnHeader>
135135
</VirtualTableGrid.Head>
136136
);
137-
}
137+
};
138138

139139
ItemRow = rowProps => {
140140
const { obj, tableData, index } = rowProps;
@@ -177,7 +177,7 @@ class MockVirtualTableGridExample extends React.Component {
177177
</VirtualTableGrid.Col>
178178
</VirtualTableGrid.Row>
179179
);
180-
}
180+
};
181181

182182
render() {
183183
const { items, selectedItem, selectedItems, selectedField, sortField, isAscending } = this.state;

0 commit comments

Comments
 (0)