lint rule & autofix for "trailing comma" (#3299)

* (lint) MOB-1063 enforce trailing commas

* autofix trailing commas

* manually fix newly introduced maxlen violations

* add trailing comma convention to i18n build
This commit is contained in:
Ryan Stelly authored and GitHub committed 2025-12-22 20:17:13 -06:00
1 parent 4d49e3f6aa
commit b78be9243d
778 files changed
+5646 -5636

No files matched your search

@@ -40,7 +40,7 @@ describe( "errorHandling", ( ) => {
const { recoveryPossible, recoveryBy } = handleUploadError(
recoverableError,
t
t,
);
expect( recoveryPossible ).toBe( true );
@@ -52,8 +52,8 @@ describe( "errorHandling", ( ) => {
apiError.json = {
errors: [
{ message: "First error" },
{ message: "Second error" }
]
{ message: "Second error" },
],
};
const { message } = handleUploadError( apiError, t );
@@ -65,8 +65,8 @@ describe( "errorHandling", ( ) => {
const apiError = new Error( "API Error" );
apiError.json = {
errors: [
{ message: { errors: ["Error 1", "Error 2"] } }
]
{ message: { errors: ["Error 1", "Error 2"] } },
],
};
const { message } = handleUploadError( apiError, t );
@@ -79,8 +79,8 @@ describe( "errorHandling", ( ) => {
const apiError = new Error( "API Error" );
apiError.json = {
errors: [
{ message: { errors: "Nested error message string" } }
]
{ message: { errors: "Nested error message string" } },
],
};
const { message } = handleUploadError( apiError, t );
@@ -92,8 +92,8 @@ describe( "errorHandling", ( ) => {
const apiError = new Error( "API Error" );
apiError.json = {
errors: [
{ message: { error: "Resource was previously deleted" } }
]
{ message: { error: "Resource was previously deleted" } },
],
};
const { message } = handleUploadError( apiError, t );
@@ -31,7 +31,7 @@ describe( "progressTracker", ( ) => {
cleanup = mockForTesting( {
emit: emitMock,
addEventListener: addEventListenerMock,
removeEventListener: removeEventListenerMock
removeEventListener: removeEventListenerMock,
} );
} );
@@ -48,7 +48,7 @@ describe( "progressTracker", ( ) => {
expect( emitMock ).toHaveBeenCalledWith(
progressTracker.INCREMENT_SINGLE_UPLOAD_PROGRESS,
[observationUUID, increment]
[observationUUID, increment],
);
} );
@@ -59,7 +59,7 @@ describe( "progressTracker", ( ) => {
expect( emitMock ).toHaveBeenCalledWith(
progressTracker.INCREMENT_SINGLE_UPLOAD_PROGRESS,
[observationUUID, undefined]
[observationUUID, undefined],
);
} );
@@ -81,14 +81,14 @@ describe( "progressTracker", ( ) => {
start( );
expect( emitMock ).toHaveBeenCalledWith(
progressTracker.INCREMENT_SINGLE_UPLOAD_PROGRESS,
[observationUUID, progressTracker.HALF_INCREMENT]
[observationUUID, progressTracker.HALF_INCREMENT],
);
complete( );
expect( emitMock ).toHaveBeenCalledTimes( 2 );
expect( emitMock ).toHaveBeenLastCalledWith(
progressTracker.INCREMENT_SINGLE_UPLOAD_PROGRESS,
[observationUUID, progressTracker.HALF_INCREMENT]
[observationUUID, progressTracker.HALF_INCREMENT],
);
} );
@@ -99,14 +99,14 @@ describe( "progressTracker", ( ) => {
uploaded( );
expect( emitMock ).toHaveBeenCalledWith(
progressTracker.INCREMENT_SINGLE_UPLOAD_PROGRESS,
[observationUUID, progressTracker.HALF_INCREMENT]
[observationUUID, progressTracker.HALF_INCREMENT],
);
attached( );
expect( emitMock ).toHaveBeenCalledTimes( 2 );
expect( emitMock ).toHaveBeenLastCalledWith(
progressTracker.INCREMENT_SINGLE_UPLOAD_PROGRESS,
[observationUUID, progressTracker.HALF_INCREMENT]
[observationUUID, progressTracker.HALF_INCREMENT],
);
} );
} );
+3 -3
View File
@@ -24,16 +24,16 @@ describe( "markRecordUploaded", () => {
_synced_at: null,
needs_sync: true,
observationPhotos: [mockObsPhoto],
observationSounds: [mockObsSound]
observationSounds: [mockObsSound],
};
mockResponse = {
results: [{ id: 12345 }]
results: [{ id: 12345 }],
};
mockRealm = {
isClosed: false,
objectForPrimaryKey: jest.fn().mockReturnValue( mockObservation )
objectForPrimaryKey: jest.fn().mockReturnValue( mockObservation ),
};
// Mock the safeRealmWrite implementation