From 2526286c7d7c1ce55824c9f6173ada623c28d2eb Mon Sep 17 00:00:00 2001 From: Marcelo Shima Date: Thu, 2 Nov 2023 11:34:32 -0300 Subject: [PATCH] lint adjusts --- .eslintrc.json | 3 +-- cli/logo.js | 1 - generators/server/generator.js | 33 +++------------------------------ 3 files changed, 4 insertions(+), 33 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 8bc72177..dd281d95 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -3,7 +3,7 @@ "node": true, "es2020": true }, - "extends": ["airbnb-base", "plugin:prettier/recommended"], + "extends": ["eslint:recommended", "plugin:prettier/recommended"], "parserOptions": { "ecmaVersion": 11, "sourceType": "module" @@ -15,7 +15,6 @@ ], "rules": { "func-names": "off", - "import/no-extraneous-dependencies": ["error", { "devDependencies": true }], "import/no-unresolved": "off", "no-restricted-syntax": [ "error", diff --git a/cli/logo.js b/cli/logo.js index 37f26796..8a3d14b0 100644 --- a/cli/logo.js +++ b/cli/logo.js @@ -6,7 +6,6 @@ const { versions: { micronaut: MICRONAUT_VERSION }, } = constants; -// eslint-disable-next-line import/prefer-default-export export function getLogo() { const { version } = JSON.parse(readFileSync(new URL('../package.json', import.meta.url))); diff --git a/generators/server/generator.js b/generators/server/generator.js index adf9e7a8..5381cd9c 100644 --- a/generators/server/generator.js +++ b/generators/server/generator.js @@ -7,6 +7,7 @@ import { GENERATOR_MAVEN, } from 'generator-jhipster/generators'; import { createNeedleCallback, createBase64Secret } from 'generator-jhipster/generators/base/support'; +import { addJavaAnnotation } from 'generator-jhipster/generators/java/support'; import mnConstants from '../constants.cjs'; import { writeFiles } from './files.js'; @@ -14,14 +15,13 @@ import command from './command.js'; import { entityFiles } from './entity-files.js'; export default class extends ServerGenerator { - command = command; - constructor(args, opts, features) { super(args, opts, { ...features, checkBlueprint: true, }); + this.command = command; if (!this.options.help) { this.jhipsterTemplatesFolders.push( // For _persistClass_.java.jhi.hibernate_cache file @@ -72,8 +72,7 @@ export default class extends ServerGenerator { get [ServerGenerator.COMPOSING]() { return this.asComposingTaskGroup({ async composing() { - const { buildTool, enableTranslation, databaseType, messageBroker, searchEngine, testFrameworks, websocket, cacheProvider } = - this.jhipsterConfigWithDefaults; + const { buildTool, enableTranslation, databaseType, cacheProvider } = this.jhipsterConfigWithDefaults; if (buildTool === 'gradle') { await this.composeWithJHipster(GENERATOR_GRADLE); } else if (buildTool === 'maven') { @@ -92,32 +91,6 @@ export default class extends ServerGenerator { if (databaseType === 'sql') { await this.composeWithJHipster(GENERATOR_LIQUIBASE); } - /* - else if (databaseType === CASSANDRA) { - await this.composeWithJHipster(GENERATOR_SPRING_DATA_CASSANDRA); - } else if (databaseType === COUCHBASE) { - await this.composeWithJHipster(GENERATOR_SPRING_DATA_COUCHBASE); - } else if (databaseType === MONGODB) { - await this.composeWithJHipster(GENERATOR_SPRING_DATA_MONGODB); - } else if (databaseType === NEO4J) { - await this.composeWithJHipster(GENERATOR_SPRING_DATA_NEO4J); - } - if (messageBroker === KAFKA || messageBroker === PULSAR) { - await this.composeWithJHipster(GENERATOR_SPRING_CLOUD_STREAM); - } - if (searchEngine === ELASTICSEARCH) { - await this.composeWithJHipster(GENERATOR_SPRING_DATA_ELASTICSEARCH); - } - if (testFrameworks?.includes(CUCUMBER)) { - await this.composeWithJHipster(GENERATOR_CUCUMBER); - } - if (testFrameworks?.includes(GATLING)) { - await this.composeWithJHipster(GENERATOR_GATLING); - } - if (websocket === SPRING_WEBSOCKET) { - await this.composeWithJHipster(GENERATOR_SPRING_WEBSOCKET); - } - */ if (['ehcache', 'caffeine', 'hazelcast', 'infinispan', 'memcached', 'redis'].includes(cacheProvider)) { await this.composeWithJHipster('jhipster-micronaut:micronaut-cache'); }