Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

drop airbnb eslint config #26555

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"node": true,
"es2022": true
},
"extends": ["airbnb-base", "plugin:prettier/recommended", "plugin:@typescript-eslint/recommended"],
"extends": ["plugin:prettier/recommended", "plugin:@typescript-eslint/recommended"],
"parser": "@typescript-eslint/parser",
"plugins": ["mocha", "prettier", "chai-friendly", "@typescript-eslint", "unused-imports", "import"],
"settings": {
Expand Down
2 changes: 1 addition & 1 deletion cli/download.mts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import path from 'path';
import { inspect } from 'util';
import axios from 'axios';

import { logger } from './utils.mjs';
import { packageJson } from '../lib/index.js';
import { logger } from './utils.mjs';

const downloadFile = async (url: string, filename: string): Promise<string> => {
logger.verboseInfo(`Downloading file: ${url}`);
Expand Down
2 changes: 1 addition & 1 deletion cli/environment-builder.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ import { cloneDeep, mergeWith } from 'lodash-es';
import Environment from 'yeoman-environment';
import { QueuedAdapter } from '@yeoman/adapter';

import { CLI_NAME, logger } from './utils.mjs';
import { createJHipsterLogger, packageNameToNamespace } from '../generators/base/support/index.js';
import { parseBlueprintInfo, loadBlueprintsFromConfiguration, mergeBlueprints } from '../generators/base/internal/index.js';
import { CLI_NAME, logger } from './utils.mjs';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
10 changes: 5 additions & 5 deletions cli/program.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ import { fileURLToPath } from 'url';
import didYouMean from 'didyoumean';
import chalk from 'chalk';

import logo from './logo.mjs';
import EnvironmentBuilder from './environment-builder.mjs';
import SUB_GENERATORS from './commands.mjs';
import JHipsterCommand from './jhipster-command.mjs';
import { CLI_NAME, logger, getCommand, done } from './utils.mjs';
import { packageJson } from '../lib/index.js';
import { packageNameToNamespace } from '../generators/base/support/index.js';
import command from '../generators/base/command.js';
import { GENERATOR_APP, GENERATOR_BOOTSTRAP, GENERATOR_JDL } from '../generators/generator-list.js';
import { extractArgumentsFromConfigs } from '../generators/base/internal/command.js';
import logo from './logo.mjs';
import EnvironmentBuilder from './environment-builder.mjs';
import SUB_GENERATORS from './commands.mjs';
import JHipsterCommand from './jhipster-command.mjs';
import { CLI_NAME, logger, getCommand, done } from './utils.mjs';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
2 changes: 1 addition & 1 deletion cli/program.spec.mts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
import { expect } from 'chai';
import { describe, it, beforeEach } from 'esmocha';

import { createProgram } from './program.mjs';
import { defaultHelpers as helpers } from '../testing/index.js';
import { createProgram } from './program.mjs';

describe('cli - program', () => {
beforeEach(async () => {
Expand Down
2 changes: 1 addition & 1 deletion generators/angular/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import { snakeCase } from 'lodash-es';

import { buildClientSamples, entitiesClientSamples as entities, defaultHelpers as helpers } from '../../testing/index.js';
import { shouldSupportFeatures, testBlueprintSupport, checkEnforcements } from '../../test/support/index.js';
import Generator from './index.js';
import { clientFrameworkTypes } from '../../jdl/jhipster/index.js';
import { CLIENT_MAIN_SRC_DIR } from '../generator-constants.js';
import { GENERATOR_ANGULAR } from '../generator-list.js';
import Generator from './index.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
20 changes: 10 additions & 10 deletions generators/angular/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,19 @@ import { isFileStateModified } from 'mem-fs-editor/state';
import BaseApplicationGenerator, { type Entity } from '../base-application/index.js';
import { GENERATOR_ANGULAR, GENERATOR_CLIENT, GENERATOR_LANGUAGES } from '../generator-list.js';
import { defaultLanguage } from '../languages/support/index.js';
import { clientFrameworkTypes } from '../../jdl/jhipster/index.js';
import {
generateEntityClientEnumImports as getClientEnumImportsFormat,
getTypescriptKeyType as getTSKeyType,
generateTestEntityId as getTestEntityId,
generateTestEntityPrimaryKey as getTestEntityPrimaryKey,
generateTypescriptTestEntity as generateTestEntity,
} from '../client/support/index.js';
import type { CommonClientServerApplication } from '../base-application/types.js';
import { createNeedleCallback, mutateData } from '../base/support/index.js';
import { writeEntitiesFiles, postWriteEntitiesFiles, cleanupEntitiesFiles } from './entity-files-angular.js';
import { writeFiles } from './files-angular.js';
import cleanupOldFilesTask from './cleanup.js';
import { clientFrameworkTypes } from '../../jdl/jhipster/index.js';
import {
buildAngularFormPath as angularFormPath,
addEntitiesRoute,
Expand All @@ -38,15 +47,6 @@ import {
addItemToAdminMenu,
addIconImport,
} from './support/index.js';
import {
generateEntityClientEnumImports as getClientEnumImportsFormat,
getTypescriptKeyType as getTSKeyType,
generateTestEntityId as getTestEntityId,
generateTestEntityPrimaryKey as getTestEntityPrimaryKey,
generateTypescriptTestEntity as generateTestEntity,
} from '../client/support/index.js';
import type { CommonClientServerApplication } from '../base-application/types.js';
import { createNeedleCallback, mutateData } from '../base/support/index.js';

const { ANGULAR } = clientFrameworkTypes;

Expand Down
2 changes: 1 addition & 1 deletion generators/app/composing.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { before, it, describe } from 'esmocha';
import assert from 'assert';
import { before, it, describe } from 'esmocha';

import { defaultHelpers as helpers } from '../../testing/index.js';
import { GENERATOR_APP } from '../generator-list.js';
Expand Down
4 changes: 2 additions & 2 deletions generators/app/generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ import chalk from 'chalk';
import { camelCase } from 'lodash-es';

import BaseApplicationGenerator from '../base-application/index.js';
import { checkNode, loadStoredAppOptions } from './support/index.js';
import cleanupOldFilesTask from './cleanup.js';
import { GENERATOR_COMMON, GENERATOR_CLIENT, GENERATOR_SERVER } from '../generator-list.js';
import { getDefaultAppName } from '../project-name/support/index.js';
import { packageJson } from '../../lib/index.js';

import { applicationTypes } from '../../jdl/jhipster/index.js';
import cleanupOldFilesTask from './cleanup.js';
import { checkNode, loadStoredAppOptions } from './support/index.js';
import command from './command.js';

const { MICROSERVICE } = applicationTypes;
Expand Down
2 changes: 1 addition & 1 deletion generators/base-application/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ import { before, it, describe, expect, esmocha } from 'esmocha';
import { snakeCase } from 'lodash-es';

import EnvironmentBuilder from '../../cli/environment-builder.mjs';
import Generator from './index.js';
import { defaultHelpers as helpers } from '../../testing/index.js';
import { shouldSupportFeatures } from '../../test/support/tests.js';
import Generator from './index.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
8 changes: 4 additions & 4 deletions generators/base-application/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ import { upperFirst } from 'lodash-es';
import type { ComposeOptions, Storage } from 'yeoman-generator';

import BaseGenerator from '../base/index.js';
import { CUSTOM_PRIORITIES, PRIORITY_NAMES, QUEUES } from './priorities.js';
import { JHIPSTER_CONFIG_DIR } from '../generator-constants.js';
import type { BaseApplicationGeneratorDefinition, GenericApplicationDefinition } from './tasks.js';
import { GenericTaskGroup, GenericSourceTypeDefinition } from '../base/tasks.js';
import type { BaseApplication, CommonClientServerApplication } from './types.js';
import { getEntitiesFromDir } from './support/index.js';
import { SpringBootSourceType } from '../server/types.js';
import { ClientSourceType } from '../client/types.js';
import { I18nApplication } from '../languages/types.js';
Expand All @@ -37,6 +33,10 @@ import {
GENERATOR_BOOTSTRAP_APPLICATION_CLIENT,
GENERATOR_BOOTSTRAP_APPLICATION_SERVER,
} from '../generator-list.js';
import { getEntitiesFromDir } from './support/index.js';
import type { BaseApplication, CommonClientServerApplication } from './types.js';
import type { BaseApplicationGeneratorDefinition, GenericApplicationDefinition } from './tasks.js';
import { CUSTOM_PRIORITIES, PRIORITY_NAMES, QUEUES } from './priorities.js';

const {
LOADING,
Expand Down
2 changes: 1 addition & 1 deletion generators/base-application/support/enum.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { before, it, describe } from 'esmocha';
import assert from 'assert';
import { before, it, describe } from 'esmocha';
import { getEnumInfo } from './enum.js';

describe('base-application - support - enum', () => {
Expand Down
2 changes: 1 addition & 1 deletion generators/base-application/support/prepare-entity.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
import { it, describe, beforeEach } from 'esmocha';
import { expect } from 'chai';
import { formatDateForChangelog } from '../../base/support/index.js';
import { prepareEntityPrimaryKeyForTemplates, entityDefaultConfig } from './prepare-entity.js';
import BaseGenerator from '../../base/index.js';
import { getConfigWithDefaults } from '../../../jdl/jhipster/index.js';
import { prepareEntityPrimaryKeyForTemplates, entityDefaultConfig } from './prepare-entity.js';

describe('generator - base-application - support - prepareEntity', () => {
const defaultGenerator = { jhipsterConfig: getConfigWithDefaults() };
Expand Down
4 changes: 2 additions & 2 deletions generators/base-application/support/prepare-entity.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ import {
getMicroserviceAppName,
mutateData,
} from '../../base/support/index.js';
import { fieldToReference } from './prepare-field.js';
import { getTypescriptKeyType, getEntityParentPathAddition } from '../../client/support/index.js';
import {
applicationTypes,
Expand All @@ -39,10 +38,11 @@ import {
fieldTypes,
searchEngineTypes,
} from '../../../jdl/jhipster/index.js';
import { fieldIsEnum } from './field-utils.js';

import { Entity } from '../types/index.js';
import type CoreGenerator from '../../base-core/generator.js';
import { fieldIsEnum } from './field-utils.js';
import { fieldToReference } from './prepare-field.js';

const NO_SEARCH_ENGINE = searchEngineTypes.NO;
const { PaginationTypes, ServiceTypes, MapperTypes } = entityOptions;
Expand Down
2 changes: 1 addition & 1 deletion generators/base-application/support/prepare-field.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ import { snakeCase, startCase, upperFirst, defaults, kebabCase } from 'lodash-es
import { fieldTypes, validations } from '../../../jdl/jhipster/index.js';
import { getTypescriptType, prepareField as prepareClientFieldForTemplates } from '../../client/support/index.js';
import { prepareField as prepareServerFieldForTemplates } from '../../server/support/index.js';
import { fieldIsEnum } from './field-utils.js';
import { mutateData } from '../../base/support/config.js';
import { fieldIsEnum } from './field-utils.js';
import { prepareProperty } from './prepare-property.js';

const { BlobTypes, CommonDBTypes, RelationalOnlyDBTypes } = fieldTypes;
Expand Down
4 changes: 2 additions & 2 deletions generators/base-application/support/prepare-field.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

import { it, describe, beforeEach } from 'esmocha';
import { expect } from 'chai';
import prepareEntityForTemplates, { loadRequiredConfigIntoEntity } from './prepare-entity.js';
import prepareFieldForTemplates, { getEnumValuesWithCustomValues } from './prepare-field.js';
import { formatDateForChangelog } from '../../base/support/index.js';
import BaseGenerator from '../../base/index.js';
import { getConfigWithDefaults } from '../../../jdl/jhipster/index.js';
import prepareFieldForTemplates, { getEnumValuesWithCustomValues } from './prepare-field.js';
import prepareEntityForTemplates, { loadRequiredConfigIntoEntity } from './prepare-entity.js';

const defaultConfig = getConfigWithDefaults();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ import pluralize from 'pluralize';

import { databaseTypes, entityOptions, validations, checkAndReturnRelationshipOnValue } from '../../../jdl/jhipster/index.js';
import { getJoinTableName, hibernateSnakeCase } from '../../server/support/index.js';
import { stringifyApplicationData } from './debug.js';
import { mutateData } from '../../base/support/config.js';
import { stringifyApplicationData } from './debug.js';
import { prepareProperty } from './prepare-property.js';

const { NEO4J, NO: DATABASE_NO } = databaseTypes;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { readdir } from 'fs/promises';
import { basename, join } from 'path';
import { loadFile } from 'mem-fs';
import type { MemFsEditorFile } from 'mem-fs-editor';
import { Minimatch } from 'minimatch';
import { transform } from 'p-transform';
import { basename, join } from 'path';
import { GENERATOR_JHIPSTER } from '../../generator-constants.js';

export const updateApplicationEntitiesTransform = ({
Expand Down
4 changes: 2 additions & 2 deletions generators/base-application/tasks.d.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Storage } from 'yeoman-generator';
import { ControlTaskParam, BaseGeneratorDefinition, SourceTaskParam, GenericSourceTypeDefinition } from '../base/tasks.js';
import { CommonClientServerApplication } from './types.js';
import { Entity, Field, Relationship } from './types/index.js';
import { ClientSourceType } from '../client/types.js';
import { BaseChangelog } from '../base-entity-changes/types.js';
import { CommonClientServerApplication } from './types.js';
import { Entity, Field, Relationship } from './types/index.js';

export type GenericApplicationDefinition<ApplicationType = CommonClientServerApplication> = {
applicationType: ApplicationType;
Expand Down
2 changes: 1 addition & 1 deletion generators/base-core/generator-core.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
import { it, describe, expect as jestExpect, beforeEach } from 'esmocha';
import { basicHelpers as helpers } from '../../testing/index.js';

import Base from './index.js';
import { createJHipsterLogger } from '../base/support/logger.js';
import Base from './index.js';

const BaseGenerator: any = Base.prototype;

Expand Down
4 changes: 2 additions & 2 deletions generators/base-workspaces/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ import { existsSync } from 'fs';
import chalk from 'chalk';

import BaseGenerator from '../base/index.js';
import { PRIORITY_NAMES, CUSTOM_PRIORITIES } from './priorities.js';
import { YO_RC_FILE } from '../generator-constants.js';
import { GENERATOR_BOOTSTRAP_APPLICATION } from '../generator-list.js';
import command from './command.js';
import { normalizePathEnd } from '../base/support/path.js';
import command from './command.js';
import { PRIORITY_NAMES, CUSTOM_PRIORITIES } from './priorities.js';

const {
PROMPTING_WORKSPACES,
Expand Down
4 changes: 2 additions & 2 deletions generators/base-workspaces/internal/docker-prompts.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import chalk from 'chalk';

import { readFileSync, readdirSync, statSync } from 'node:fs';
import { join } from 'node:path';
import { loadConfigs } from './docker-base.js';
import chalk from 'chalk';
import { applicationTypes, monitoringTypes, serviceDiscoveryTypes } from '../../../jdl/jhipster/index.js';
import { convertSecretToBase64 } from '../../base/support/index.js';
import { loadConfigs } from './docker-base.js';

const { MICROSERVICE, MONOLITH, GATEWAY } = applicationTypes;
const { PROMETHEUS } = monitoringTypes;
Expand Down
2 changes: 1 addition & 1 deletion generators/base/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import { before, it, describe, expect, esmocha } from 'esmocha';
import { snakeCase } from 'lodash-es';

import EnvironmentBuilder from '../../cli/environment-builder.mjs';
import BaseGenerator from './index.js';
import { defaultHelpers as helpers } from '../../testing/index.js';
import { getCommandHelpOutput, shouldSupportFeatures } from '../../test/support/tests.js';
import BaseGenerator from './index.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
4 changes: 2 additions & 2 deletions generators/base/generator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,14 @@ import semver from 'semver';

import type { ComposeOptions } from 'yeoman-generator';
import { packageJson } from '../../lib/index.js';
import CoreGenerator from '../base-core/index.js';
import { loadStoredAppOptions } from '../app/support/index.js';
import { packageNameToNamespace } from './support/index.js';
import { mergeBlueprints, parseBluePrints, loadBlueprintsFromConfiguration, normalizeBlueprintName } from './internal/index.js';
import { PRIORITY_NAMES } from './priorities.js';
import { BaseGeneratorDefinition, GenericTaskGroup } from './tasks.js';
import type { JHipsterGeneratorFeatures, JHipsterGeneratorOptions } from './api.js';
import CoreGenerator from '../base-core/index.js';
import { LOCAL_BLUEPRINT_PACKAGE_NAMESPACE } from './support/constants.js';
import { loadStoredAppOptions } from '../app/support/index.js';

/**
* Base class that contains blueprints support.
Expand Down
2 changes: 1 addition & 1 deletion generators/base/shared-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ import { lt as semverLessThan } from 'semver';
import { defaults } from 'lodash-es';
import { MemFsEditor, create } from 'mem-fs-editor';
import { type BaseApplication } from '../base-application/types.js';
import { type Control } from './types.js';
import { GENERATOR_JHIPSTER } from '../generator-constants.js';
import { type Control } from './types.js';

export default class SharedData<ApplicationType extends BaseApplication = BaseApplication> {
_storage: any;
Expand Down
2 changes: 1 addition & 1 deletion generators/base/support/jhipster7-context.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import chalk from 'chalk';
import { camelCase } from 'lodash-es';

import { isReservedTableName } from '../../../jdl/jhipster/reserved-keywords.js';
import { upperFirstCamelCase } from './string.js';
import {
getJavaValueGeneratorForType,
getJoinTableName,
Expand All @@ -14,6 +13,7 @@ import {
import { getDBCExtraOption } from '../../spring-data-relational/support/database-data.js';
import { getJdbcUrl, getR2dbcUrl } from '../../spring-data-relational/support/database-url.js';
import { fieldTypes } from '../../../jdl/index.js';
import { upperFirstCamelCase } from './string.js';

const { BYTES, BYTE_BUFFER } = fieldTypes.RelationalOnlyDBTypes;

Expand Down
2 changes: 1 addition & 1 deletion generators/base/support/string.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { it, describe } from 'esmocha';
import assert from 'assert';
import { it, describe } from 'esmocha';
import { stringHashCode } from './string.js';

describe('generator - base - support - string', () => {
Expand Down
2 changes: 1 addition & 1 deletion generators/base/support/write-files.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
* limitations under the License.
*/
import { it, describe, expect, esmocha } from 'esmocha';
import { joinCallbacks } from './write-files.js';
import { EditFileCallback } from '../api.js';
import { joinCallbacks } from './write-files.js';

describe('generator - base - support - writeFiles', () => {
describe('joinCallbacks', () => {
Expand Down
2 changes: 1 addition & 1 deletion generators/base/support/write-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@
*/
import { platform } from 'os';

import { normalizeLineEndings } from './contents.js';
import type { EditFileCallback } from '../api.js';
import { normalizeLineEndings } from './contents.js';

const isWin32 = platform() === 'win32';

Expand Down
2 changes: 1 addition & 1 deletion generators/bootstrap-application-base/generator.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ import { fileURLToPath } from 'url';
import { before, it, describe, expect, beforeEach } from 'esmocha';
import { snakeCase } from 'lodash-es';

import Generator from './index.js';
import { defaultHelpers as helpers, runResult } from '../../testing/index.js';
import { shouldSupportFeatures } from '../../test/support/tests.js';
import { parseChangelog } from '../base/support/timestamp.ts';
import Generator from './index.js';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
Expand Down
Loading
Loading