mirror of
https://github.com/inaturalist/iNaturalistReactNative.git
synced 2025-12-23 22:18:36 -05:00
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:
@@ -9,10 +9,10 @@ export default ( {
|
||||
_compressFormat,
|
||||
_quality,
|
||||
_rotation,
|
||||
outputPath
|
||||
outputPath,
|
||||
) => {
|
||||
const filename = mockNodePath.basename( path );
|
||||
return { uri: mockNodePath.join( outputPath, filename ) };
|
||||
}
|
||||
)
|
||||
},
|
||||
),
|
||||
} );
|
||||
|
||||
@@ -6,7 +6,7 @@ export const CameraRoll = {
|
||||
resolve( {
|
||||
page_info: {
|
||||
end_cursor: jest.fn( ),
|
||||
has_next_page: false
|
||||
has_next_page: false,
|
||||
},
|
||||
edges: [
|
||||
{
|
||||
@@ -20,16 +20,16 @@ export const CameraRoll = {
|
||||
width: 1080,
|
||||
fileSize: 123456,
|
||||
playableDuration: NaN,
|
||||
orientation: 1
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
orientation: 1,
|
||||
},
|
||||
},
|
||||
},
|
||||
],
|
||||
} );
|
||||
} ) ),
|
||||
getAlbums: jest.fn( ( ) => ( {
|
||||
// Expecting album titles as keys and photo counts as values
|
||||
// "My Amazing album": 12
|
||||
} ) ),
|
||||
save: jest.fn( ( _uri, _options = {} ) => mockFaker.system.filePath( ) )
|
||||
save: jest.fn( ( _uri, _options = {} ) => mockFaker.system.filePath( ) ),
|
||||
};
|
||||
|
||||
@@ -3,6 +3,6 @@ export default ( {
|
||||
watchPosition: jest.fn( ( ) => 0 ),
|
||||
clearWatch: jest.fn( ),
|
||||
setRNConfiguration: jest.fn( ( ) => ( {
|
||||
skipPermissionRequests: true
|
||||
} ) )
|
||||
skipPermissionRequests: true,
|
||||
} ) ),
|
||||
} );
|
||||
|
||||
@@ -13,11 +13,11 @@ const useNavigation = ( ) => ( {
|
||||
addListener: jest.fn( ),
|
||||
canGoBack: jest.fn( ( ) => true ),
|
||||
goBack: jest.fn( ),
|
||||
setOptions: jest.fn( )
|
||||
setOptions: jest.fn( ),
|
||||
} );
|
||||
|
||||
module.exports = {
|
||||
...actualNav,
|
||||
useNavigation,
|
||||
useRoute
|
||||
useRoute,
|
||||
};
|
||||
|
||||
@@ -2,5 +2,5 @@ export default ( {
|
||||
OAUTH_CLIENT_ID: process.env.OAUTH_CLIENT_ID,
|
||||
OAUTH_CLIENT_SECRET: process.env.OAUTH_CLIENT_SECRET,
|
||||
JWT_ANONYMOUS_API_SECRET: process.env.JWT_ANONYMOUS_API_SECRET,
|
||||
API_URL: process.env.API_URL
|
||||
API_URL: process.env.API_URL,
|
||||
} );
|
||||
|
||||
@@ -9,15 +9,15 @@ module.exports = {
|
||||
copyFile: async ( ) => "testdata",
|
||||
copyAssetsFileIOS: async ( ) => "testdata",
|
||||
stat: jest.fn( ( ) => ( {
|
||||
mtime: new Date()
|
||||
mtime: new Date(),
|
||||
} ) ),
|
||||
readFile: jest.fn( ( ) => "testdata" ),
|
||||
readDir: jest.fn( async ( ) => ( [
|
||||
{
|
||||
ctime: new Date(),
|
||||
mtime: new Date(),
|
||||
name: "testdata"
|
||||
}
|
||||
name: "testdata",
|
||||
},
|
||||
] ) ),
|
||||
writeFile: jest.fn( async ( filePath, contents, _encoding ) => {
|
||||
mockFs.writeFile( filePath, contents, jest.fn( ) );
|
||||
@@ -29,5 +29,5 @@ module.exports = {
|
||||
if ( !path ) return;
|
||||
if ( typeof ( path ) !== "string" ) return;
|
||||
mockFs.unlink( path, jest.fn( ) );
|
||||
} )
|
||||
} ),
|
||||
};
|
||||
|
||||
@@ -3,6 +3,6 @@ export default ( {
|
||||
`Somewhere near ${coord.lat}, ${coord.lng}`,
|
||||
"Somewhere",
|
||||
"Somewheria",
|
||||
"SW"
|
||||
] )
|
||||
"SW",
|
||||
] ),
|
||||
} );
|
||||
|
||||
@@ -3,5 +3,5 @@
|
||||
module.exports = {
|
||||
KeyboardAwareScrollView: jest
|
||||
.fn( )
|
||||
.mockImplementation( ( { children } ) => children )
|
||||
.mockImplementation( ( { children } ) => children ),
|
||||
};
|
||||
|
||||
@@ -2,5 +2,5 @@ export const useDeviceOrientationChange = jest.fn();
|
||||
|
||||
export default ( {
|
||||
lockToPortrait: jest.fn( ),
|
||||
unlockAllOrientations: jest.fn( )
|
||||
unlockAllOrientations: jest.fn( ),
|
||||
} );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
const actualPaper = jest.requireActual( "react-native-paper" );
|
||||
module.exports = {
|
||||
...actualPaper,
|
||||
Portal: ( { children } ) => children
|
||||
Portal: ( { children } ) => children,
|
||||
};
|
||||
|
||||
@@ -54,7 +54,7 @@ class RNSInfo {
|
||||
|
||||
if ( service?.size ) {
|
||||
mappedValues = Array.from( service.entries() ).map(
|
||||
( [key, value] ) => ( { key, value, service: serviceName } )
|
||||
( [key, value] ) => ( { key, value, service: serviceName } ),
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ const ShareMenu = {
|
||||
__reset: ( ) => {
|
||||
mockShareData = null;
|
||||
mockListeners = [];
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
export default ShareMenu;
|
||||
|
||||
@@ -3,7 +3,7 @@ import {
|
||||
mockSortDevices,
|
||||
mockUseCameraDevice,
|
||||
mockUseCameraDevices,
|
||||
mockUseCameraFormat
|
||||
mockUseCameraFormat,
|
||||
} from "tests/vision-camera/vision-camera";
|
||||
|
||||
export const Camera = mockCamera;
|
||||
@@ -12,6 +12,6 @@ export const useCameraDevice = mockUseCameraDevice;
|
||||
export const useCameraDevices = mockUseCameraDevices;
|
||||
export const useCameraFormat = mockUseCameraFormat;
|
||||
export const VisionCameraProxy = {
|
||||
initFrameProcessorPlugin: jest.fn( )
|
||||
initFrameProcessorPlugin: jest.fn( ),
|
||||
};
|
||||
export const useFrameProcessor = jest.fn( );
|
||||
|
||||
@@ -2,6 +2,6 @@ export const useSharedValue = jest.fn();
|
||||
export const Worklets = {
|
||||
createRunOnJS: jest.fn(),
|
||||
defaultContext: {
|
||||
createRunAsync: jest.fn()
|
||||
}
|
||||
createRunAsync: jest.fn(),
|
||||
},
|
||||
};
|
||||
|
||||
@@ -1,21 +1,21 @@
|
||||
export const getPredictionsForImage = jest.fn( () => Promise.resolve( {
|
||||
predictions: [],
|
||||
commonAncestor: undefined
|
||||
commonAncestor: undefined,
|
||||
} ) );
|
||||
export const getPredictionsForLocation = jest.fn( () => Promise.resolve( { predictions: [] } ) );
|
||||
export const removeLogListener = jest.fn( );
|
||||
export const resetStoredResults = jest.fn( );
|
||||
export const getCellLocation = jest.fn( location => ( {
|
||||
...location,
|
||||
elevation: 12
|
||||
elevation: 12,
|
||||
} ) );
|
||||
|
||||
export const MODE = {
|
||||
BEST_BRANCH: "BEST_BRANCH",
|
||||
COMMON_ANCESTOR: "COMMON_ANCESTOR"
|
||||
COMMON_ANCESTOR: "COMMON_ANCESTOR",
|
||||
};
|
||||
|
||||
export const COMMON_ANCESTOR_RANK_TYPE = {
|
||||
MAJOR: "major",
|
||||
UNRESTRICTED: "unrestricted"
|
||||
UNRESTRICTED: "unrestricted",
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user