Repository: jhipster/jhipster-lite
Pull request #10849 (2024-09-15 08:22:23)

ci-tests: Run linter on generated apps


Patch:
diff --git a/.github/workflows/github-actions.yml b/.github/workflows/github-actions.yml
index 1f0e0d934..af6d52723 100644
--- a/.github/workflows/github-actions.yml
+++ b/.github/workflows/github-actions.yml
@@ -446,6 +446,15 @@ jobs:
             npm install
             npm test
           fi
+      - name: 'Test: run linter for ${{ matrix.app }}'
+        if: steps.tests-requirement-check.outputs.execute_tests == 'true'
+        working-directory: /tmp/jhlite/${{ matrix.app }}/
+        run: |
+          if grep -q '"lint":' package.json; then
+            npm run lint
+          else
+            echo "No lint script in package.json found, skipping step."
+          fi
       - name: 'Test: frontend component-tests for ${{ matrix.app }}'
         if: steps.tests-requirement-check.outputs.execute_tests == 'true'
         working-directory: /tmp/jhlite/${{ matrix.app }}/
diff --git a/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java
index f42fa84cd..1e2bd401c 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactory.java
@@ -19,7 +19,7 @@ public class CypressModuleFactory {
   private static final JHipsterDestination CYPRESS_COMPONENT_TESTS = to("src/test/webapp/component");
   private static final JHipsterDestination CYPRESS_E2E_TESTS = to("src/test/webapp/e2e");
 
-  private static final String HOME = "home";
+  private static final String PRIMARY_APP = "common/primary/app";
   private static final String UTILS = "utils";
 
   private static final String CYPRESS_COMPONENT_TESTS_EXCLUSION = "\"src/test/webapp/component/**/*.ts\"";
@@ -94,7 +94,7 @@ public class CypressModuleFactory {
           .addTemplate("cypress-config.ts")
           .addFile("tsconfig.json")
           .and()
-        .batch(SOURCE.append(HOME), destinationFolder.append(HOME))
+        .batch(SOURCE.append(PRIMARY_APP), destinationFolder.append(PRIMARY_APP))
           .addTemplate("Home.spec.ts")
           .and()
         .batch(SOURCE.append(UTILS), destinationFolder.append(UTILS))
diff --git a/src/main/resources/generator/client/common/cypress/home/Home.spec.ts.mustache b/src/main/resources/generator/client/common/cypress/common/primary/app/Home.spec.ts.mustache
similarity index 100%
rename from src/main/resources/generator/client/common/cypress/home/Home.spec.ts.mustache
rename to src/main/resources/generator/client/common/cypress/common/primary/app/Home.spec.ts.mustache
diff --git a/src/main/resources/generator/typescript/eslint.config.js.mustache b/src/main/resources/generator/typescript/eslint.config.js.mustache
index 1dbd6fc1f..d4ee4af88 100644
--- a/src/main/resources/generator/typescript/eslint.config.js.mustache
+++ b/src/main/resources/generator/typescript/eslint.config.js.mustache
@@ -22,16 +22,6 @@ export default typescript.config(
     },
     rules: {
       quotes: ['error', 'single', { avoidEscape: true }],
-      'comma-dangle': [
-        'error',
-        {
-          arrays: 'always-multiline',
-          objects: 'always-multiline',
-          imports: 'always-multiline',
-          exports: 'always-multiline',
-          functions: 'never',
-        },
-      ],
     },
   },
 );


Test patch:
diff --git a/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java
index 645f1878b..7509d6f90 100644
--- a/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/client/tools/cypress/domain/CypressModuleFactoryTest.java
@@ -100,7 +100,7 @@ class CypressModuleFactoryTest {
         .containing("specPattern: 'src/test/webapp/component/**/*.(spec|cy).ts',")
         .and()
         .hasPrefixedFiles("src/test/webapp/component", "tsconfig.json")
-        .hasFiles("src/test/webapp/component/home/Home.spec.ts")
+        .hasFiles("src/test/webapp/component/common/primary/app/Home.spec.ts")
         .hasPrefixedFiles("src/test/webapp/component/utils", "Interceptor.ts", "DataSelector.ts");
     }
   }
@@ -175,7 +175,7 @@ class CypressModuleFactoryTest {
         .containing("specPattern: 'src/test/webapp/e2e/**/*.(spec|cy).ts',")
         .and()
         .hasPrefixedFiles("src/test/webapp/e2e", "tsconfig.json")
-        .hasFiles("src/test/webapp/e2e/home/Home.spec.ts")
+        .hasFiles("src/test/webapp/e2e/common/primary/app/Home.spec.ts")
         .hasPrefixedFiles("src/test/webapp/e2e/utils", "Interceptor.ts", "DataSelector.ts");
     }
   }