Skip to content

Commit df459cc

Browse files
committed
Update eslint-plugin-shopify
Add a linting check to ensure we always use `<React.Fragment>` over `</>` Remove deprecation notices that are no longer triggered (see jsx-eslint/eslint-plugin-react#2069)
1 parent dfd4d76 commit df459cc

File tree

11 files changed

+34
-17
lines changed

11 files changed

+34
-17
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
"import/no-named-as-default": "off",
3232
"react/button-has-type": "off",
3333
"react/no-array-index-key": "off",
34+
"react/jsx-fragments": ["error", "element"],
3435
"shopify/jsx-no-complex-expressions": "off",
3536
"shopify/no-ancestor-directory-import": "error",
3637
"jsx-a11y/label-has-for": [

src/components/AppProvider/AppProvider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,6 @@ export default class AppProvider extends React.Component<Props> {
4545
}
4646
}
4747

48-
// eslint-disable-next-line react/no-deprecated
4948
componentWillReceiveProps({
5049
i18n,
5150
linkComponent,

src/components/Collapsible/Collapsible.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ export class Collapsible extends React.Component<CombinedProps, State> {
6868
};
6969
}
7070

71-
// eslint-disable-next-line react/no-deprecated
7271
componentWillReceiveProps({open: willOpen}: Props) {
7372
const {open} = this.props;
7473

src/components/DropZone/components/FileUpload/FileUpload.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,12 +68,10 @@ export class FileUpload extends React.Component<CombinedProps, State> {
6868
}
6969
}
7070

71-
// eslint-disable-next-line react/no-deprecated
7271
componentWillReceiveProps(props: Props) {
7372
this.updateStateFromProps(props);
7473
}
7574

76-
// eslint-disable-next-line react/no-deprecated
7775
componentWillMount() {
7876
this.updateStateFromProps(this.props);
7977
}

src/components/OptionList/OptionList.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ export class OptionList extends React.Component<CombinedProps, State> {
7373

7474
private id = this.props.id || getUniqueId();
7575

76-
// eslint-disable-next-line react/no-deprecated
7776
componentWillReceiveProps({
7877
options: nextOptions = [],
7978
sections: nextSections = [],

src/components/PositionedOverlay/PositionedOverlay.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,6 @@ export default class PositionedOverlay extends React.PureComponent<
9393
}
9494
}
9595

96-
// eslint-disable-next-line react/no-deprecated
9796
componentWillReceiveProps() {
9897
this.handleMeasurement();
9998
}

src/components/ResourceList/ResourceList.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,6 @@ export class ResourceList extends React.Component<CombinedProps, State> {
299299
};
300300
}
301301

302-
// eslint-disable-next-line react/no-deprecated
303302
componentWillReceiveProps(nextProps: Props) {
304303
const {selectedItems} = this.props;
305304

src/components/Tabs/Tabs.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export default class Tabs extends React.PureComponent<Props, State> {
4949
tabToFocus: -1,
5050
};
5151

52-
// eslint-disable-next-line react/no-deprecated
5352
componentWillReceiveProps(nextProps: Props) {
5453
const {selected} = this.props;
5554
const {disclosureWidth, tabWidths, containerWidth, tabToFocus} = this.state;

src/components/ThemeProvider/ThemeProvider.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export default class ThemeProvider extends React.Component<Props> {
3535
this.colors = setColors(props.theme);
3636
}
3737

38-
// eslint-disable-next-line react/no-deprecated
3938
componentWillReceiveProps({theme}: Props) {
4039
if (isEqual(theme, this.props.theme)) {
4140
return;

src/utilities/react-compose.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export default function compose<Props>(
1919
const Result = reactCompose(...wrappingFunctions)(
2020
OriginalComponent,
2121
) as ReactComponent<ComposedProps>;
22+
// eslint-disable-next-line react/display-name
2223
return React.forwardRef<Props>(
2324
(props: Props, ref: React.RefObject<any>) => {
2425
return (

0 commit comments

Comments
 (0)