Repository: jhipster/jhipster-lite
Pull request #11189 (2024-10-23 18:55:12)

fix: allow applying other front module after vitest config being formatted with prettier
related to #11106


Patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java b/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java
index 9c05f41dc..4be258b86 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactory.java
@@ -1,5 +1,8 @@
 package tech.jhipster.lite.generator.client.react.core.domain;
 
+import static tech.jhipster.lite.generator.typescript.common.domain.EslintShortcuts.eslintTypescriptRule;
+import static tech.jhipster.lite.generator.typescript.common.domain.TsConfigShortcuts.tsConfigCompilerOption;
+import static tech.jhipster.lite.generator.typescript.common.domain.VitestShortcuts.vitestCoverageExclusion;
 import static tech.jhipster.lite.module.domain.JHipsterModule.JHipsterModuleBuilder;
 import static tech.jhipster.lite.module.domain.JHipsterModule.LINE_BREAK;
 import static tech.jhipster.lite.module.domain.JHipsterModule.from;
@@ -19,13 +22,11 @@ import static tech.jhipster.lite.module.domain.npm.JHLiteNpmVersionSource.REACT;
 import static tech.jhipster.lite.module.domain.replacement.ReplacementCondition.always;
 
 import java.util.function.Consumer;
-import tech.jhipster.lite.module.domain.Indentation;
 import tech.jhipster.lite.module.domain.JHipsterModule;
 import tech.jhipster.lite.module.domain.file.JHipsterDestination;
 import tech.jhipster.lite.module.domain.file.JHipsterSource;
 import tech.jhipster.lite.module.domain.npm.NpmLazyInstaller;
 import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties;
-import tech.jhipster.lite.module.domain.replacement.MandatoryReplacer;
 
 public class ReactCoreModulesFactory {
 
@@ -142,10 +143,6 @@ public class ReactCoreModulesFactory {
             .add(
               regex("[ \\t]+quotes: \\['error', 'single', \\{ avoidEscape: true }],"),
               """
-              \t\t\t'react/react-in-jsx-scope': 'off',
-              \t\t\t'@typescript-eslint/no-explicit-any': 'off',
-              \t\t\t'@typescript-eslint/await-thenable': 'off',
-              \t\t\t'@typescript-eslint/consistent-type-imports': 'error',
               \t\t\t'@typescript-eslint/no-misused-promises': [
               \t\t\t\t'error',
               \t\t\t\t{
@@ -155,7 +152,11 @@ public class ReactCoreModulesFactory {
               """.replace("\t", properties.indentation().spaces())
             )
           .and()
-          .and();
+        .and()
+      .apply(eslintTypescriptRule("'@typescript-eslint/consistent-type-imports': 'error'", properties.indentation()))
+      .apply(eslintTypescriptRule("'@typescript-eslint/await-thenable': 'off'", properties.indentation()))
+      .apply(eslintTypescriptRule("'@typescript-eslint/no-explicit-any': 'off'", properties.indentation()))
+      .apply(eslintTypescriptRule("'react/react-in-jsx-scope': 'off'", properties.indentation()));
     //@formatter:on
   }
 
@@ -167,20 +168,15 @@ public class ReactCoreModulesFactory {
       .mandatoryReplacements()
         .in(path("tsconfig.json"))
           .add(text("@tsconfig/recommended/tsconfig.json"), "@tsconfig/vite-react/tsconfig.json")
-          .add(tsConfigCompilerOption("composite", false, properties.indentation()))
-          .add(tsConfigCompilerOption("forceConsistentCasingInFileNames", true, properties.indentation()))
-          .add(tsConfigCompilerOption("allowSyntheticDefaultImports", true, properties.indentation()))
           .add(text(DEFAULT_TSCONFIG_PATH), pathsReplacement)
           .and()
-      .and();
+      .and()
+      .apply(tsConfigCompilerOption("composite", false, properties.indentation()))
+      .apply(tsConfigCompilerOption("forceConsistentCasingInFileNames", true, properties.indentation()))
+      .apply(tsConfigCompilerOption("allowSyntheticDefaultImports", true, properties.indentation()));
     //@formatter:on
   }
 
-  private static MandatoryReplacer tsConfigCompilerOption(String optionName, boolean optionValue, Indentation indentation) {
-    String compilerOption = indentation.times(2) + "\"%s\": %s,".formatted(optionName, optionValue);
-    return new MandatoryReplacer(lineAfterRegex("\"compilerOptions\":"), compilerOption);
-  }
-
   private Consumer<JHipsterModuleBuilder> patchVitestConfig(JHipsterModuleProperties properties) {
     //@formatter:off
     return moduleBuilder -> moduleBuilder
@@ -189,14 +185,10 @@ public class ReactCoreModulesFactory {
           .add(lineAfterRegex("from 'vitest/config';"), "import react from '@vitejs/plugin-react';")
           .add(text("plugins: ["), "plugins: [react(), ")
           .add(text("environment: 'node',"), "environment: 'jsdom',")
-          .add(vitestCoverageExclusion(properties,"src/main/webapp/app/index.tsx"))
-          .add(vitestCoverageExclusion(properties,"src/main/webapp/app/injections.ts"))
-          .and();
+          .and()
+      .and()
+      .apply(vitestCoverageExclusion("src/main/webapp/app/index.tsx"))
+      .apply(vitestCoverageExclusion("src/main/webapp/app/injections.ts"));
     //@formatter:on
   }
-
-  private static MandatoryReplacer vitestCoverageExclusion(JHipsterModuleProperties properties, String filePattern) {
-    Indentation indentation = properties.indentation();
-    return new MandatoryReplacer(lineAfterRegex("configDefaults.coverage.exclude"), indentation.times(4) + "'" + filePattern + "',");
-  }
 }
diff --git a/src/main/java/tech/jhipster/lite/generator/client/react/i18n/domain/ReactI18nModuleFactory.java b/src/main/java/tech/jhipster/lite/generator/client/react/i18n/domain/ReactI18nModuleFactory.java
index 6243dc7f5..e9c191dc1 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/react/i18n/domain/ReactI18nModuleFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/react/i18n/domain/ReactI18nModuleFactory.java
@@ -1,5 +1,6 @@
 package tech.jhipster.lite.generator.client.react.i18n.domain;
 
+import static tech.jhipster.lite.generator.typescript.common.domain.VitestShortcuts.vitestCoverageExclusion;
 import static tech.jhipster.lite.module.domain.JHipsterModule.LINE_BREAK;
 import static tech.jhipster.lite.module.domain.JHipsterModule.append;
 import static tech.jhipster.lite.module.domain.JHipsterModule.from;
@@ -75,10 +76,8 @@ public class ReactI18nModuleFactory {
              });
            });""" )
         .and()
-        .in(path("./vitest.config.ts"))
-          .add(lineAfterText("'src/main/webapp/app/index.tsx',"), properties.indentation().times(4) + "'src/main/webapp/app/i18n.ts',")
-        .and()
       .and()
+      .apply(vitestCoverageExclusion("src/main/webapp/app/i18n.ts"))
       .build();
     //@formatter:off
   }
diff --git a/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java b/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java
index 33e43d96a..ff246820b 100644
--- a/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java
+++ b/src/main/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactory.java
@@ -1,5 +1,8 @@
 package tech.jhipster.lite.generator.client.vue.core.domain;
 
+import static tech.jhipster.lite.generator.typescript.common.domain.EslintShortcuts.eslintTypescriptRule;
+import static tech.jhipster.lite.generator.typescript.common.domain.TsConfigShortcuts.tsConfigCompilerOption;
+import static tech.jhipster.lite.generator.typescript.common.domain.VitestShortcuts.vitestCoverageExclusion;
 import static tech.jhipster.lite.module.domain.JHipsterModule.JHipsterModuleBuilder;
 import static tech.jhipster.lite.module.domain.JHipsterModule.documentationTitle;
 import static tech.jhipster.lite.module.domain.JHipsterModule.from;
@@ -18,13 +21,11 @@ import static tech.jhipster.lite.module.domain.npm.JHLiteNpmVersionSource.COMMON
 import static tech.jhipster.lite.module.domain.npm.JHLiteNpmVersionSource.VUE;
 
 import java.util.function.Consumer;
-import tech.jhipster.lite.module.domain.Indentation;
 import tech.jhipster.lite.module.domain.JHipsterModule;
 import tech.jhipster.lite.module.domain.file.JHipsterDestination;
 import tech.jhipster.lite.module.domain.file.JHipsterSource;
 import tech.jhipster.lite.module.domain.npm.NpmLazyInstaller;
 import tech.jhipster.lite.module.domain.properties.JHipsterModuleProperties;
-import tech.jhipster.lite.module.domain.replacement.MandatoryReplacer;
 import tech.jhipster.lite.shared.error.domain.Assert;
 
 public class VueModulesFactory {
@@ -122,7 +123,7 @@ public class VueModulesFactory {
         .and()
       .apply(patchEslintConfig(properties))
       .apply(patchTsConfig(properties))
-      .apply(patchVitestConfig(properties))
+      .apply(patchVitestConfig())
       .build();
     //@formatter:on
   }
@@ -146,39 +147,30 @@ public class VueModulesFactory {
           .add(lineAfterRegex("from '@eslint/js'"), "import vue from 'eslint-plugin-vue';")
           .add(lineAfterRegex("...typescript.configs.recommended"), vuePluginConfig)
           .add(text("files: ['src/*/webapp/**/*.ts']"), "files: ['src/*/webapp/**/*.vue', 'src/*/webapp/**/*.ts']")
-          .add(eslintTypescriptVueRule("'vue/html-self-closing': 'off',", properties.indentation()))
-          .add(eslintTypescriptVueRule("'@typescript-eslint/no-explicit-any': 'off',", properties.indentation()))
-          .add(eslintTypescriptVueRule("'@typescript-eslint/no-empty-object-type': 'off',", properties.indentation()))
-          .add(eslintTypescriptVueRule("'@typescript-eslint/consistent-type-imports': 'error',", properties.indentation()))
           .and()
-        .and();
+        .and()
+      .apply(eslintTypescriptRule("'vue/html-self-closing': 'off'", properties.indentation()))
+      .apply(eslintTypescriptRule("'@typescript-eslint/no-explicit-any': 'off'", properties.indentation()))
+      .apply(eslintTypescriptRule("'@typescript-eslint/no-empty-object-type': 'off'", properties.indentation()))
+      .apply(eslintTypescriptRule("'@typescript-eslint/consistent-type-imports': 'error'", properties.indentation()));
     //@formatter:on
   }
 
-  private static MandatoryReplacer eslintTypescriptVueRule(String rule, Indentation indentation) {
-    return new MandatoryReplacer(lineAfterRegex("quotes: \\['error', 'single'"), indentation.times(3) + rule);
-  }
-
   private Consumer<JHipsterModuleBuilder> patchTsConfig(JHipsterModuleProperties properties) {
     //@formatter:off
     return moduleBuilder -> moduleBuilder
       .mandatoryReplacements()
         .in(path("tsconfig.json"))
           .add(text("@tsconfig/recommended/tsconfig.json"), "@vue/tsconfig/tsconfig.dom.json")
-          .add(tsConfigCompilerOption("sourceMap", true, properties.indentation()))
-          .add(tsConfigCompilerOption("allowJs", true, properties.indentation()))
           .add(text("\"types\": ["), "\"types\": [\"vite/client\", ")
           .and()
-        .and();
+        .and()
+      .apply(tsConfigCompilerOption("sourceMap", true, properties.indentation()))
+      .apply(tsConfigCompilerOption("allowJs", true, properties.indentation()));
     //@formatter:on
   }
 
-  private static MandatoryReplacer tsConfigCompilerOption(String optionName, boolean optionValue, Indentation indentation) {
-    String compilerOption = indentation.times(2) + "\"%s\": %s,".formatted(optionName, optionValue);
-    return new MandatoryReplacer(lineAfterRegex("\"compilerOptions\":"), compilerOption);
-  }
-
-  private Consumer<JHipsterModuleBuilder> patchVitestConfig(JHipsterModuleProperties properties) {
+  private Consumer<JHipsterModuleBuilder> patchVitestConfig() {
     //@formatter:off
     return moduleBuilder -> moduleBuilder
       .mandatoryReplacements()
@@ -186,19 +178,15 @@ public class VueModulesFactory {
           .add(lineAfterRegex("from 'vitest/config';"), "import vue from '@vitejs/plugin-vue';")
           .add(text("plugins: ["), "plugins: [vue(), ")
           .add(text("environment: 'node',"), "environment: 'jsdom',")
-          .add(vitestCoverageExclusion(properties,"src/main/webapp/**/*.component.ts"))
-          .add(vitestCoverageExclusion(properties,"src/main/webapp/app/router.ts"))
-          .add(vitestCoverageExclusion(properties,"src/main/webapp/app/injections.ts"))
-          .add(vitestCoverageExclusion(properties,"src/main/webapp/app/main.ts"))
-        .and();
+        .and()
+      .and()
+      .apply(vitestCoverageExclusion("src/main/webapp/**/*.component.ts"))
+      .apply(vitestCoverageExclusion("src/main/webapp/app/router.ts"))
+      .apply(vitestCoverageExclusion("src/main/webapp/app/injections.ts"))
+      .apply(vitestCoverageExclusion("src/main/webapp/app/main.ts"));
     //@formatter:on
   }
 
-  private static MandatoryReplacer vitestCoverageExclusion(JHipsterModuleProperties properties, String filePattern) {
-    Indentation indentation = properties.indentation();
-    return new MandatoryReplacer(lineAfterRegex("configDefaults.coverage.exclude"), indentation.times(4) + "'" + filePattern + "',");
-  }
-
   public JHipsterModule buildPiniaModule(JHipsterModuleProperties properties) {
     Assert.notNull("properties", properties);
 
diff --git a/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/EslintShortcuts.java b/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/EslintShortcuts.java
new file mode 100644
index 000000000..9b963a98a
--- /dev/null
+++ b/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/EslintShortcuts.java
@@ -0,0 +1,29 @@
+package tech.jhipster.lite.generator.typescript.common.domain;
+
+import static tech.jhipster.lite.module.domain.JHipsterModule.lineAfterRegex;
+import static tech.jhipster.lite.module.domain.JHipsterModule.path;
+
+import java.util.function.Consumer;
+import tech.jhipster.lite.module.domain.Indentation;
+import tech.jhipster.lite.module.domain.JHipsterModule;
+import tech.jhipster.lite.module.domain.replacement.MandatoryReplacer;
+
+public final class EslintShortcuts {
+
+  private EslintShortcuts() {}
+
+  public static Consumer<JHipsterModule.JHipsterModuleBuilder> eslintTypescriptRule(String rule, Indentation indentation) {
+    //@formatter:off
+    return moduleBuilder -> moduleBuilder
+      .mandatoryReplacements()
+        .in(path("eslint.config.js"))
+        .add(eslintTypescriptVueRuleReplacement(rule, indentation))
+        .and()
+      .and();
+    //@formatter:on
+  }
+
+  private static MandatoryReplacer eslintTypescriptVueRuleReplacement(String rule, Indentation indentation) {
+    return new MandatoryReplacer(lineAfterRegex("rules: \\{"), indentation.times(3) + rule + ",");
+  }
+}
diff --git a/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/TsConfigShortcuts.java b/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/TsConfigShortcuts.java
new file mode 100644
index 000000000..03de6d6d0
--- /dev/null
+++ b/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/TsConfigShortcuts.java
@@ -0,0 +1,33 @@
+package tech.jhipster.lite.generator.typescript.common.domain;
+
+import static tech.jhipster.lite.module.domain.JHipsterModule.lineAfterRegex;
+import static tech.jhipster.lite.module.domain.JHipsterModule.path;
+
+import java.util.function.Consumer;
+import tech.jhipster.lite.module.domain.Indentation;
+import tech.jhipster.lite.module.domain.JHipsterModule;
+import tech.jhipster.lite.module.domain.replacement.MandatoryReplacer;
+
+public final class TsConfigShortcuts {
+
+  private TsConfigShortcuts() {}
+
+  public static Consumer<JHipsterModule.JHipsterModuleBuilder> tsConfigCompilerOption(
+    String optionName,
+    boolean optionValue,
+    Indentation indentation
+  ) {
+    //@formatter:off
+    return moduleBuilder -> moduleBuilder
+      .mandatoryReplacements()
+        .in(path("tsconfig.json"))
+        .add(tsConfigCompilerOptionReplacement(optionName, optionValue, indentation))
+        .and();
+    //@formatter:on
+  }
+
+  private static MandatoryReplacer tsConfigCompilerOptionReplacement(String optionName, boolean optionValue, Indentation indentation) {
+    String compilerOption = indentation.times(2) + "\"%s\": %s,".formatted(optionName, optionValue);
+    return new MandatoryReplacer(lineAfterRegex("\"compilerOptions\":"), compilerOption);
+  }
+}
diff --git a/src/main/java/tech/jhipster/lite/generator/typescript/common/package-info.java b/src/main/java/tech/jhipster/lite/generator/typescript/common/package-info.java
new file mode 100644
index 000000000..1173f1ca9
--- /dev/null
+++ b/src/main/java/tech/jhipster/lite/generator/typescript/common/package-info.java
@@ -0,0 +1,2 @@
+@tech.jhipster.lite.SharedKernel
+package tech.jhipster.lite.generator.typescript.common;


Test patch:
diff --git a/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/VitestShortcuts.java b/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/VitestShortcuts.java
new file mode 100644
index 000000000..624c7767d
--- /dev/null
+++ b/src/main/java/tech/jhipster/lite/generator/typescript/common/domain/VitestShortcuts.java
@@ -0,0 +1,29 @@
+package tech.jhipster.lite.generator.typescript.common.domain;
+
+import static tech.jhipster.lite.module.domain.JHipsterModule.path;
+import static tech.jhipster.lite.module.domain.JHipsterModule.text;
+
+import java.util.function.Consumer;
+import tech.jhipster.lite.module.domain.JHipsterModule;
+import tech.jhipster.lite.module.domain.replacement.MandatoryReplacer;
+
+public final class VitestShortcuts {
+
+  private VitestShortcuts() {}
+
+  public static Consumer<JHipsterModule.JHipsterModuleBuilder> vitestCoverageExclusion(String exclusionFilePattern) {
+    //@formatter:off
+    return moduleBuilder -> moduleBuilder
+      .mandatoryReplacements()
+        .in(path("vitest.config.ts"))
+        .add(vitestCoverageExclusionReplacement(exclusionFilePattern));
+    //@formatter:on
+  }
+
+  private static MandatoryReplacer vitestCoverageExclusionReplacement(String filePattern) {
+    return new MandatoryReplacer(
+      text("(configDefaults.coverage.exclude as string[])"),
+      "(configDefaults.coverage.exclude as string[])" + ", '%s'".formatted(filePattern)
+    );
+  }
+}
diff --git a/src/main/resources/generator/typescript/vitest.config.ts.mustache b/src/main/resources/generator/typescript/vitest.config.ts.mustache
index 17bea628c..eef80168b 100644
--- a/src/main/resources/generator/typescript/vitest.config.ts.mustache
+++ b/src/main/resources/generator/typescript/vitest.config.ts.mustache
@@ -28,10 +28,7 @@ export default defineConfig({
         100: true,
       },
       include: ['src/main/webapp/**/*.ts?(x)'],
-      exclude: [
-        // keep this comment to be able to apply another front module after prettier format
-        ...(configDefaults.coverage.exclude as string[]),
-      ],
+      exclude: [...(configDefaults.coverage.exclude as string[])],
       provider: 'istanbul',
       reportsDirectory: '{{projectBuildDirectory}}/test-results/',
       reporter: ['html', 'json-summary', 'text', 'text-summary', 'lcov', 'clover'],
diff --git a/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java b/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java
index e246e6ae9..48c462f88 100644
--- a/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java
+++ b/src/test/java/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.java
@@ -79,7 +79,7 @@ class VueModulesFactoryTest {
             """
         )
       .and()
-      .hasPrefixedFiles("", "eslint.config.js", "tsconfig.build.json", "vite.config.ts", "vitest.config.ts")
+      .hasPrefixedFiles("", "eslint.config.js", "tsconfig.build.json", "vite.config.ts")
       .hasFile("tsconfig.json")
         .matchingSavedSnapshot()
         .and()
diff --git a/src/test/resources/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.shouldBuildModuleWithStyle.vitest.config.ts.approved.txt b/src/test/resources/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.shouldBuildModuleWithStyle.vitest.config.ts.approved.txt
index da57ca470..87ad4ca73 100644
--- a/src/test/resources/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.shouldBuildModuleWithStyle.vitest.config.ts.approved.txt
+++ b/src/test/resources/tech/jhipster/lite/generator/client/react/core/domain/ReactCoreModulesFactoryTest.shouldBuildModuleWithStyle.vitest.config.ts.approved.txt
@@ -29,12 +29,7 @@ export default defineConfig({
         100: true,
       },
       include: ['src/main/webapp/**/*.ts?(x)'],
-      exclude: [
-        // keep this comment to be able to apply another front module after prettier format
-        ...(configDefaults.coverage.exclude as string[]),
-        'src/main/webapp/app/injections.ts',
-        'src/main/webapp/app/index.tsx',
-      ],
+      exclude: [...(configDefaults.coverage.exclude as string[]), 'src/main/webapp/app/injections.ts', 'src/main/webapp/app/index.tsx'],
       provider: 'istanbul',
       reportsDirectory: 'target/test-results/',
       reporter: ['html', 'json-summary', 'text', 'text-summary', 'lcov', 'clover'],
diff --git a/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.eslint.config.js.approved.txt b/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.eslint.config.js.approved.txt
index 275694c96..7daab41b1 100644
--- a/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.eslint.config.js.approved.txt
+++ b/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.eslint.config.js.approved.txt
@@ -30,11 +30,11 @@ export default typescript.config(
       globals: { ...globals.browser },
     },
     rules: {
-      quotes: ['error', 'single', { avoidEscape: true }],
       '@typescript-eslint/consistent-type-imports': 'error',
       '@typescript-eslint/no-empty-object-type': 'off',
       '@typescript-eslint/no-explicit-any': 'off',
       'vue/html-self-closing': 'off',
+      quotes: ['error', 'single', { avoidEscape: true }],
     },
   },
 );
diff --git a/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.vitest.config.ts.approved.txt b/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.vitest.config.ts.approved.txt
index 8adce04be..bb802095c 100644
--- a/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.vitest.config.ts.approved.txt
+++ b/src/test/resources/tech/jhipster/lite/generator/client/vue/core/domain/VueModulesFactoryTest.shouldCreateVueModule.vitest.config.ts.approved.txt
@@ -29,14 +29,7 @@ export default defineConfig({
         100: true,
       },
       include: ['src/main/webapp/**/*.ts?(x)'],
-      exclude: [
-        // keep this comment to be able to apply another front module after prettier format
-        ...(configDefaults.coverage.exclude as string[]),
-        'src/main/webapp/app/main.ts',
-        'src/main/webapp/app/injections.ts',
-        'src/main/webapp/app/router.ts',
-        'src/main/webapp/**/*.component.ts',
-      ],
+      exclude: [...(configDefaults.coverage.exclude as string[]), 'src/main/webapp/app/main.ts', 'src/main/webapp/app/injections.ts', 'src/main/webapp/app/router.ts', 'src/main/webapp/**/*.component.ts'],
       provider: 'istanbul',
       reportsDirectory: 'target/test-results/',
       reporter: ['html', 'json-summary', 'text', 'text-summary', 'lcov', 'clover'],