Skip to content

Commit 3e7c2be

Browse files
authored
Braces and parentheses should be used consistently with arrow functions (jhipster#28367)
1 parent 1b2c980 commit 3e7c2be

File tree

14 files changed

+25
-62
lines changed

14 files changed

+25
-62
lines changed

generators/app/support/check-node.ts

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,23 +21,14 @@ import chalk from 'chalk';
2121

2222
import { packageJson } from '../../../lib/index.js';
2323

24-
const isNodeVersionCompliantWithRequirement = (gatheredFromEnvironment, requiredVersion) => {
25-
return !semver.satisfies(gatheredFromEnvironment, requiredVersion);
26-
};
24+
const isNodeVersionCompliantWithRequirement = (gatheredFromEnvironment, requiredVersion) =>
25+
!semver.satisfies(gatheredFromEnvironment, requiredVersion);
2726

28-
const getNodeReleaseFromCurrentProcess = () => {
29-
return process.release || {};
30-
};
27+
const getNodeReleaseFromCurrentProcess = () => process.release || {};
3128

32-
const isNodeLTS = release => {
33-
return release.lts;
34-
};
35-
const getNodeVersionFromCurrentProcess = () => {
36-
return process.version;
37-
};
38-
const requiredEngineFromPackageJson = () => {
39-
return packageJson.engines.node;
40-
};
29+
const isNodeLTS = release => release.lts;
30+
const getNodeVersionFromCurrentProcess = () => process.version;
31+
const requiredEngineFromPackageJson = () => packageJson.engines.node;
4132

4233
/**
4334
* @private

generators/base/support/configuration-helpers/options.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@
1717
* limitations under the License.
1818
*/
1919

20-
const isReproducible = generator => {
21-
return generator.options.reproducible;
22-
};
20+
const isReproducible = generator => generator.options.reproducible;
2321

2422
export { isReproducible };

generators/base/support/contents.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,4 @@ export function normalizeLineEndings(str: string, lineEnding: string): string {
3636
* @param {string} content - the string to process
3737
*/
3838

39-
export const stripMargin = content => {
40-
return content.replace(/^[ ]*\|/gm, '');
41-
};
39+
export const stripMargin = content => content.replace(/^[ ]*\|/gm, '');

generators/base/support/needles.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,7 @@ type NeedleContentInsertion = NeedleInsertion & {
6262
/**
6363
* Change spaces sequences and '>' to allow any number of spaces or new line prefix
6464
*/
65-
export const convertToPrettierExpressions = (str: string): string => {
66-
return str.replace(/\s+/g, '([\\s\n]*)').replace(/>+/g, '(\n?[\\s]*)>');
67-
};
65+
export const convertToPrettierExpressions = (str: string): string => str.replace(/\s+/g, '([\\s\n]*)').replace(/>+/g, '(\n?[\\s]*)>');
6866

6967
/**
7068
* Check if contentToCheck existing in content

generators/generate-blueprint/constants.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,7 @@ export const allGeneratorsConfig = () => ({
7777
[ADDITIONAL_SUB_GENERATORS]: '',
7878
[DYNAMIC]: false,
7979
[JS]: true,
80-
[GENERATORS]: Object.fromEntries(
81-
Object.values(GENERATOR_LIST).map(subGenerator => {
82-
return [subGenerator, allSubGeneratorConfig(subGenerator)];
83-
}),
84-
),
80+
[GENERATORS]: Object.fromEntries(Object.values(GENERATOR_LIST).map(subGenerator => [subGenerator, allSubGeneratorConfig(subGenerator)])),
8581
});
8682

8783
export const prompts = () => {

generators/maven/support/pom-store.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,17 +33,11 @@ import type {
3333
} from '../types.js';
3434
import { formatPomFirstLevel, sortPomProject } from '../internal/pom-sort.js';
3535

36-
const artifactEquals = (a: MavenArtifact, b: MavenArtifact) => {
37-
return a.groupId === b.groupId && a.artifactId === b.artifactId;
38-
};
36+
const artifactEquals = (a: MavenArtifact, b: MavenArtifact) => a.groupId === b.groupId && a.artifactId === b.artifactId;
3937

40-
const dependencyEquals = (a: MavenDependency, b: MavenDependency) => {
41-
return artifactEquals(a, b) && a.scope === b.scope && a.type === b.type;
42-
};
38+
const dependencyEquals = (a: MavenDependency, b: MavenDependency) => artifactEquals(a, b) && a.scope === b.scope && a.type === b.type;
4339

44-
const idEquals = (a: { id: string }, b: { id: string }) => {
45-
return a.id === b.id;
46-
};
40+
const idEquals = (a: { id: string }, b: { id: string }) => a.id === b.id;
4741

4842
const ensureChildIsArray = (node, childPath) => {
4943
let dependencyArray = get(node, childPath);

generators/server/support/database.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,7 @@ export const databaseTypeData: Record<string, DatabaseTypeData> = {
6060
},
6161
};
6262

63-
export const getDatabaseTypeData = (databaseType: string): DatabaseTypeData => {
64-
return databaseTypeData[databaseType] ?? databaseTypeDataFallback;
65-
};
63+
export const getDatabaseTypeData = (databaseType: string): DatabaseTypeData => databaseTypeData[databaseType] ?? databaseTypeDataFallback;
6664

6765
export const R2DBC_DB_OPTIONS = [
6866
{

generators/spring-data-relational/support/h2-reserved-keywords.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,4 @@
1919

2020
export const h2ReservedKeywords = ['KEY'];
2121

22-
export const isReservedH2Keyword = (keyword: string) => {
23-
return h2ReservedKeywords.includes(keyword.toUpperCase());
24-
};
22+
export const isReservedH2Keyword = (keyword: string) => h2ReservedKeywords.includes(keyword.toUpperCase());

generators/spring-data-relational/support/oracle-reserved-keywords.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,6 +501,4 @@ export const oracleReservedKeywords = [
501501
'ZONE',
502502
];
503503

504-
export const isReservedOracleKeyword = (keyword: string) => {
505-
return oracleReservedKeywords.includes(keyword.toUpperCase());
506-
};
504+
export const isReservedOracleKeyword = (keyword: string) => oracleReservedKeywords.includes(keyword.toUpperCase());

generators/spring-data-relational/support/postgresql-reserved-keywords.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,4 @@ export const postgresqlReservedKeywords = [
118118
'WITH',
119119
];
120120

121-
export const isReservedPostgresqlKeyword = (keyword: string) => {
122-
return postgresqlReservedKeywords.includes(keyword.toUpperCase());
123-
};
121+
export const isReservedPostgresqlKeyword = (keyword: string) => postgresqlReservedKeywords.includes(keyword.toUpperCase());

0 commit comments

Comments
 (0)