Browse Source

@typescript-eslint/no-empty-function fix

Leszek Wiesner 4 years ago
parent
commit
0b64ddfa0f

+ 2 - 2
pioneer/packages/joy-media/src/music/MusicTrackPreview.tsx

@@ -23,8 +23,8 @@ export function MusicTrackPreview (props: EditableMusicTrackPreviewProps) {
   const {
     withActionLabels = false,
     selected = false,
-    onEdit = () => {},
-    onRemove = () => {}
+    onEdit = () => { /* do nothing */ },
+    onRemove = () => { /* do nothing */ }
   } = props;
 
   const [checked, setChecked] = useState(selected);

+ 1 - 1
pioneer/packages/joy-media/src/music/ReorderableTracks.tsx

@@ -20,7 +20,7 @@ type Props = {
 type OrderableItem = EditableMusicTrackPreviewProps;
 
 export const ReorderableTracks = (props: Props) => {
-  const { tracks = [], onRemove = () => {}, noTracksView = null } = props;
+  const { tracks = [], onRemove = () => { /* do nothing */ }, noTracksView = null } = props;
 
   const [items, setItems] = useState(tracks);
 

+ 1 - 1
pioneer/packages/joy-media/src/transport.ts

@@ -67,7 +67,7 @@ export abstract class MediaTransport extends Transport {
 
   protected abstract notImplementedYet<T> (): T
 
-  clearSessionCache (): void {}
+  clearSessionCache (): void { /* not implemented */ }
 
   openSession (): void {
     this.sessionId++;

+ 2 - 2
pioneer/packages/joy-roles/src/flows/apply.elements.stories.tsx

@@ -478,7 +478,7 @@ export function StageBApplicationDetails () {
     }, 'Application questions'),
     data: data,
     setData: setData,
-    nextTransition: () => { }
+    nextTransition: () => { /* do nothing */ }
   };
 
   return (
@@ -497,7 +497,7 @@ export function StageBApplicationDetails () {
 
 export function StageCSubmitApplication () {
   const props: SubmitApplicationStageProps = {
-    nextTransition: () => { },
+    nextTransition: () => { /* do nothing */ },
     applications: applications,
     transactionFee: new u128(number('Transaction fee', 500, moneySliderOptions, 'Application Tx')),
     transactionDetails: new Map<string, string>([

+ 7 - 7
pioneer/packages/joy-roles/src/tabs/MyRoles.elements.stories.tsx

@@ -175,7 +175,7 @@ const permutations: (ApplicationProps & TestProps)[] = [
     opening: opening,
     applicationStake: new u128(5),
     roleStake: new u128(15),
-    cancelCallback: () => { },
+    cancelCallback: () => { /* do nothing */ },
     rank: 15,
     capacity: 20
   },
@@ -195,7 +195,7 @@ const permutations: (ApplicationProps & TestProps)[] = [
     opening: opening,
     applicationStake: new u128(5),
     roleStake: new u128(15),
-    cancelCallback: () => { },
+    cancelCallback: () => { /* do nothing */ },
     rank: 21,
     capacity: 20
   },
@@ -217,7 +217,7 @@ const permutations: (ApplicationProps & TestProps)[] = [
     opening: opening,
     applicationStake: new u128(5),
     roleStake: new u128(15),
-    cancelCallback: () => { },
+    cancelCallback: () => { /* do nothing */ },
     rank: 15,
     capacity: 20
   },
@@ -239,7 +239,7 @@ const permutations: (ApplicationProps & TestProps)[] = [
     opening: opening,
     applicationStake: new u128(5),
     roleStake: new u128(15),
-    cancelCallback: () => { },
+    cancelCallback: () => { /* do nothing */ },
     rank: 21,
     capacity: 20
   },
@@ -259,7 +259,7 @@ const permutations: (ApplicationProps & TestProps)[] = [
     opening: opening,
     applicationStake: new u128(5),
     roleStake: new u128(15),
-    cancelCallback: () => { },
+    cancelCallback: () => { /* do nothing */ },
     rank: 21,
     capacity: 20
   },
@@ -279,7 +279,7 @@ const permutations: (ApplicationProps & TestProps)[] = [
     opening: opening,
     applicationStake: new u128(5),
     roleStake: new u128(15),
-    cancelCallback: () => { },
+    cancelCallback: () => { /* do nothing */ },
     rank: 21,
     capacity: 20,
     cancelledReason: CancelledReason.HirerCancelledOpening
@@ -300,7 +300,7 @@ export function ApplicationFragment () {
 }
 
 export function ApplicationsFragment () {
-  const cancelCallback = () => { };
+  const cancelCallback = () => { /* do nothing */ };
   return (
     <Container className="outer my-roles">
       <Applications applications={permutations} cancelCallback={cancelCallback} />

+ 3 - 1
pioneer/packages/joy-roles/src/transport.mock.ts

@@ -435,7 +435,7 @@ export class Transport extends TransportBase implements ITransport {
   }
 
   myStorageGroupRoles (): Subscribable<ActiveRole[]> {
-    return new Observable<ActiveRole[]>(observer => { });
+    return new Observable<ActiveRole[]>(observer => { /* do nothing */ });
   }
 
   async applyToCuratorOpening (
@@ -449,8 +449,10 @@ export class Transport extends TransportBase implements ITransport {
   }
 
   leaveCurationRole (sourceAccount: string, id: number, rationale: string) {
+    /* do nothing */
   }
 
   withdrawCuratorApplication (sourceAccount: string, id: number) {
+    /* do nothing */
   }
 }

+ 1 - 3
pioneer/packages/joy-roles/src/transport.substrate.ts

@@ -561,9 +561,7 @@ export class Transport extends TransportBase implements ITransport {
   }
 
   myStorageGroupRoles (): Subscribable<ActiveRole[]> {
-    return new Observable<ActiveRole[]>(observer => {
-    }
-    );
+    return new Observable<ActiveRole[]>(observer => { /* do nothing */ });
   }
 
   protected generateRoleAccount (name: string, password = ''): string | null {

+ 1 - 1
pioneer/packages/joy-utils/src/APIQueryCache.ts

@@ -16,7 +16,7 @@ type cacheQueryRuntime = {
 export class APIQueryCache {
   protected api: ApiPromise
   protected cache: Map<string, Codec>
-  protected unsubscribeFn: () => void = () => { }
+  protected unsubscribeFn: () => void = () => { /* do nothing */ }
   protected cacheHits = 0
   public query: cacheQueryRuntime = {}
 

+ 0 - 1
pioneer/packages/joy-utils/src/memoize.ts

@@ -45,7 +45,6 @@ function getNewFunction (originalMethod: () => void) {
   };
 }
 
-
 export function memoize () {
   return (target: Record<string, any>, propertyKey: string, descriptor: TypedPropertyDescriptor<any>) => {
     descriptor.value = getNewFunction(descriptor.value);

+ 1 - 1
pioneer/packages/react-components/src/InputFile.tsx

@@ -37,7 +37,7 @@ interface FileState {
 
 const BYTE_STR_0 = '0'.charCodeAt(0);
 const BYTE_STR_X = 'x'.charCodeAt(0);
-const NOOP = (): void => {};
+const NOOP = (): void => { /* do nothing */ };
 
 function convertResult (result: ArrayBuffer, convertHex?: boolean): Uint8Array {
   const data = new Uint8Array(result);

+ 1 - 1
pioneer/packages/react-components/src/Messages.tsx

@@ -26,7 +26,7 @@ export interface Props extends I18nProps {
   withConstructors?: boolean;
 }
 
-const NOOP = (): void => {};
+const NOOP = (): void => { /* do nothing */ };
 
 function onSelect (props: Props, messageIndex: number): () => void {
   return function (): void {