Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update eslint-config #9335

Merged
merged 3 commits into from
Jun 7, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
315 changes: 196 additions & 119 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@
"electron-notarize": "^1.2.1",
"electron-reloader": "^1.2.1",
"eslint": "^7.6.0",
"eslint-config-expensify": "2.0.24",
"eslint-config-expensify": "2.0.27",
"eslint-loader": "^4.0.2",
"eslint-plugin-jest": "^24.1.0",
"flipper-plugin-bridgespy-client": "^0.1.9",
Expand Down
2 changes: 2 additions & 0 deletions src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ function createIOUSplit(params) {
}

chatReportID = response.reportID;
// eslint-disable-next-line rulesdir/no-multiple-api-calls
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mountiny is actually removing the violation for DeprecatedAPI here: https://github.com/Expensify/eslint-config-expensify/pull/53/files#diff-936b4e8282631c0051d8abc7077a077a6648d17e47d84242963fd1d4c5170a4aR11

So perhaps we can wait for that change to be merged (soon) and we won't need these suppressions?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AH nice! Yea, we can wait for that and just bump up the lint version then :) Thanks @yuwenmemon!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, would be nice to add both of the rules at the same time! Thanks!

return DeprecatedAPI.CreateIOUSplit({
...params,
splits: JSON.stringify(params.splits),
Expand Down Expand Up @@ -296,6 +297,7 @@ function payIOUReport({

const payIOUPromise = paymentMethodType === CONST.IOU.PAYMENT_TYPE.EXPENSIFY
? DeprecatedAPI.PayWithWallet({reportID, newIOUReportDetails})
// eslint-disable-next-line rulesdir/no-multiple-api-calls
: DeprecatedAPI.PayIOU({reportID, paymentMethodType, newIOUReportDetails});

// Build the url for the user's platform of choice if they have selected something other than a manual settlement or Expensify Wallet e.g. Venmo or PayPal.me
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ function fetchNameValuePairsAndBankAccount() {
failedValidationAttemptsName = CONST.NVP.FAILED_BANK_ACCOUNT_VALIDATIONS_PREFIX + bankAccountID;

// Now that we have the bank account. Lets grab the rest of the bank info we need
// eslint-disable-next-line rulesdir/no-multiple-api-calls
return DeprecatedAPI.Get({
returnValueList: 'nameValuePairs, bankAccountList',
nvpNames: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ function resetFreePlanBankAccount() {
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT, null);

// Clear the NVP for the bank account so the user can add a new one and navigate back to bank account page
// eslint-disable-next-line rulesdir/no-multiple-api-calls
DeprecatedAPI.SetNameValuePair({name: CONST.NVP.FREE_PLAN_BANK_ACCOUNT_ID, value: ''});
Navigation.navigate(ROUTES.getBankAccountRoute());
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ function validateBankAccount(bankAccountID, validateCode) {
.then((response) => {
if (response.jsonCode === 200) {
Onyx.set(ONYXKEYS.REIMBURSEMENT_ACCOUNT_DRAFT, null);
// eslint-disable-next-line rulesdir/no-multiple-api-calls
DeprecatedAPI.User_IsUsingExpensifyCard()
.then(({isUsingExpensifyCard}) => {
const reimbursementAccount = {
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/Session/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ function createTemporaryLogin(authToken, email) {
// If we have an old generated login for some reason
// we should delete it before storing the new details
if (credentials && credentials.autoGeneratedLogin) {
// eslint-disable-next-line rulesdir/no-multiple-api-calls
DeprecatedAPI.DeleteLogin({
partnerUserID: credentials.autoGeneratedLogin,
partnerName: CONFIG.EXPENSIFY.PARTNER_NAME,
Expand Down
1 change: 1 addition & 0 deletions src/libs/actions/User.js
Original file line number Diff line number Diff line change
Expand Up @@ -281,6 +281,7 @@ function getDomainInfo() {
const {isFromPublicDomain} = response;
Onyx.merge(ONYXKEYS.USER, {isFromPublicDomain});

// eslint-disable-next-line rulesdir/no-multiple-api-calls
DeprecatedAPI.User_IsUsingExpensifyCard()
.then(({isUsingExpensifyCard}) => {
Onyx.merge(ONYXKEYS.USER, {isUsingExpensifyCard});
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/NetworkTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -217,10 +217,12 @@ test('consecutive API calls eventually succeed when authToken is expired', () =>
.then((response) => {
Onyx.merge('test_chatList', response.chatList);
});
// eslint-disable-next-line rulesdir/no-multiple-api-calls
DeprecatedAPI.Get({returnValueList: 'personalDetailsList'})
.then((response) => {
Onyx.merge('test_personalDetailsList', response.personalDetailsList);
});
// eslint-disable-next-line rulesdir/no-multiple-api-calls
DeprecatedAPI.Get({returnValueList: 'account'})
.then((response) => {
Onyx.merge('test_account', response.account);
Expand Down