Skip to content

Commit

Permalink
fix: using indentation of 2 spaces to align with generator prettier c…
Browse files Browse the repository at this point in the history
…onfiguration

Otherwise resources files are not formatted correctly
  • Loading branch information
murdos committed Sep 13, 2024
1 parent a3d0f57 commit 3889fa2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,20 +26,20 @@ void shouldBuildModuleWithoutPrettierLintStaged() {

JHipsterModule module = factory.buildModule(properties);

assertThatModuleWithFiles(module, packageJsonFile(), withoutPrettierLintStagedConfigFile())
assertThatModuleWithFiles(module, packageJsonFile(), lintStagedConfigFileWithoutPrettier())
.hasFiles(".prettierignore")
.hasFile(".lintstagedrc.cjs")
.containing(
"""
module.exports = {
'*.{md,json,yml,html,css,scss,java,xml,feature}': ['prettier --write'],
'*.pug': ['eslint --fix', 'prettier --write'],
'*.{md,json,yml,html,css,scss,java,xml,feature}': ['prettier --write'],
'*.pug': ['eslint --fix', 'prettier --write'],
};
"""
)
.and()
.hasFile(".prettierrc")
.containing("tabWidth: 4")
.containing("tabWidth: 2")
.containing("endOfLine: 'crlf'")
.containing("@prettier/plugin-xml")
.containing("prettier-plugin-gherkin")
Expand Down Expand Up @@ -68,7 +68,7 @@ void shouldBuildModuleWithEmptyLintStaged() {
.containing(
"""
module.exports = {
'*.{md,json,yml,html,css,scss,java,xml,feature}': ['prettier --write'],
'*.{md,json,yml,html,css,scss,java,xml,feature}': ['prettier --write'],
};
"""
);
Expand All @@ -78,7 +78,7 @@ private JHipsterModuleProperties properties(String folder) {
return JHipsterModulesFixture.propertiesBuilder(folder)
.projectBaseName("testProject")
.put("projectName", "Test Project")
.put("indentSize", 4)
.put("indentSize", 2)
.put("endOfLine", "crlf")
.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public static ModuleFile emptyLintStagedConfigFile() {
return file("src/test/resources/projects/init/.lintstagedrc.empty.cjs", ".lintstagedrc.cjs");
}

public static ModuleFile withoutPrettierLintStagedConfigFile() {
public static ModuleFile lintStagedConfigFileWithoutPrettier() {
return file("src/test/resources/projects/init/.lintstagedrc.withoutPrettier.cjs", ".lintstagedrc.cjs");
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module.exports = {
'*.pug': ['eslint --fix', 'prettier --write'],
'*.pug': ['eslint --fix', 'prettier --write'],
};

0 comments on commit 3889fa2

Please sign in to comment.