Repository: mbonig/state-machine (language: python)

Issue:
fails eslint
the generated files fail eslint checks


Discussion / hints:

Fix patch:
diff --git a/src/BuildStateType.ts b/src/BuildStateType.ts
index efcfd9d..6b97419 100644
--- a/src/BuildStateType.ts
+++ b/src/BuildStateType.ts
@@ -19,7 +19,7 @@ export function buildStateType(stateDef: any, indent = 2) {
       stateType += `${indentTabs}'${safeProp}': string;\n`;
     } else if (Array.isArray(propValue)) {
       const arrayPropTypes = propValue.map(pv => buildStateType(pv, indent + 1));
-      stateType += `${indentTabs}'${safeProp}': Partial<[${arrayPropTypes.join(',')}]>;\n`;
+      stateType += `${indentTabs}'${safeProp}': Partial<[${arrayPropTypes.join(', ')}]>;\n`;
     } else {
       stateType += `${indentTabs}'${safeProp}': ${buildStateType(propValue, indent + 1)};\n`;
     }
diff --git a/src/StepFunctionsAutoDiscover.ts b/src/StepFunctionsAutoDiscover.ts
index b8ccc8b..341e2fd 100644
--- a/src/StepFunctionsAutoDiscover.ts
+++ b/src/StepFunctionsAutoDiscover.ts
@@ -117,10 +117,10 @@ export class StepFunctionsStateMachine extends Component {
     if (src.marker) {
       src.line(`// ${src.marker}`);
     }
-    src.line('import { StateMachine, StateMachineProps } from \'@matthewbonig/state-machine\';');
-    src.line('import { Construct } from \'constructs\';');
     src.line('import fs from \'fs\';');
     src.line('import path from \'path\';');
+    src.line('import { StateMachine, StateMachineProps } from \'@matthewbonig/state-machine\';');
+    src.line('import { Construct } from \'constructs\';');
 
     let isYaml = /(yaml|yml)/.test(extension);
     if (isYaml) {


Test patch:
diff --git a/test/__snapshots__/StateMachineAutoDiscover.test.ts.snap b/test/__snapshots__/StateMachineAutoDiscover.test.ts.snap
index d61d653..b544b9c 100644
--- a/test/__snapshots__/StateMachineAutoDiscover.test.ts.snap
+++ b/test/__snapshots__/StateMachineAutoDiscover.test.ts.snap
@@ -2,10 +2,10 @@
 
 exports[`Extension parameter takes another extension 1`] = `
 "// ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".
-import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
-import { Construct } from 'constructs';
 import fs from 'fs';
 import path from 'path';
+import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
+import { Construct } from 'constructs';
 export interface TestStateMachineOverrides {
   readonly 'Which database?': Partial<{
     'Type': string;
@@ -13,11 +13,11 @@ export interface TestStateMachineOverrides {
       'Variable': string;
       'StringMatches': string;
       'Next': string;
-    }>,Partial<{
+    }>, Partial<{
       'Variable': string;
       'StringMatches': string;
       'Next': string;
-    }>,Partial<{
+    }>, Partial<{
       'Variable': string;
       'StringMatches': string;
       'Next': string;
@@ -48,7 +48,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -73,7 +73,7 @@ export interface TestStateMachineOverrides {
       }>;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -128,7 +128,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -153,7 +153,7 @@ export interface TestStateMachineOverrides {
       }>;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -208,7 +208,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -233,7 +233,7 @@ export interface TestStateMachineOverrides {
       }>;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -279,10 +279,10 @@ export class TestStateMachine extends StateMachine {
 
 exports[`Json more complex case 1`] = `
 "// ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".
-import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
-import { Construct } from 'constructs';
 import fs from 'fs';
 import path from 'path';
+import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
+import { Construct } from 'constructs';
 export interface TestStateMachineOverrides {
   readonly 'Get Pod To Execute On': Partial<{
     'Type': string;
@@ -290,11 +290,11 @@ export interface TestStateMachineOverrides {
     'Parameters': Partial<{
       'FunctionName': string;
       'Payload': Partial<{
-        'commands': Partial<[string,string,string,string]>;
+        'commands': Partial<[string, string, string, string]>;
       }>;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -318,7 +318,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -344,7 +344,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -365,7 +365,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -387,7 +387,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -412,10 +412,10 @@ export class TestStateMachine extends StateMachine {
 
 exports[`Json simple case 1`] = `
 "// ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".
-import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
-import { Construct } from 'constructs';
 import fs from 'fs';
 import path from 'path';
+import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
+import { Construct } from 'constructs';
 export interface TestStateMachineOverrides {
   readonly 'Which database?': Partial<{
     'Type': string;
@@ -423,11 +423,11 @@ export interface TestStateMachineOverrides {
       'Variable': string;
       'StringMatches': string;
       'Next': string;
-    }>,Partial<{
+    }>, Partial<{
       'Variable': string;
       'StringMatches': string;
       'Next': string;
-    }>,Partial<{
+    }>, Partial<{
       'Variable': string;
       'StringMatches': string;
       'Next': string;
@@ -458,7 +458,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -483,7 +483,7 @@ export interface TestStateMachineOverrides {
       }>;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -538,7 +538,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -563,7 +563,7 @@ export interface TestStateMachineOverrides {
       }>;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -618,7 +618,7 @@ export interface TestStateMachineOverrides {
       'FunctionName': string;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -643,7 +643,7 @@ export interface TestStateMachineOverrides {
       }>;
     }>;
     'Retry': Partial<[Partial<{
-      'ErrorEquals': Partial<[string,string,string]>;
+      'ErrorEquals': Partial<[string, string, string]>;
       'IntervalSeconds': number;
       'MaxAttempts': number;
       'BackoffRate': number;
@@ -689,10 +689,10 @@ export class TestStateMachine extends StateMachine {
 
 exports[`yaml handles yaml file 1`] = `
 "// ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".
-import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
-import { Construct } from 'constructs';
 import fs from 'fs';
 import path from 'path';
+import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
+import { Construct } from 'constructs';
 import * as yaml from 'js-yaml';
 export interface TestStateMachineOverrides {
   readonly 'Check Stock Price': Partial<{
@@ -725,7 +725,7 @@ export interface TestStateMachineOverrides {
       'Variable': string;
       'StringEquals': string;
       'Next': string;
-    }>,Partial<{
+    }>, Partial<{
       'Variable': string;
       'StringEquals': string;
       'Next': string;
@@ -770,10 +770,10 @@ export class TestStateMachine extends StateMachine {
 
 exports[`yaml handles yml file 1`] = `
 "// ~~ Generated by projen. To modify, edit .projenrc.js and run \\"npx projen\\".
-import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
-import { Construct } from 'constructs';
 import fs from 'fs';
 import path from 'path';
+import { StateMachine, StateMachineProps } from '@matthewbonig/state-machine';
+import { Construct } from 'constructs';
 import * as yaml from 'js-yaml';
 export interface TestStateMachineOverrides {
   readonly 'Check Stock Price': Partial<{
@@ -806,7 +806,7 @@ export interface TestStateMachineOverrides {
       'Variable': string;
       'StringEquals': string;
       'Next': string;
-    }>,Partial<{
+    }>, Partial<{
       'Variable': string;
       'StringEquals': string;
       'Next': string;