Skip to content

Commit

Permalink
rename .lintstagedrc to cjs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshima committed Oct 19, 2023
1 parent 6cb7722 commit 14ccc18
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion generators/common/__snapshots__/generator.spec.mjs.snap
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ trim_trailing_whitespace = false
",
"stateCleared": "modified",
},
".lintstagedrc.js": {
".lintstagedrc.cjs": {
"contents": "module.exports = {
'{,**/}*.{md,json,yml,html,cjs,mjs,js,ts,tsx,css,scss,java}': ['prettier --write'],
};
Expand Down
2 changes: 1 addition & 1 deletion generators/common/files.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ export const commonFiles = {
commitHooks: [
{
condition: generator => !generator.skipCommitHook,
templates: ['.lintstagedrc.js', '.husky/pre-commit'],
templates: ['.lintstagedrc.cjs', '.husky/pre-commit'],
},
],
};
Expand Down
5 changes: 5 additions & 0 deletions generators/common/generator.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ export default class CommonGenerator extends BaseApplicationGenerator {
this.removeFile('npmw.cmd');
}
}
if (this.isJhipsterVersionLessThan('8.0.0-rc.2')) {
if (!application.skipCommitHook) {
this.removeFile('.lintstagedrc.js');
}
}
},
writePrettierConfig({ application }) {
return this.writeFiles({
Expand Down
2 changes: 1 addition & 1 deletion generators/common/generator.spec.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ describe(`generator - ${generator}`, () => {
});

it('uses custom prettier formatting to js file', () => {
runResult.assertFileContent('.lintstagedrc.js', / {10}'{/);
runResult.assertFileContent('.lintstagedrc.cjs', / {10}'{/);
});
});
});
Expand Down
2 changes: 1 addition & 1 deletion generators/server/__snapshots__/generator.spec.mjs.snap
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ exports[`generator - server with entities should match files snapshot 1`] = `
".jhipster/Foo.json": {
"stateCleared": "modified",
},
".lintstagedrc.js": {
".lintstagedrc.cjs": {
"stateCleared": "modified",
},
".mvn/jvm.config": {
Expand Down

0 comments on commit 14ccc18

Please sign in to comment.