Skip to content

Commit 8003a9c

Browse files
Use eslint-seatbelt baseline instead of inline eslint-disable comments
Co-authored-by: Linh Vo <linhvovan29546@users.noreply.github.com>
1 parent 4117a1a commit 8003a9c

16 files changed

Lines changed: 16 additions & 14 deletions

‎config/eslint/eslint.config.mjs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -721,6 +721,8 @@ const config = defineConfig([
721721
// This uses the typescript-eslint variant of `no-restricted-imports` (a separate rule name, so it stacks
722722
// with the base rule above instead of overriding it) because only that variant supports `allowTypeImports`,
723723
// and `src/types/onyx/Request.ts` legitimately does `import type OnyxUtils from 'react-native-onyx/dist/OnyxUtils'`.
724+
// The 14 existing runtime imports are grandfathered via the seatbelt baseline so they stay visible and can be
725+
// paid down under https://github.com/Expensify/App/issues/98610; this only blocks NEW usages.
724726
{
725727
files: ['**/*.ts', '**/*.tsx'],
726728
plugins: {

‎config/eslint/eslint.seatbelt.tsv‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -883,6 +883,7 @@
883883
"../../src/libs/memoize/cache/ArrayCache.ts" "@typescript-eslint/no-unsafe-type-assertion" 1
884884
"../../src/libs/memoize/index.ts" "@typescript-eslint/no-unsafe-type-assertion" 8
885885
"../../src/libs/memoize/utils.ts" "@typescript-eslint/no-unsafe-type-assertion" 7
886+
"../../src/libs/migrations/MoveFilesOutOfDocuments/index.native.ts" "@typescript-eslint/no-restricted-imports" 1
886887
"../../src/libs/models/BankAccount.ts" "@typescript-eslint/no-unsafe-type-assertion" 1
887888
"../../src/libs/prepareRequestPayload/index.native.ts" "@typescript-eslint/no-unsafe-type-assertion" 5
888889
"../../src/libs/prepareRequestPayload/index.ts" "@typescript-eslint/no-unsafe-type-assertion" 1
@@ -1382,28 +1383,41 @@
13821383
"../../tests/actions/IOUTest/TrackExpenseTest.ts" "no-restricted-imports" 1
13831384
"../../tests/actions/IOUTest/UpdateMoneyRequestTest.ts" "no-restricted-imports" 1
13841385
"../../tests/actions/OdometerTransactionUtilsTest.ts" "no-restricted-imports" 1
1386+
"../../tests/actions/OnyxUpdateManagerTest.ts" "@typescript-eslint/no-restricted-imports" 1
1387+
"../../tests/actions/PolicyCategoryTest.ts" "@typescript-eslint/no-restricted-imports" 1
13851388
"../../tests/actions/PolicyProfileTest.ts" "no-restricted-imports" 1
1389+
"../../tests/actions/PolicyTagTest.ts" "@typescript-eslint/no-restricted-imports" 1
13861390
"../../tests/actions/PolicyTest.ts" "no-restricted-imports" 1
13871391
"../../tests/actions/ReportFieldTest.ts" "no-restricted-imports" 1
13881392
"../../tests/actions/ReportPreviewActionUtilsTest.ts" "no-restricted-imports" 2
1393+
"../../tests/actions/ReportTest.ts" "@typescript-eslint/no-restricted-imports" 1
13891394
"../../tests/actions/ReportTest.ts" "no-restricted-imports" 1
13901395
"../../tests/actions/TaskTest.ts" "no-restricted-imports" 1
13911396
"../../tests/actions/TransactionTest.ts" "no-restricted-imports" 1
13921397
"../../tests/ui/ComposerTest.tsx" "rulesdir/no-raw-typography" 1
13931398
"../../tests/ui/MoneyRequestReportPreview.test.tsx" "no-restricted-imports" 1
1399+
"../../tests/ui/UnreadIndicatorsTest.tsx" "@typescript-eslint/no-restricted-imports" 1
13941400
"../../tests/ui/WorkspaceMoreFeaturesPageTest.tsx" "no-restricted-imports" 1
13951401
"../../tests/ui/components/Button.tsx" "no-restricted-imports" 1
1402+
"../../tests/ui/components/IOURequestStepConfirmationPageTest.tsx" "@typescript-eslint/no-restricted-imports" 1
13961403
"../../tests/unit/FormulaTest.ts" "no-restricted-imports" 1
13971404
"../../tests/unit/HomePage/YourSpendSection/useYourSpendDataTest.ts" "no-restricted-imports" 1
13981405
"../../tests/unit/IOUUtilsTest.ts" "no-restricted-imports" 1
13991406
"../../tests/unit/ModifiedExpenseMessageTest.ts" "no-restricted-imports" 1
1407+
"../../tests/unit/OnyxDerivedSelfHealTest.ts" "@typescript-eslint/no-restricted-imports" 1
1408+
"../../tests/unit/OnyxDerivedTest.tsx" "@typescript-eslint/no-restricted-imports" 1
1409+
"../../tests/unit/PersistedRequests.ts" "@typescript-eslint/no-restricted-imports" 1
14001410
"../../tests/unit/QuickActionUtilsTest.ts" "no-restricted-imports" 2
14011411
"../../tests/unit/ReportPrimaryActionUtilsTest.ts" "no-restricted-imports" 1
14021412
"../../tests/unit/ReportSecondaryActionUtilsTest.ts" "no-restricted-imports" 2
14031413
"../../tests/unit/ReportTitleUtilsTest.ts" "no-restricted-imports" 1
14041414
"../../tests/unit/ReportUtilsTest.ts" "no-restricted-imports" 1
1415+
"../../tests/unit/SearchAutocompleteListTest.tsx" "@typescript-eslint/no-restricted-imports" 1
14051416
"../../tests/unit/SidebarUtilsTest.ts" "no-restricted-imports" 1
1417+
"../../tests/unit/TransactionTest.ts" "@typescript-eslint/no-restricted-imports" 1
1418+
"../../tests/unit/WorkspacesSettingsUtilsTest.ts" "@typescript-eslint/no-restricted-imports" 1
14061419
"../../tests/unit/canEditFieldOfMoneyRequestTest.ts" "@typescript-eslint/no-deprecated/randomReportAction.originalMessage" 3
1420+
"../../tests/unit/canEditFieldOfMoneyRequestTest.ts" "@typescript-eslint/no-restricted-imports" 1
14071421
"../../tests/unit/components/HTMLEngineProvider/VictoryChartAttributesParsers.test.ts" "rulesdir/no-raw-typography" 1
14081422
"../../tests/unit/navigateAfterOnboardingTest.ts" "no-restricted-imports" 1
14091423
"../../tests/unit/navigateToWorkspacesPageTest.ts" "no-restricted-imports" 1

‎src/libs/migrations/MoveFilesOutOfDocuments/index.native.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import type {OnyxCollection} from 'react-native-onyx';
99

1010
import RNFS from 'react-native-fs';
1111
import Onyx from 'react-native-onyx';
12-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- pre-existing usage, tracked for removal in https://github.com/Expensify/App/issues/98610
1312
import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
1413

1514
const OLD_ATTACHMENT_DIR = `${RNFS.DocumentDirectoryPath}/attachments`;

‎tests/actions/OnyxUpdateManagerTest.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ import type * as OnyxTypes from '@src/types/onyx';
1515
import type {OnyxEntry} from 'react-native-onyx';
1616

1717
import Onyx from 'react-native-onyx';
18-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- pre-existing usage, tracked for removal in https://github.com/Expensify/App/issues/98610
1918
import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
2019

2120
import createMock from '../utils/createMock';

‎tests/actions/PolicyCategoryTest.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import ONYXKEYS from '@src/ONYXKEYS';
2222
import type {Policy, PolicyCategory} from '@src/types/onyx';
2323

2424
import Onyx from 'react-native-onyx';
25-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- pre-existing usage, tracked for removal in https://github.com/Expensify/App/issues/98610
2625
import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
2726

2827
import type {MockFetch} from '../utils/TestHelper';

‎tests/actions/PolicyTagTest.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import ONYXKEYS from '@src/ONYXKEYS';
3030
import type {PolicyTagLists, PolicyTags, RecentlyUsedTags} from '@src/types/onyx';
3131

3232
import Onyx from 'react-native-onyx';
33-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- pre-existing usage, tracked for removal in https://github.com/Expensify/App/issues/98610
3433
import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
3534

3635
import type {MockFetch} from '../utils/TestHelper';

‎tests/actions/ReportTest.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,6 @@ import type {OnyxCollection, OnyxEntry, OnyxUpdate} from 'react-native-onyx';
4747
import {addSeconds, format, subMinutes} from 'date-fns';
4848
import {toZonedTime} from 'date-fns-tz';
4949
import Onyx from 'react-native-onyx';
50-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- pre-existing usage, tracked for removal in https://github.com/Expensify/App/issues/98610
5150
import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
5251

5352
import type {MockFetch} from '../utils/TestHelper';

‎tests/ui/UnreadIndicatorsTest.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import {toZonedTime} from 'date-fns-tz';
2626
import React from 'react';
2727
import {AppState, DeviceEventEmitter} from 'react-native';
2828
import Onyx from 'react-native-onyx';
29-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- pre-existing usage, tracked for removal in https://github.com/Expensify/App/issues/98610
3029
import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
3130

3231
import type {NativeNavigationMock} from '../../__mocks__/@react-navigation/native';

‎tests/ui/components/IOURequestStepConfirmationPageTest.tsx‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import type {OnyxEntry} from 'react-native-onyx';
2121

2222
import React from 'react';
2323
import Onyx from 'react-native-onyx';
24-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- pre-existing usage, tracked for removal in https://github.com/Expensify/App/issues/98610
2524
import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
2625

2726
import * as MoneyRequest from '../../../src/libs/actions/IOU/MoneyRequest';

‎tests/unit/OnyxDerivedSelfHealTest.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import ONYXKEYS from '@src/ONYXKEYS';
66
import type {Transaction} from '@src/types/onyx';
77

88
import Onyx from 'react-native-onyx';
9-
// eslint-disable-next-line @typescript-eslint/no-restricted-imports -- pre-existing usage, tracked for removal in https://github.com/Expensify/App/issues/98610
109
import OnyxUtils from 'react-native-onyx/dist/OnyxUtils';
1110

1211
import createRandomTransaction from '../utils/collections/transaction';

0 commit comments

Comments
 (0)