Skip to content

Commit a4e9ca3

Browse files
committed
fix linting issues
1 parent 511e73b commit a4e9ca3

6 files changed

Lines changed: 16 additions & 9 deletions

File tree

.eslintrc.cjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ module.exports = {
1515
plugins: ['react-refresh'],
1616
rules: {
1717
'@typescript-eslint/no-explicit-any': 'error',
18+
'@typescript-eslint/no-unused-vars': [
19+
'error',
20+
{
21+
argsIgnorePattern: '^_',
22+
varsIgnorePattern: '^_',
23+
caughtErrorsIgnorePattern: '^_',
24+
},
25+
],
1826
//add this back in
1927
// 'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
2028
'no-restricted-imports': [

scripts/i18n.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ const i18nExtract = () => {
6666
logInfo(colors.magenta.bold(`Inserting current location info for ${locale}:`))
6767
execUpdateLocations(locale)
6868
})
69-
} catch (err) {
69+
} catch (_err) {
7070
logError(`${colors.bold('ERROR:')} Error extracting strings`)
7171
logInfo(`Make sure gettext is installed:\n
7272
- https://ftp.gnu.org/pub/gnu/gettext/gettext-0.20.2.tar.gz`)
@@ -96,7 +96,7 @@ const po2json = () => {
9696
.map((locale) => ` - ${LANG_FILE_DIRECTORY}/${locale}.json\n`)
9797
.join('')}`,
9898
)
99-
} catch (err) {
99+
} catch (_err) {
100100
logError(`${colors.bold('ERROR:')} Error converting .po to .json`)
101101
}
102102
}

src/redux/reducers/__tests__/config-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ describe('configSlice', () => {
166166
const initialConfig = selectInitialConfig({ config: afterState })
167167

168168
// Remove _initialValues from the current state to compare the rest of the state
169-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
169+
170170
const { _initialValues, ...stateWithoutInitialValuesKey } = afterState
171171
expect(initialConfig).toEqual(stateWithoutInitialValuesKey)
172172
})

src/redux/reducers/configSlice.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ const configSlice = createSlice({
4444
name: 'config',
4545
initialState,
4646
reducers: {
47-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
4847
addVerificationData: (state, _) => {
4948
// If the current mode is AGG_MODE, we need to set the include_transactions flag to true
5049
// in order to continue getting transactions for new connections
@@ -60,7 +59,7 @@ const configSlice = createSlice({
6059
state.use_cases = ['MONEY_MOVEMENT']
6160
}
6261
},
63-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
62+
6463
addAggregationData: (state, _) => {
6564
state.include_transactions = true
6665

@@ -95,7 +94,7 @@ const configSlice = createSlice({
9594
}
9695

9796
// Remove _initialValues from the state temporarily, create it below
98-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
97+
9998
const { _initialValues, ...stateWithoutInitialValues } = loadedState
10099

101100
return {
@@ -227,7 +226,7 @@ const getProductDeterminedMode = (config: {
227226
const convertInitialValuesToObject = (initialValues: string) => {
228227
try {
229228
return JSON.parse(initialValues)
230-
} catch (error) {
229+
} catch (_error) {
231230
// While the widget is loading, _initialValues may not be set yet
232231
return {}
233232
}

src/utilities/PostMessage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ export function sendPostMessage(event, data, scheme = 'mx') {
149149
if (window.opener) {
150150
window.opener.postMessage(message, postUrl)
151151
}
152-
} catch (error) {
152+
} catch (_error) {
153153
// This will quiet the noise in the console, while hopefully removing the error from honeybadger
154154
// console.warn('Post message error', error)
155155
}

src/utilities/global.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export const urlWithHttps = (url) => {
3333

3434
// Return a string containing the whole url
3535
return newUrl.toString()
36-
} catch (error) {
36+
} catch (_error) {
3737
// Handles the case where the url is not a valid url(www.mx.com)
3838
return `https://${url}`
3939
}

0 commit comments

Comments
 (0)