diff --git a/.github/actions/changesets-fixed-version-bump/index.js b/.github/actions/changesets-fixed-version-bump/index.js index 52e046f764..ce1d452901 100644 --- a/.github/actions/changesets-fixed-version-bump/index.js +++ b/.github/actions/changesets-fixed-version-bump/index.js @@ -93651,10 +93651,7 @@ Object.defineProperty(exports, "__esModule", ({ value: true })); exports.kibana = void 0; const winston_1 = __nccwpck_require__(19308); const local_1 = __nccwpck_require__(8004); -const { combine, timestamp, json } = winston_1.format; -// This is a hack to ensure that error logging works in browsers. Necessary due to: https://github.com/winstonjs/logform/issues/97 -// eslint-disable-next-line import/no-internal-modules -const errors = winston_1.format.errors || __nccwpck_require__(81925); +const { combine, timestamp, json, errors } = winston_1.format; /** * Format for logging in Kibana. */ @@ -93684,10 +93681,7 @@ exports.local = void 0; exports.getMessageOrStack = getMessageOrStack; const chalk_1 = __importDefault(__nccwpck_require__(32325)); const winston_1 = __nccwpck_require__(19308); -const { combine, timestamp, cli, printf } = winston_1.format; -// This is a hack to ensure that error logging works in browsers. Necessary due to: https://github.com/winstonjs/logform/issues/97 -// eslint-disable-next-line import/no-internal-modules -const errors = winston_1.format.errors || __nccwpck_require__(81925); +const { combine, timestamp, cli, printf, errors } = winston_1.format; /** * Format for local logging. */ diff --git a/packages/connectivity/src/scp-cf/subdomain-replacer.ts b/packages/connectivity/src/scp-cf/subdomain-replacer.ts index 466d22b44a..9567098a23 100644 --- a/packages/connectivity/src/scp-cf/subdomain-replacer.ts +++ b/packages/connectivity/src/scp-cf/subdomain-replacer.ts @@ -30,7 +30,7 @@ function isValidUrl(url: string): boolean { try { new URL(url); return true; - } catch (_) { + } catch { return false; } } diff --git a/packages/eslint-config/flat-config.js b/packages/eslint-config/flat-config.js index 650efbad24..d0374cead8 100644 --- a/packages/eslint-config/flat-config.js +++ b/packages/eslint-config/flat-config.js @@ -266,7 +266,7 @@ const flatConfig = [ rules: { '@typescript-eslint/explicit-module-boundary-types': 'off', 'import/no-internal-modules': 'off', - 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'off', 'jsdoc/require-jsdoc': 'off' } } diff --git a/packages/eslint-config/index.js b/packages/eslint-config/index.js index 4c54c91bd8..4766b9b2a6 100644 --- a/packages/eslint-config/index.js +++ b/packages/eslint-config/index.js @@ -28,7 +28,7 @@ module.exports = { rules: { '@typescript-eslint/explicit-module-boundary-types': 'off', 'import/no-internal-modules': 'off', - 'no-unused-expressions': 'off', + '@typescript-eslint/no-unused-expressions': 'off', 'jsdoc/require-jsdoc': 'off', 'import/no-relative-parent-imports': 'off' } diff --git a/packages/eslint-config/package.json b/packages/eslint-config/package.json index 809af040f9..489d84b9bd 100644 --- a/packages/eslint-config/package.json +++ b/packages/eslint-config/package.json @@ -35,7 +35,7 @@ "eslint-plugin-prettier": "^5.2.1", "eslint-plugin-regex": "^1.10.0", "eslint-plugin-unused-imports": "^4.1.4", - "typescript-eslint": "^7.18.0" + "typescript-eslint": "^8.8.1" }, "peerDependencies": { "eslint": "^8.0.0" diff --git a/packages/generator-common/src/file-writer/create-file.ts b/packages/generator-common/src/file-writer/create-file.ts index 70eaeea3e4..acab736a42 100644 --- a/packages/generator-common/src/file-writer/create-file.ts +++ b/packages/generator-common/src/file-writer/create-file.ts @@ -66,7 +66,7 @@ export async function readPrettierConfig( const config = await readFile(prettierConfigPath, { encoding: 'utf-8' }); prettierConfigCache[prettierConfigPath] = JSON.parse(config); return prettierConfigCache[prettierConfigPath]; - } catch (e) { + } catch { logger.warn( `Prettier config file not found: ${prettierConfigPath} - default is used.` ); @@ -111,7 +111,7 @@ async function formatWithPrettier( if (parser) { try { return format(content, { ...prettierOptions, parser }); - } catch (e) { + } catch { logger.warn( `Error in prettify file ${fileName} - emit unformatted content` ); diff --git a/packages/generator/src/generator.spec.ts b/packages/generator/src/generator.spec.ts index 8f3528f2b2..648e44f337 100644 --- a/packages/generator/src/generator.spec.ts +++ b/packages/generator/src/generator.spec.ts @@ -97,7 +97,7 @@ describe('generator', () => { project = await generateProject(createParsedOptions(options)); await generate(options); throw new Error('Should not go here.'); - } catch (e) { + } catch { const optionsPerService = await readFile( 'someDir/test-service-options.json', { encoding: 'utf-8' } diff --git a/packages/odata-common/src/entity-builder.spec.ts b/packages/odata-common/src/entity-builder.spec.ts index 48e7737030..f8dd304bb2 100644 --- a/packages/odata-common/src/entity-builder.spec.ts +++ b/packages/odata-common/src/entity-builder.spec.ts @@ -39,7 +39,6 @@ describe('EntityBuilder', () => { it('builds an entity with custom (de-)serializers', () => { const builder = commonEntityApiCustom.entityBuilder(); - builder.stringProperty; expect(builder.build()).toEqual(new CommonEntity(commonEntityApiCustom)); }); diff --git a/packages/temporal-de-serializers/src/temporal-de-serializers-v4.ts b/packages/temporal-de-serializers/src/temporal-de-serializers-v4.ts index e71baabe01..0885dc622a 100644 --- a/packages/temporal-de-serializers/src/temporal-de-serializers-v4.ts +++ b/packages/temporal-de-serializers/src/temporal-de-serializers-v4.ts @@ -41,7 +41,7 @@ export function serializePlainTimeToTime(value: Temporal.PlainTime): string { export function deserializeDateToTemporal(date: string): Temporal.PlainDate { try { return Temporal.PlainDate.from(date); - } catch (e) { + } catch { throw new Error( `Provided date value ${date} does not follow the Edm.Date pattern: YYYY-MM-DD` ); @@ -63,7 +63,7 @@ export function deserializeDateTimeOffsetToTemporal( ): Temporal.ZonedDateTime { try { return Temporal.Instant.from(dateTime).toZonedDateTimeISO('UTC'); - } catch (err) { + } catch { throw new Error( `Provided date-time value ${dateTime} does not follow the Edm.DateTimeOffset pattern: YYYY-MM-DDTHH:mm(:ss(.SSS))Z` ); @@ -97,7 +97,7 @@ export function deserializeDurationToTemporal( throw new Error(); } return Temporal.Duration.from(value); - } catch (e) { + } catch { throw new Error( `Provided duration value ${value} does not follow the Edm.Duration pattern: +/- P0DT0H0M0S` ); @@ -118,7 +118,7 @@ export function deserializeTimeToTemporal(time: string): Temporal.PlainTime { try { const parsed = Temporal.PlainTime.from(time, { overflow: 'reject' }); return parsed; - } catch (err) { + } catch { throw new Error( `Provided time value ${time} does not follow the Edm.TimeOfDay pattern: HH:MM:SS(.S)` ); diff --git a/packages/util/src/logger/format/kibana.ts b/packages/util/src/logger/format/kibana.ts index a4270629eb..3ed869f0de 100644 --- a/packages/util/src/logger/format/kibana.ts +++ b/packages/util/src/logger/format/kibana.ts @@ -2,11 +2,7 @@ import { format } from 'winston'; import { getMessageOrStack } from './local'; import type { TransformableInfo } from 'logform'; -const { combine, timestamp, json } = format; - -// This is a hack to ensure that error logging works in browsers. Necessary due to: https://github.com/winstonjs/logform/issues/97 -// eslint-disable-next-line import/no-internal-modules -const errors = format.errors || require('logform/errors'); +const { combine, timestamp, json, errors } = format; /** * Format for logging in Kibana. diff --git a/packages/util/src/logger/format/local.ts b/packages/util/src/logger/format/local.ts index da18c4cea2..3bfed96eaa 100644 --- a/packages/util/src/logger/format/local.ts +++ b/packages/util/src/logger/format/local.ts @@ -2,11 +2,8 @@ import chalk from 'chalk'; import { format } from 'winston'; import type { TransformableInfo } from 'logform'; -const { combine, timestamp, cli, printf } = format; +const { combine, timestamp, cli, printf, errors } = format; -// This is a hack to ensure that error logging works in browsers. Necessary due to: https://github.com/winstonjs/logform/issues/97 -// eslint-disable-next-line import/no-internal-modules -const errors = format.errors || require('logform/errors'); /** * Format for local logging. */ diff --git a/test-packages/e2e-tests/db.sqlite b/test-packages/e2e-tests/db.sqlite index 1e6a80f7e4..0e0f8c8aa6 100644 Binary files a/test-packages/e2e-tests/db.sqlite and b/test-packages/e2e-tests/db.sqlite differ diff --git a/test-packages/e2e-tests/test/proxy/odata.spec.ts b/test-packages/e2e-tests/test/proxy/odata.spec.ts index 8619035849..07d76aa9c6 100644 --- a/test-packages/e2e-tests/test/proxy/odata.spec.ts +++ b/test-packages/e2e-tests/test/proxy/odata.spec.ts @@ -1,20 +1,19 @@ import { basicHeader } from '@sap-cloud-sdk/connectivity/internal'; import { destination as e2eDestination } from '../test-util'; import { testEntityApi } from '../test-utils/test-entity-operations'; +import { + proxyBearAuth, + proxyHost, + proxyPort, + proxyUser, + proxyPassword +} from './proxy-server-config'; import type { ProxyConfiguration, HttpDestination } from '@sap-cloud-sdk/connectivity'; import type { ErrorWithCause } from '@sap-cloud-sdk/util'; import type { AxiosError } from 'axios'; -/* eslint-disable @typescript-eslint/no-var-requires */ -const { - proxyBearAuth, - proxyHost, - proxyPort, - proxyUser, - proxyPassword -} = require('./proxy-server-config'); const onPremDestination: HttpDestination = { url: e2eDestination?.url, diff --git a/test-packages/self-tests/madge-test/check-if-madge-is-working.ts b/test-packages/self-tests/madge-test/check-if-madge-is-working.ts index be7f74c1d2..7ba68fdab2 100644 --- a/test-packages/self-tests/madge-test/check-if-madge-is-working.ts +++ b/test-packages/self-tests/madge-test/check-if-madge-is-working.ts @@ -8,7 +8,7 @@ try { 'madge --extensions ts --ts-config=../../../tsconfig.json --circular ./test-modules', { stdio: 'ignore' } ); -} catch (error) { +} catch { logger.info('Circular dependency detected as expected.'); process.exit(0); } diff --git a/test-packages/type-tests/test/v2/link.test-d.ts b/test-packages/type-tests/test/v2/link.test-d.ts index 69c76e450a..c1434dc38e 100644 --- a/test-packages/type-tests/test/v2/link.test-d.ts +++ b/test-packages/type-tests/test/v2/link.test-d.ts @@ -13,6 +13,7 @@ const custom = { } }; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const deSerializer = mergeDefaultDeSerializersWith(custom); const { testEntityApi } = testService(custom); diff --git a/yarn.lock b/yarn.lock index 845fb188e0..dd07bc71f0 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1899,7 +1899,22 @@ dependencies: "@types/node" "*" -"@typescript-eslint/eslint-plugin@7.18.0", "@typescript-eslint/eslint-plugin@^7.14.1": +"@typescript-eslint/eslint-plugin@8.8.1": + version "8.8.1" + resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.8.1.tgz#9364b756d4d78bcbdf6fd3e9345e6924c68ad371" + integrity sha512-xfvdgA8AP/vxHgtgU310+WBnLB4uJQ9XdyP17RebG26rLtDrQJV3ZYrcopX91GrHmMoH8bdSwMRh2a//TiJ1jQ== + dependencies: + "@eslint-community/regexpp" "^4.10.0" + "@typescript-eslint/scope-manager" "8.8.1" + "@typescript-eslint/type-utils" "8.8.1" + "@typescript-eslint/utils" "8.8.1" + "@typescript-eslint/visitor-keys" "8.8.1" + graphemer "^1.4.0" + ignore "^5.3.1" + natural-compare "^1.4.0" + ts-api-utils "^1.3.0" + +"@typescript-eslint/eslint-plugin@^7.14.1": version "7.18.0" resolved "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.18.0.tgz#b16d3cf3ee76bf572fdf511e79c248bdec619ea3" integrity sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw== @@ -1914,18 +1929,7 @@ natural-compare "^1.4.0" ts-api-utils "^1.3.0" -"@typescript-eslint/parser@7.18.0", "@typescript-eslint/parser@^7.14.1": - version "7.18.0" - resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz#83928d0f1b7f4afa974098c64b5ce6f9051f96a0" - integrity sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg== - dependencies: - "@typescript-eslint/scope-manager" "7.18.0" - "@typescript-eslint/types" "7.18.0" - "@typescript-eslint/typescript-estree" "7.18.0" - "@typescript-eslint/visitor-keys" "7.18.0" - debug "^4.3.4" - -"@typescript-eslint/parser@^8.8.1": +"@typescript-eslint/parser@8.8.1", "@typescript-eslint/parser@^8.8.1": version "8.8.1" resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.8.1.tgz#5952ba2a83bd52024b872f3fdc8ed2d3636073b8" integrity sha512-hQUVn2Lij2NAxVFEdvIGxT9gP1tq2yM83m+by3whWFsWC+1y8pxxxHUFE1UqDu2VsGi2i6RLcv4QvouM84U+ow== @@ -1936,6 +1940,17 @@ "@typescript-eslint/visitor-keys" "8.8.1" debug "^4.3.4" +"@typescript-eslint/parser@^7.14.1": + version "7.18.0" + resolved "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.18.0.tgz#83928d0f1b7f4afa974098c64b5ce6f9051f96a0" + integrity sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg== + dependencies: + "@typescript-eslint/scope-manager" "7.18.0" + "@typescript-eslint/types" "7.18.0" + "@typescript-eslint/typescript-estree" "7.18.0" + "@typescript-eslint/visitor-keys" "7.18.0" + debug "^4.3.4" + "@typescript-eslint/scope-manager@7.18.0": version "7.18.0" resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.18.0.tgz#c928e7a9fc2c0b3ed92ab3112c614d6bd9951c83" @@ -1944,14 +1959,6 @@ "@typescript-eslint/types" "7.18.0" "@typescript-eslint/visitor-keys" "7.18.0" -"@typescript-eslint/scope-manager@8.8.0": - version "8.8.0" - resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.0.tgz#30b23a6ae5708bd7882e40675ef2f1b2beac741f" - integrity sha512-EL8eaGC6gx3jDd8GwEFEV091210U97J0jeEHrAYvIYosmEGet4wJ+g0SYmLu+oRiAwbSA5AVrt6DxLHfdd+bUg== - dependencies: - "@typescript-eslint/types" "8.8.0" - "@typescript-eslint/visitor-keys" "8.8.0" - "@typescript-eslint/scope-manager@8.8.1": version "8.8.1" resolved "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.8.1.tgz#b4bea1c0785aaebfe3c4ab059edaea1c4977e7ff" @@ -1970,16 +1977,21 @@ debug "^4.3.4" ts-api-utils "^1.3.0" +"@typescript-eslint/type-utils@8.8.1": + version "8.8.1" + resolved "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.8.1.tgz#31f59ec46e93a02b409fb4d406a368a59fad306e" + integrity sha512-qSVnpcbLP8CALORf0za+vjLYj1Wp8HSoiI8zYU5tHxRVj30702Z1Yw4cLwfNKhTPWp5+P+k1pjmD5Zd1nhxiZA== + dependencies: + "@typescript-eslint/typescript-estree" "8.8.1" + "@typescript-eslint/utils" "8.8.1" + debug "^4.3.4" + ts-api-utils "^1.3.0" + "@typescript-eslint/types@7.18.0", "@typescript-eslint/types@^7.14.1": version "7.18.0" resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.18.0.tgz#b90a57ccdea71797ffffa0321e744f379ec838c9" integrity sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ== -"@typescript-eslint/types@8.8.0": - version "8.8.0" - resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.0.tgz#08ea5df6c01984d456056434641491fbf7a1bf43" - integrity sha512-QJwc50hRCgBd/k12sTykOJbESe1RrzmX6COk8Y525C9l7oweZ+1lw9JiU56im7Amm8swlz00DRIlxMYLizr2Vw== - "@typescript-eslint/types@8.8.1": version "8.8.1" resolved "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.8.1.tgz#ebe85e0fa4a8e32a24a56adadf060103bef13bd1" @@ -1999,20 +2011,6 @@ semver "^7.6.0" ts-api-utils "^1.3.0" -"@typescript-eslint/typescript-estree@8.8.0": - version "8.8.0" - resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.0.tgz#072eaab97fdb63513fabfe1cf271812affe779e3" - integrity sha512-ZaMJwc/0ckLz5DaAZ+pNLmHv8AMVGtfWxZe/x2JVEkD5LnmhWiQMMcYT7IY7gkdJuzJ9P14fRy28lUrlDSWYdw== - dependencies: - "@typescript-eslint/types" "8.8.0" - "@typescript-eslint/visitor-keys" "8.8.0" - debug "^4.3.4" - fast-glob "^3.3.2" - is-glob "^4.0.3" - minimatch "^9.0.4" - semver "^7.6.0" - ts-api-utils "^1.3.0" - "@typescript-eslint/typescript-estree@8.8.1": version "8.8.1" resolved "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.8.1.tgz#34649f4e28d32ee49152193bc7dedc0e78e5d1ec" @@ -2037,15 +2035,15 @@ "@typescript-eslint/types" "7.18.0" "@typescript-eslint/typescript-estree" "7.18.0" -"@typescript-eslint/utils@^8.8.0": - version "8.8.0" - resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.0.tgz#bd8607e3a68c461b69169c7a5824637dc9e8b3f1" - integrity sha512-QE2MgfOTem00qrlPgyByaCHay9yb1+9BjnMFnSFkUKQfu7adBXDTnCAivURnuPPAG/qiB+kzKkZKmKfaMT0zVg== +"@typescript-eslint/utils@8.8.1", "@typescript-eslint/utils@^8.8.0": + version "8.8.1" + resolved "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.8.1.tgz#9e29480fbfa264c26946253daa72181f9f053c9d" + integrity sha512-/QkNJDbV0bdL7H7d0/y0qBbV2HTtf0TIyjSDTvvmQEzeVx8jEImEbLuOA4EsvE8gIgqMitns0ifb5uQhMj8d9w== dependencies: "@eslint-community/eslint-utils" "^4.4.0" - "@typescript-eslint/scope-manager" "8.8.0" - "@typescript-eslint/types" "8.8.0" - "@typescript-eslint/typescript-estree" "8.8.0" + "@typescript-eslint/scope-manager" "8.8.1" + "@typescript-eslint/types" "8.8.1" + "@typescript-eslint/typescript-estree" "8.8.1" "@typescript-eslint/visitor-keys@7.18.0": version "7.18.0" @@ -2055,14 +2053,6 @@ "@typescript-eslint/types" "7.18.0" eslint-visitor-keys "^3.4.3" -"@typescript-eslint/visitor-keys@8.8.0": - version "8.8.0" - resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.0.tgz#f93965abd38c82a1a1f5574290a50d02daf1cd2e" - integrity sha512-8mq51Lx6Hpmd7HnA2fcHQo3YgfX1qbccxQOgZcb4tvasu//zXRaA1j5ZRFeCw/VRAdFi4mRM9DnZw0Nu0Q2d1g== - dependencies: - "@typescript-eslint/types" "8.8.0" - eslint-visitor-keys "^3.4.3" - "@typescript-eslint/visitor-keys@8.8.1": version "8.8.1" resolved "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.8.1.tgz#0fb1280f381149fc345dfde29f7542ff4e587fc5" @@ -9557,14 +9547,14 @@ typedoc@^0.26.8: resolved "https://registry.npmjs.org/typescript/-/typescript-5.7.0-dev.20240822.tgz#f011e449f106abe96f12e81e25d9cc3e80b92f21" integrity sha512-JL60efPDEbshbweVXX18Ic5g+9iVbf2Nc3xh3eBGbLjrt5+x6KZzB3c2d+J5PoqOzPjbFATCT2FQ3W8vEGOXTg== -typescript-eslint@^7.18.0: - version "7.18.0" - resolved "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-7.18.0.tgz#e90d57649b2ad37a7475875fa3e834a6d9f61eb2" - integrity sha512-PonBkP603E3tt05lDkbOMyaxJjvKqQrXsnow72sVeOFINDE/qNmnnd+f9b4N+U7W6MXnnYyrhtmF2t08QWwUbA== +typescript-eslint@^8.8.1: + version "8.8.1" + resolved "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.8.1.tgz#b375c877b2184d883b6228170bc66f0fca847c9a" + integrity sha512-R0dsXFt6t4SAFjUSKFjMh4pXDtq04SsFKCVGDP3ZOzNP7itF0jBcZYU4fMsZr4y7O7V7Nc751dDeESbe4PbQMQ== dependencies: - "@typescript-eslint/eslint-plugin" "7.18.0" - "@typescript-eslint/parser" "7.18.0" - "@typescript-eslint/utils" "7.18.0" + "@typescript-eslint/eslint-plugin" "8.8.1" + "@typescript-eslint/parser" "8.8.1" + "@typescript-eslint/utils" "8.8.1" typescript@5.3.3: version "5.3.3"