Skip to content

Commit c4a630b

Browse files
Added eslint rule for unused vars (#728)
1 parent eaa24c0 commit c4a630b

File tree

25 files changed

+36
-53
lines changed

25 files changed

+36
-53
lines changed

.eslintrc.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"react/jsx-wrap-multilines": ["off"],
55
"react/destructuring-assignment": ["off"],
66
"react/jsx-boolean-value": ["off"],
7-
"no-param-reassign": ["off"]
7+
"no-param-reassign": ["off"],
8+
"@typescript-eslint/no-unused-vars": "warn"
89
},
910
"settings": {
1011
"import/resolver": {

src/components/src/AddressForm/addressform.main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,7 @@ class AddressFormMain extends Component<AddressFormMainProps, AddressFormMainSta
172172
async submitAddress(event) {
173173
event.preventDefault();
174174
const {
175-
addressData, fetchData, onCloseModal, chosenShipping, selectactionShippingUri, selectactionBillingUri,
175+
addressData, fetchData, onCloseModal, selectactionShippingUri, selectactionBillingUri,
176176
} = this.props;
177177
const {
178178
addressForm, firstName, lastName, address, extendedAddress, city, country, subCountry, postalCode, isShippingAddress, isBillingAddress,

src/components/src/AppHeader/appheader.main.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ class AppHeaderMain extends Component<AppHeaderMainProps, AppHeaderMainState> {
243243
isOffline, cartData, isLoading, isSearchFocused, isBulkModalOpened, isDesktop, isLoggedInUser, multiCartData, totalQuantity,
244244
} = this.state;
245245
const {
246-
checkedLocation,
247246
handleResetPassword,
248247
onCurrencyChange,
249248
onLocaleChange,
@@ -255,8 +254,6 @@ class AppHeaderMain extends Component<AppHeaderMainProps, AppHeaderMainState> {
255254
redirectToMainPage,
256255
appHeaderLinks,
257256
appHeaderLoginLinks,
258-
appHeaderNavigationLinks,
259-
appHeaderTopLinks,
260257
appModalLoginLinks,
261258
} = this.props;
262259
const availability = Boolean(cartData || multiCartData);

src/components/src/AppHeaderSearch/appheadersearch.main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ class AppHeaderSearchMain extends Component<AppHeaderSearchMainProps, AppHeaderS
5757
this.search = this.search.bind(this);
5858
}
5959

60-
componentDidUpdate(prevProps) {
60+
componentDidUpdate() {
6161
const { isFocused } = this.props;
6262

6363
if (isFocused === true) {

src/components/src/B2bAccountList/b2b.accountlist.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ class B2bAccountList extends Component<B2bAccountMainProps, B2bAccountMainState>
9595
accountListData,
9696
accountName,
9797
registrationNumber,
98-
getSubAccountData,
9998
} = this.props;
10099

101100
const { showAccountsMobileMenu } = this.state;

src/components/src/B2bAddProductsModal/b2b.add.products.modal.tsx

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,10 +106,6 @@ class AddProductsModal extends Component<AddProductsModalProps, AddProductsModal
106106
const arrayItems = dataItems
107107
.filter(item => item.code !== '')
108108
.map(item => ({ code: item.code, quantity: item.quantity }));
109-
let totalQuantity = 0;
110-
arrayItems.forEach((item) => {
111-
totalQuantity += item.quantity;
112-
});
113109
login().then(() => {
114110
const body: { [key: string]: any } = {};
115111
if (arrayItems) {

src/components/src/B2bEditAccount/b2b.editaccount.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ class B2bEditAccount extends Component<B2bEditAccountProps, B2bEditAccountState>
147147
handleUpdate();
148148
this.setState({ isLoading: false });
149149
})
150-
.catch((err) => {
150+
.catch(() => {
151151
this.setState({ isLoading: false });
152152
});
153153
});

src/components/src/B2bEditAssociate/b2b.editassociate.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class B2bEditAssociate extends Component<B2bEditAssociateProps, B2bEditAssociate
8080
}
8181

8282
renderRoleSelection() {
83-
const { rolesSelector, isSelf } = this.props;
83+
const { rolesSelector } = this.props;
8484

8585
const allAssociateRoles = [];
8686
if (rolesSelector) {

src/components/src/B2bSideMenu/b2b.sidemenu.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
*/
2121

2222
import React, { Component } from 'react';
23-
import { Route, Link } from 'react-router-dom';
23+
import { Link } from 'react-router-dom';
2424
import intl from 'react-intl-universal';
2525
import './b2b.sidemenu.scss';
2626

src/components/src/Bloomreach/bloomreach.appheadersearch.main.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
*
2020
*/
2121

22-
import React, { FormEvent, SyntheticEvent, Component } from 'react';
22+
import React, { SyntheticEvent, Component } from 'react';
2323
import { bloomreachSuggestionSearch } from '../utils/BloomreachSearchService';
2424
import './bloomreach.headersearch.main.scss';
2525
import { ReactComponent as SearchIcon } from '../../../images/header-icons/magnifying-glass.svg';
@@ -95,7 +95,7 @@ class BloomreachHeaderSearchMain extends Component<BloomreachHeaderSearchMainPro
9595
this.handleOnTouchEndOnSuggestionLiElement = this.handleOnTouchEndOnSuggestionLiElement.bind(this);
9696
}
9797

98-
componentDidUpdate(prevProps) {
98+
componentDidUpdate() {
9999
const { isFocused } = this.props;
100100

101101
if (isFocused === true) {
@@ -189,7 +189,7 @@ class BloomreachHeaderSearchMain extends Component<BloomreachHeaderSearchMainPro
189189
onKeyDown={this.liHandleKeyDown}
190190
onMouseUp={(e) => { this.search(e, suggestion.q); }}
191191
onTouchEnd={(e) => { this.handleOnTouchEndOnSuggestionLiElement(e, suggestion.q); }}
192-
onTouchMove={(e) => { this.isTouchMoveEvent = true; }}
192+
onTouchMove={() => { this.isTouchMoveEvent = true; }}
193193
>
194194
{suggestion.dq}
195195
</li>

0 commit comments

Comments
 (0)