From 10786129df7e4e102dec078d9010a4a1fc76f2c1 Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Tue, 28 Oct 2025 13:58:02 +0000 Subject: [PATCH 001/119] Eslint 9 updates - WIP --- .eslintrc | 312 --- eslint.config.js | 403 +++ examples/fe-fpm-cli/.eslintignore | 1 - examples/fe-fpm-cli/.eslintrc | 6 - examples/fe-fpm-cli/eslint.config.js | 13 + examples/fe-fpm-cli/package.json | 3 +- examples/odata-cli/.eslintignore | 1 - examples/odata-cli/.eslintrc | 7 - examples/odata-cli/eslint.config.js | 18 + examples/simple-generator/.eslintignore | 2 - examples/simple-generator/.eslintrc | 7 - examples/simple-generator/eslint.config.js | 18 + examples/ui-prompting-examples/.eslintignore | 1 - examples/ui-prompting-examples/.eslintrc.js | 38 - .../ui-prompting-examples/eslint.config.js | 59 + examples/ui-prompting-examples/package.json | 4 +- .../src/addons/preview/component.tsx | 2 +- .../src/backend/connection.ts | 3 +- .../ui-prompting-examples/src/utils/hooks.ts | 3 +- .../ui-prompting-examples/src/utils/types.ts | 8 +- package.json | 26 +- .../abap-deploy-config-inquirer/.eslintignore | 1 - .../abap-deploy-config-inquirer/.eslintrc.js | 7 - .../eslint.config.js | 13 + .../src/prompts/defaults.ts | 2 +- .../src/prompts/helpers.ts | 4 +- .../abap-deploy-config-inquirer/src/utils.ts | 4 +- .../test/prompts/defaults.test.ts | 3 +- .../.eslintignore | 1 - .../.eslintrc.js | 7 - .../eslint.config.js | 13 + .../test/app.test.ts | 10 +- .../test/unit/app/questions.test.ts | 4 - .../abap-deploy-config-writer/.eslintignore | 3 - .../abap-deploy-config-writer/.eslintrc.js | 7 - .../eslint.config.js | 13 + .../abap-deploy-config-writer/src/scripts.ts | 2 +- .../sample/test-ts-app/webapp/Component.ts | 24 +- .../webapp/controller/App.controller.ts | 1 - .../.eslintignore | 3 - .../adp-flp-config-sub-generator/.eslintrc.js | 7 - .../eslint.config.js | 13 + .../test/app.test.ts | 3 +- packages/adp-tooling/.eslintignore | 3 - packages/adp-tooling/.eslintrc.js | 7 - packages/adp-tooling/eslint.config.js | 13 + .../src/base/abap/manifest-service.ts | 5 +- packages/adp-tooling/src/base/helper.ts | 25 +- .../adp-tooling/src/preview/adp-preview.ts | 4 +- .../adp-tooling/src/preview/routes-handler.ts | 2 + packages/adp-tooling/src/types.ts | 20 +- .../writers/component-usages-writer.ts | 5 +- .../changes/writers/data-source-writer.ts | 5 +- .../writer/changes/writers/inbound-writer.ts | 5 +- .../changes/writers/new-model-writer.ts | 5 +- packages/adp-tooling/src/writer/options.ts | 5 +- .../unit/base/abap/manifest-service.test.ts | 2 +- .../adp-tooling/test/unit/base/helper.test.ts | 3 +- .../test/unit/cf/app/html5-repo.test.ts | 2 - .../test/unit/cf/core/auth.test.ts | 2 +- .../test/unit/preview/adp-preview.test.ts | 2 +- .../test/unit/ui5/validator.test.ts | 3 +- .../test/unit/writer/i18n/index.test.ts | 8 +- packages/annotation-generator/.eslintignore | 4 - packages/annotation-generator/.eslintrc.js | 29 - .../annotation-generator/eslint.config.js | 29 + .../annotation-generator/src/generation.ts | 2 +- .../annotation-generator/tsconfig.eslint.json | 2 +- packages/app-config-writer/.eslintignore | 2 - packages/app-config-writer/.eslintrc.js | 7 - packages/app-config-writer/eslint.config.js | 13 + .../src/common/package-json.ts | 1 - packages/axios-extension/.eslintignore | 2 - packages/axios-extension/.eslintrc.js | 7 - packages/axios-extension/eslint.config.js | 13 + .../src/abap/abap-service-provider.ts | 2 +- packages/axios-extension/src/abap/message.ts | 2 +- packages/axios-extension/src/auth/uaa.ts | 5 +- packages/axios-extension/src/factory.ts | 5 +- .../test/abap/lrep-service.test.ts | 3 +- .../backend-proxy-middleware/.eslintignore | 2 - .../backend-proxy-middleware/.eslintrc.js | 7 - .../backend-proxy-middleware/eslint.config.js | 13 + .../backend-proxy-middleware/src/ext/bsp.ts | 2 +- .../test/base/proxy.test.ts | 5 +- .../test/middleware.test.ts | 4 +- packages/btp-utils/.eslintignore | 2 - packages/btp-utils/.eslintrc.js | 7 - packages/btp-utils/eslint.config.js | 13 + packages/btp-utils/src/app-studio.ts | 4 +- packages/btp-utils/test/app-studio.test.ts | 2 +- packages/btp-utils/test/destination.test.ts | 2 +- packages/cap-config-writer/.eslintignore | 1 - packages/cap-config-writer/.eslintrc.js | 7 - packages/cap-config-writer/eslint.config.js | 13 + .../src/cap-writer/package-json.ts | 2 +- .../eslint.config.js | 13 + .../cards-editor-middleware/eslint.config.js | 17 + packages/cds-annotation-parser/.eslintignore | 2 - packages/cds-annotation-parser/.eslintrc | 37 - .../cds-annotation-parser/eslint.config.js | 43 + .../src/transformer/ast.ts | 2 +- .../cds-annotation-parser/test/utils/setup.ts | 2 +- .../.eslintignore | 3 - .../cds-odata-annotation-converter/.eslintrc | 10 - .../eslint.config.js | 17 + .../annotation/handlers/expression.ts | 6 +- .../transforms/annotation/visitor-state.ts | 5 +- .../tsconfig.eslint.json | 2 +- .../cf-deploy-config-inquirer/.eslintignore | 3 - .../cf-deploy-config-inquirer/.eslintrc.js | 7 - .../eslint.config.js | 13 + .../.eslintignore | 1 - .../.eslintrc.js | 7 - .../eslint.config.js | 13 + .../test/app-router.test.ts | 4 +- .../test/app.test.ts | 5 +- .../test/cap-app.test.ts | 5 +- .../cap/app/testui5app/webapp/Component.js | 19 +- .../webapp/controller/App.controller.js | 15 +- .../webapp/controller/View1.controller.js | 13 +- .../cap/app/testui5app/webapp/model/models.js | 13 +- .../test/fixtures/cap/eslint.config.mjs | 4 +- .../cf-deploy-config-writer/.eslintignore | 3 - packages/cf-deploy-config-writer/.eslintrc.js | 7 - .../cf-deploy-config-writer/eslint.config.js | 16 + .../test/unit/cap-appfrontend.test.ts | 4 +- .../test/unit/cap.test.ts | 4 +- .../test/unit/index-app.test.ts | 4 +- .../test/unit/index-appfront.test.ts | 4 +- .../test/unit/index-cap.test.ts | 2 +- .../test/unit/mta.test.ts | 6 +- .../test/unit/mtaext.test.ts | 6 +- .../.eslintignore | 1 - .../.eslintrc.js | 7 - .../eslint.config.js | 13 + .../control-property-editor/.eslintignore | 1 - packages/control-property-editor/.eslintrc.js | 16 - .../control-property-editor/eslint.config.js | 22 + packages/control-property-editor/package.json | 6 +- .../src/panels/outline/Tree.tsx | 2 +- .../properties/PropertyDocumentation.tsx | 2 +- .../src/use-local-storage.ts | 2 +- .../test/unit/utils.tsx | 7 +- packages/create/.eslintignore | 1 - packages/create/.eslintrc.js | 10 - packages/create/eslint.config.js | 13 + packages/create/src/common/prompts.ts | 2 +- .../.eslintignore | 1 - .../.eslintrc.js | 7 - .../eslint.config.js | 13 + .../deploy-config-sub-generator/.eslintignore | 1 - .../deploy-config-sub-generator/.eslintrc.js | 7 - .../eslint.config.js | 13 + .../test/app/app.test.ts | 4 +- .../test/headless/abap-headless.test.ts | 2 +- .../test/headless/cf-headless.test.ts | 8 +- packages/deploy-tooling/.eslintignore | 2 - packages/deploy-tooling/.eslintrc.js | 7 - packages/deploy-tooling/eslint.config.js | 13 + packages/deploy-tooling/src/ui5/archive.ts | 1 + packages/deploy-tooling/src/ui5/index.ts | 1 + .../adp/webapp/changes/coding/share.js | 21 +- .../webapp/ext/MyCustomPage.controller.ts | 10 +- .../test/unit/cli/archive.test.ts | 1 + packages/environment-check/.eslintignore | 1 - packages/environment-check/.eslintrc.js | 10 - packages/environment-check/eslint.config.js | 13 + .../src/checks/stored-system.ts | 10 +- .../environment-check/test/output/zip.test.ts | 4 +- .../eslint-plugin-fiori-tools/.eslintignore | 4 - .../eslint-plugin-fiori-tools/.eslintrc.js | 7 - .../config/flat/eslintrc-common.js | 14 + .../config/flat/eslintrc-prod.js | 38 + .../config/flat/eslintrc-test.js | 26 + .../config/flat/eslintrc-typescript.js | 51 + .../{ => config/legacy}/eslintrc-common.js | 0 .../{ => config/legacy}/eslintrc-prod.js | 2 +- .../{ => config/legacy}/eslintrc-test.js | 2 +- .../legacy}/eslintrc-typescript.js | 3 +- .../eslint.config.js | 21 + .../eslint-plugin-fiori-tools/package.json | 9 +- .../eslint-plugin-fiori-tools/src/index.ts | 59 +- .../test/index.test.ts | 2 +- .../eslint-plugin-fiori-tools/tsconfig.json | 2 +- packages/fe-fpm-writer/.eslintignore | 4 - packages/fe-fpm-writer/.eslintrc.js | 7 - packages/fe-fpm-writer/eslint.config.js | 13 + .../building-block/prompts/utils/service.ts | 6 +- .../src/building-block/prompts/utils/xml.ts | 2 + packages/fe-fpm-writer/src/prompts/api.ts | 2 +- packages/fe-fpm-writer/src/prompts/types.ts | 8 +- .../basic-lrop-app/ts/package.json | 4 +- .../custom-page-app/ts/package.json | 4 +- .../prompts/utils/questions.test.ts | 2 +- .../prompts/utils/service.test.ts | 2 +- .../test/unit/header-section.test.ts | 4 +- packages/feature-toggle/.eslintignore | 2 - packages/feature-toggle/.eslintrc.js | 7 - packages/feature-toggle/eslint.config.js | 13 + packages/feature-toggle/src/featureToggle.ts | 1 + packages/feature-toggle/tsconfig.eslint.json | 2 +- packages/fiori-annotation-api/.eslintignore | 4 - packages/fiori-annotation-api/.eslintrc.js | 29 - .../fiori-annotation-api/eslint.config.js | 13 + .../src/avt/annotations.ts | 113 +- packages/fiori-annotation-api/src/avt/find.ts | 14 + .../fiori-annotation-api/src/avt/metadata.ts | 67 + .../fiori-annotation-api/src/avt/pointer.ts | 29 + .../src/avt/to-internal.ts | 38 + .../fiori-annotation-api/src/cds/adapter.ts | 118 +- .../fiori-annotation-api/src/cds/change.ts | 8 + .../fiori-annotation-api/src/cds/comments.ts | 4 + .../fiori-annotation-api/src/cds/deletion.ts | 51 +- .../fiori-annotation-api/src/cds/document.ts | 12 + .../fiori-annotation-api/src/cds/indent.ts | 10 + .../fiori-annotation-api/src/cds/pointer.ts | 60 + .../src/cds/preprocessor.ts | 78 + .../src/cds/references.ts | 126 + .../fiori-annotation-api/src/cds/utils.ts | 6 + .../fiori-annotation-api/src/cds/writer.ts | 212 ++ .../src/change-converter.ts | 154 ++ packages/fiori-annotation-api/src/error.ts | 3 + .../fiori-annotation-api/src/fiori-service.ts | 48 +- .../fiori-annotation-api/src/sap/builders.ts | 15 + .../fiori-annotation-api/src/sap/collector.ts | 45 + .../fiori-annotation-api/src/sap/converter.ts | 18 + .../fiori-annotation-api/src/xml/adapter.ts | 105 + .../src/xml/references.ts | 15 + .../fiori-annotation-api/src/xml/service.ts | 5 + .../fiori-annotation-api/src/xml/writer.ts | 228 +- .../test/unit/fiori-service.test.ts | 2 +- .../fiori-app-sub-generator/.eslintignore | 3 - packages/fiori-app-sub-generator/.eslintrc.js | 7 - .../fiori-app-sub-generator/eslint.config.js | 13 + .../fioriAppGeneratorOptions.ts | 2 +- .../src/fiori-app-generator/prompting.ts | 6 +- .../src/fiori-app-generator/writing.ts | 2 +- .../src/utils/common.ts | 2 +- .../test/int/fiori-elements/headless.test.ts | 8 +- .../test/int/fiori-elements/options.test.ts | 7 +- .../int/fiori-elements/writing-v2.test.ts | 7 +- .../int/fiori-elements/writing-v4.test.ts | 8 +- .../simple_eslint/package.json | 6 +- .../simple_typescript/package.json | 6 +- .../fioriAppGenerator-lifecycle1.test.ts | 3 +- .../unit/fiori-app-generator/install.test.ts | 2 +- .../fiori-app-generator/prompting.test.ts | 2 +- .../test/unit/utils/command-runner.test.ts | 2 +- .../test/unit/utils/common.test.ts | 1 - packages/fiori-docs-embeddings/.eslintignore | 3 - packages/fiori-docs-embeddings/.eslintrc.js | 7 - .../fiori-docs-embeddings/eslint.config.js | 16 + .../test/build-fpm-docs.test.ts | 4 +- packages/fiori-elements-writer/.eslintignore | 3 - packages/fiori-elements-writer/.eslintrc.js | 7 - .../fiori-elements-writer/eslint.config.js | 13 + .../test/__snapshots__/feop.test.ts.snap | 6 +- .../test/__snapshots__/fpm.test.ts.snap | 6 +- .../test/__snapshots__/lrop.test.ts.snap | 30 +- .../test/__snapshots__/ovp.test.ts.snap | 12 +- packages/fiori-elements-writer/test/common.ts | 3 +- .../fiori-elements-writer/test/lrop.test.ts | 3 +- packages/fiori-freestyle-writer/.eslintignore | 4 - packages/fiori-freestyle-writer/.eslintrc.js | 7 - .../fiori-freestyle-writer/eslint.config.js | 13 + .../test/__snapshots__/basic.test.ts.snap | 36 +- .../__snapshots__/listdetail.test.ts.snap | 30 +- .../test/__snapshots__/worklist.test.ts.snap | 12 +- .../fiori-freestyle-writer/test/basic.test.ts | 3 +- .../fiori-freestyle-writer/test/common.ts | 3 +- packages/fiori-generator-shared/.eslintignore | 2 - packages/fiori-generator-shared/.eslintrc.js | 7 - .../fiori-generator-shared/eslint.config.js | 13 + .../src/logging/logWrapper.ts | 2 +- .../npm-package-scripts/getPackageScripts.ts | 2 +- .../test/telemetry/utils.test.ts | 4 +- packages/fiori-mcp-server/.eslintignore | 1 - packages/fiori-mcp-server/.eslintrc.js | 7 - packages/fiori-mcp-server/eslint.config.js | 13 + .../src/page-editor-api/api.ts | 5 +- .../parser/model/PageEditModel.ts | 5 +- .../parser/model/table/ColumnsAggregation.ts | 2 +- .../parser/model/utils/annotations.ts | 2 +- packages/fiori-mcp-server/src/server.ts | 2 +- .../src/utils/embeddings-path.ts | 2 +- .../test/unit/telemetry.test.ts | 3 +- .../unit/tools/execute-functionality.test.ts | 2 +- .../controller-extension/index.test.ts | 2 +- .../tools/get-functionality-details.test.ts | 2 +- .../test/unit/tools/list-fiori-apps.test.ts | 2 +- .../unit/tools/list-functionalities.test.ts | 2 +- .../tools/services/text-embedding.test.ts | 8 +- .../test/unit/tools/utils.test.ts | 2 +- .../test/unit/utils/logger.test.ts | 36 +- packages/fiori-tools-settings/.eslintignore | 2 - packages/fiori-tools-settings/.eslintrc.js | 7 - .../fiori-tools-settings/eslint.config.js | 13 + packages/flp-config-inquirer/.eslintignore | 3 - packages/flp-config-inquirer/.eslintrc.js | 7 - packages/flp-config-inquirer/eslint.config.js | 13 + .../flp-config-sub-generator/.eslintignore | 2 - .../flp-config-sub-generator/.eslintrc.js | 7 - .../flp-config-sub-generator/eslint.config.js | 13 + .../flp-config-sub-generator/test/app.test.ts | 8 +- .../flp-config-sub-generator/test/utils.ts | 2 +- packages/generator-adp/.eslintignore | 2 - packages/generator-adp/.eslintrc.js | 7 - packages/generator-adp/eslint.config.js | 13 + .../src/app/questions/cf-services.ts | 2 +- .../src/app/questions/configuration.ts | 6 +- .../generator-adp/src/utils/appWizardCache.ts | 2 +- .../test/unit/questions/configuration.test.ts | 7 +- packages/guided-answers-helper/.eslintignore | 3 - packages/guided-answers-helper/.eslintrc.js | 7 - .../guided-answers-helper/eslint.config.js | 13 + packages/i18n/.eslintignore | 4 - packages/i18n/.eslintrc.js | 7 - packages/i18n/eslint.config.js | 13 + .../i18n/src/parser/properties/lexer/index.ts | 2 +- packages/i18n/test/unit/.eslintrc | 17 - packages/i18n/test/unit/scripts/update-csv.ts | 2 +- .../test/unit/scripts/update-properties.ts | 2 +- packages/inquirer-common/.eslintignore | 3 - packages/inquirer-common/.eslintrc.js | 7 - packages/inquirer-common/eslint.config.js | 13 + .../inquirer-common/src/prompts/utility.ts | 4 +- .../test/unit/prompts/helpers.test.ts | 6 +- packages/jest-environment-ui5/.eslintrc.js | 20 - .../jest-environment-ui5/eslint.config.js | 32 + .../test/unit/index.test.js | 2 +- packages/jest-file-matchers/.eslintignore | 2 - packages/jest-file-matchers/.eslintrc.js | 10 - packages/jest-file-matchers/eslint.config.js | 13 + .../jest-file-matchers/src/matchers/index.ts | 2 +- .../src/matchers/toMatchFileSnapshot/types.ts | 1 + .../test/unit/matchers.test.ts | 4 +- packages/jest-runner-puppeteer/.eslintignore | 1 - packages/jest-runner-puppeteer/.eslintrc.js | 18 - .../jest-runner-puppeteer/eslint.config.js | 13 + packages/launch-config/.eslintignore | 1 - packages/launch-config/.eslintrc.js | 7 - packages/launch-config/eslint.config.js | 13 + .../test/debug-config/config.test.ts | 3 +- packages/logger/.eslintignore | 3 - packages/logger/.eslintrc.js | 18 - packages/logger/eslint.config.js | 13 + packages/logger/src/extension-logger/index.ts | 7 + packages/logger/src/transports/transport.ts | 34 + packages/logger/src/types.ts | 2 +- packages/logger/src/winston-logger/adapter.ts | 11 +- packages/logger/src/winston-logger/logger.ts | 67 + .../src/winston-logger/null-transport.ts | 5 + .../vscode-output-channel-transport.ts | 13 + .../mockserver-config-writer/.eslintignore | 1 - .../mockserver-config-writer/.eslintrc.js | 7 - .../mockserver-config-writer/eslint.config.js | 13 + .../mockserver-config/ui5-mock-yaml.test.ts | 6 +- packages/nodejs-utils/.eslintignore | 3 - packages/nodejs-utils/.eslintrc.js | 7 - packages/nodejs-utils/eslint.config.js | 13 + .../test/unit/commandRunner.test.ts | 2 +- .../odata-annotation-core-types/.eslintignore | 2 - .../odata-annotation-core-types/.eslintrc | 9 - .../eslint.config.js | 13 + packages/odata-annotation-core/.eslintignore | 2 - packages/odata-annotation-core/.eslintrc | 9 - .../odata-annotation-core/eslint.config.js | 13 + .../test/utils/metadata.test.ts | 9 +- packages/odata-entity-model/.eslintignore | 2 - packages/odata-entity-model/.eslintrc | 7 - packages/odata-entity-model/eslint.config.js | 13 + .../test/metadata-service-cds.test.ts | 3 +- packages/odata-service-inquirer/.eslintignore | 1 - packages/odata-service-inquirer/.eslintrc.js | 7 - .../odata-service-inquirer/eslint.config.js | 13 + .../datasources/cap-project/cap-helpers.ts | 2 +- .../sap-system/abap-on-prem/questions.ts | 2 +- .../sap-system/service-selection/questions.ts | 2 +- .../service-selection/service-helper.ts | 2 +- .../src/prompts/logger-helper.ts | 2 +- packages/odata-service-inquirer/src/types.ts | 2 +- .../cap-project/fixtures/bookshop/index.js | 2 +- .../fixtures/bookshop/srv/cat-service.js | 35 +- .../prompts/cap-project/questions.test.ts | 4 +- .../sap-system/credentials/questions.test.ts | 1 + packages/odata-service-writer/.eslintignore | 4 - packages/odata-service-writer/.eslintrc.js | 7 - .../odata-service-writer/eslint.config.js | 13 + .../src/data/annotations.ts | 6 +- .../odata-service-writer/src/data/manifest.ts | 2 +- packages/odata-vocabularies/.eslintignore | 1 - packages/odata-vocabularies/.eslintrc.js | 7 - packages/odata-vocabularies/eslint.config.js | 17 + .../src/vocabulary-service.ts | 2 +- packages/playwright/.eslintignore | 2 - packages/playwright/.eslintrc.js | 7 - packages/playwright/eslint.config.js | 13 + .../preview-middleware-client/.eslintignore | 1 - .../preview-middleware-client/.eslintrc.js | 38 - .../eslint.config.js | 70 + .../preview-middleware-client/package.json | 1 + .../adp/controllers/AddFragment.controller.ts | 15 + .../adp/controllers/AddSubpage.controller.ts | 15 +- .../AddTableColumnFragments.controller.ts | 10 +- .../adp/controllers/BaseDialog.controller.ts | 14 +- .../ControllerExtension.controller.ts | 12 + .../controllers/ExtensionPoint.controller.ts | 13 + .../FileExistsDialog.controller.ts | 14 + .../src/adp/dialog-factory.ts | 15 +- .../src/adp/extension-point.ts | 13 +- .../src/adp/init-dialogs.ts | 4 +- .../preview-middleware-client/src/adp/init.ts | 4 + .../common/add-controller-to-page.ts | 12 +- .../common/add-new-annotation-file.ts | 17 +- .../common/create-page-action.ts | 17 +- .../common/op-add-custom-section.ts | 16 +- .../common/op-add-header-field.ts | 20 +- .../src/adp/quick-actions/common/utils.ts | 6 +- .../adp/quick-actions/enablement-validator.ts | 1 + .../fe-v2/change-table-columns.ts | 25 +- .../fe-v2/create-table-action.ts | 21 +- .../fe-v2/create-table-custom-column.ts | 23 +- ...r-enable-semantic-date-range-filter-bar.ts | 19 +- .../fe-v2/lr-enable-table-filtering.ts | 14 +- .../fe-v2/lr-enable-variant-management.ts | 14 +- .../fe-v2/lr-toggle-clear-filter-bar.ts | 20 +- .../fe-v2/op-enable-empty-row-mode.ts | 20 +- .../fe-v2/op-enable-variant-management.ts | 22 +- .../src/adp/quick-actions/fe-v2/registry.ts | 10 +- .../src/adp/quick-actions/fe-v2/utils.ts | 11 +- .../fe-v4/change-table-columns.ts | 17 +- .../fe-v4/create-table-action.ts | 8 + .../fe-v4/create-table-custom-column.ts | 11 + .../fe-v4/enable-variant-management.ts | 14 +- ...r-enable-semantic-date-range-filter-bar.ts | 22 +- .../fe-v4/lr-enable-table-filtering.ts | 17 +- .../fe-v4/lr-toggle-clear-filter-bar.ts | 22 +- .../fe-v4/op-enable-empty-row-mode.ts | 17 +- .../src/adp/quick-actions/fe-v4/registry.ts | 4 + .../src/adp/quick-actions/fe-v4/utils.ts | 11 +- .../adp/quick-actions/quick-action-base.ts | 16 +- .../quick-actions/simple-quick-action-base.ts | 26 +- .../quick-actions/table-quick-action-base.ts | 46 +- .../src/adp/utils.ts | 5 +- .../src/cpe/changes/flex-change.ts | 4 +- .../src/cpe/changes/service.ts | 10 +- .../src/cpe/changes/validator.ts | 8 +- .../src/cpe/communication-service.ts | 8 +- .../src/cpe/connector-service.ts | 5 +- .../src/cpe/control-data.ts | 15 +- .../src/cpe/feature-service.ts | 3 + .../preview-middleware-client/src/cpe/init.ts | 7 +- .../src/cpe/logger.ts | 8 +- .../src/cpe/outline/editable.ts | 2 +- .../src/cpe/outline/nodes.ts | 13 +- .../src/cpe/outline/service.ts | 4 + .../quick-actions/quick-action-definition.ts | 2 +- .../cpe/quick-actions/quick-action-service.ts | 37 +- .../src/cpe/quick-actions/registry.ts | 11 +- .../src/cpe/quick-actions/utils.ts | 24 +- .../src/cpe/rta-service.ts | 15 +- .../src/cpe/selection.ts | 20 +- .../src/cpe/types.ts | 9 +- .../src/cpe/utils.ts | 6 + .../src/flp/WorkspaceConnector.ts | 5 +- .../src/flp/common.ts | 2 +- .../src/flp/enableFakeConnector.ts | 4 +- .../src/flp/homepage/Component.ts | 2 +- .../preview-middleware-client/src/flp/init.ts | 6 +- .../src/flp/initCdm.ts | 8 +- .../src/flp/initRta.ts | 4 +- .../preview-middleware-client/src/i18n.ts | 24 + .../src/utils/fe-v2.ts | 4 +- .../src/utils/fe-v4.ts | 19 +- .../src/utils/version.ts | 3 +- .../test/__mock__/sap/base/util/merge.ts | 2 +- .../__mock__/sap/f/FlexibleColumnLayout.ts | 4 +- .../test/__mock__/sap/m/FlexBox.ts | 4 +- .../test/__mock__/sap/ui/VersionInfo.ts | 2 +- .../test/__mock__/sap/ui/base/DataType.ts | 5 +- .../__mock__/sap/ui/base/ManagedObject.ts | 2 +- .../__mock__/sap/ui/core/ElementRegistry.ts | 2 +- .../__mock__/sap/ui/core/mvc/Controller.ts | 3 +- .../util/reflection/JsControlTreeModifier.ts | 2 +- .../test/__mock__/sap/ui/fl/Layer.ts | 2 +- .../test/__mock__/sap/ui/fl/Scenario.ts | 2 +- .../flexObjects/FlexObjectFactory.ts | 2 +- .../sap/ui/fl/write/api/ChangesWriteAPI.ts | 2 +- .../api/connectors/ObjectStorageConnector.ts | 2 +- .../__mock__/sap/ui/rta/RuntimeAuthoring.ts | 2 +- .../test/unit/adp/control-utils.test.ts | 1 - .../AddFragment.controller.test.ts | 8 +- .../controllers/AddSubpage.controller.test.ts | 17 +- ...AddTableColumnFragments.controller.test.ts | 17 +- .../ControllerExtension.controller.test.ts | 2 +- .../FileExistDialog.controller.test.ts | 2 +- .../test/unit/adp/dialog-factory.test.ts | 34 +- .../test/unit/adp/init-dialogs.test.ts | 2 +- .../test/unit/adp/init.test.ts | 2 +- .../test/unit/adp/quick-actions/fe-v2.test.ts | 37 +- .../test/unit/adp/quick-actions/fe-v4.test.ts | 22 +- .../test/unit/adp/quick-actions/load.test.ts | 2 +- .../test/unit/cpe/changes/flex-change.test.ts | 4 +- .../test/unit/cpe/changes/service.test.ts | 6 +- .../test/unit/cpe/changes/validator.spec.ts | 16 +- .../unit/cpe/context-menu-service.test.ts | 5 +- .../test/unit/cpe/control-data.test.ts | 2 +- .../test/unit/cpe/init.test.ts | 3 +- .../test/unit/cpe/logger.test.ts | 2 +- .../unit/cpe/quick-actions/service.test.ts | 7 +- .../test/unit/cpe/rta-service.test.ts | 5 +- .../test/unit/flp/initCdm.test.ts | 2 +- .../test/unit/utils/error.test.ts | 2 +- .../types/sap.fe.core.ts | 8 +- .../types/sap.ui.dt.d.ts | 1 + .../types/sap.ushell.d.ts | 1 + packages/preview-middleware/.eslintignore | 2 - packages/preview-middleware/.eslintrc.js | 7 - packages/preview-middleware/eslint.config.js | 13 + packages/preview-middleware/src/base/flex.ts | 1 + packages/preview-middleware/src/base/flp.ts | 4 +- packages/preview-middleware/src/base/test.ts | 1 + .../preview-middleware/src/ui5/middleware.ts | 1 + .../webapp/test/locate-reuse-libs.js | 4 +- .../test/unit/base/flex.test.ts | 1 + .../test/unit/base/flp.test.ts | 13 +- .../test/unit/base/test.test.ts | 1 + packages/project-access/.eslintignore | 2 - packages/project-access/.eslintrc.js | 7 - packages/project-access/eslint.config.js | 13 + .../project-access/src/file/file-search.ts | 1 - packages/project-access/src/project/access.ts | 11 +- packages/project-access/src/project/search.ts | 4 +- .../project-access/src/types/package/basic.ts | 27 +- .../src/types/package/literal-union.ts | 21 +- .../src/types/package/package-json.ts | 249 +- .../src/types/package/primitive.ts | 4 +- .../project-input-validator/.eslintignore | 1 - packages/project-input-validator/.eslintrc.js | 7 - .../project-input-validator/eslint.config.js | 13 + packages/project-integrity/.eslintignore | 3 - packages/project-integrity/.eslintrc.js | 7 - packages/project-integrity/eslint.config.js | 13 + packages/reload-middleware/.eslintignore | 2 - packages/reload-middleware/.eslintrc.js | 7 - packages/reload-middleware/eslint.config.js | 13 + .../reload-middleware/src/base/livereload.ts | 2 +- .../reload-middleware/src/ui5/middleware.ts | 1 + .../.eslintignore | 1 - .../.eslintrc.js | 7 - .../eslint.config.js | 13 + .../test/app-config.test.ts | 3 +- .../test/prompts/prompts.test.ts | 2 +- .../test/utils/validators.test.ts | 3 +- .../serve-static-middleware/.eslintignore | 2 - packages/serve-static-middleware/.eslintrc.js | 7 - .../serve-static-middleware/eslint.config.js | 13 + .../src/ui5/middleware.ts | 1 + .../test/ui5/middleware.test.ts | 18 +- packages/store/.eslintignore | 3 - packages/store/.eslintrc.js | 18 - packages/store/eslint.config.js | 13 + packages/store/src/data-access/filesystem.ts | 73 +- packages/store/src/data-access/hybrid.ts | 56 +- packages/store/src/data-access/index.ts | 9 + packages/store/src/data-provider/api-hub.ts | 20 + .../store/src/data-provider/backend-system.ts | 26 + packages/store/src/data-provider/index.ts | 12 +- .../src/data-provider/system-migration.ts | 19 + .../src/data-provider/telemetry-setting.ts | 19 + packages/store/src/decorators/index.ts | 18 + packages/store/src/entities/api-hub.ts | 14 + packages/store/src/entities/backend-system.ts | 33 + .../src/entities/system-migration-status.ts | 16 +- .../store/src/entities/telemetry-setting.ts | 11 + packages/store/src/i18n.ts | 5 + packages/store/src/index.ts | 7 + .../store/src/secure-store/dummy-store.ts | 27 + packages/store/src/secure-store/index.ts | 3 +- packages/store/src/secure-store/key-store.ts | 27 + packages/store/src/secure-store/types.ts | 12 +- .../store/src/services/api-hub/migration.ts | 5 + .../store/src/services/api-hub/service.ts | 25 + packages/store/src/services/backend-system.ts | 43 + packages/store/src/services/index.ts | 15 + .../store/src/services/telemetry-setting.ts | 26 + packages/store/src/types.ts | 6 +- packages/store/src/utils/app-studio.ts | 8 +- packages/store/src/utils/index.ts | 20 +- .../test/unit/data-access/filesystem.test.ts | 1 + .../test/unit/secure-store/key-store.test.ts | 3 +- packages/store/tsconfig.eslint.json | 2 +- packages/system-access/.eslintignore | 2 - packages/system-access/.eslintrc.js | 7 - packages/system-access/eslint.config.js | 13 + packages/telemetry/.eslintignore | 1 - packages/telemetry/.eslintrc.js | 10 - packages/telemetry/eslint.config.js | 13 + packages/telemetry/src/base/config-state.ts | 1 - .../telemetry/src/base/interceptor/index.ts | 4 - .../telemetry/src/base/performance/entries.ts | 12 +- .../src/base/utils/param-processing.ts | 6 +- packages/telemetry/test/jest.setup.ts | 2 +- .../telemetrySettings/init-settings.test.ts | 1 - .../test/tools-suite-telemetry/index.test.ts | 4 +- .../test/util/paramProcessing.test.ts | 4 +- packages/text-document-utils/.eslintignore | 1 - packages/text-document-utils/.eslintrc.js | 7 - packages/text-document-utils/eslint.config.js | 13 + packages/ui-components/.eslintignore | 2 - packages/ui-components/.eslintrc.js | 38 - packages/ui-components/eslint.config.js | 52 + packages/ui-components/package.json | 5 +- .../UIActionCallout/UIActionCallout.tsx | 2 +- .../UIQuickNavigation/UIQuickNavigation.tsx | 1 - .../src/components/UISection/UISections.tsx | 2 +- .../src/components/UITable/UITable.tsx | 2 +- packages/ui-components/tsconfig.eslint.json | 2 +- packages/ui-prompting/.eslintignore | 2 - packages/ui-prompting/.eslintrc.js | 38 - packages/ui-prompting/eslint.config.js | 52 + packages/ui-prompting/package.json | 3 +- packages/ui-prompting/src/utilities/utils.ts | 2 + packages/ui-service-inquirer/.eslintignore | 3 - packages/ui-service-inquirer/.eslintrc.js | 7 - packages/ui-service-inquirer/eslint.config.js | 13 + .../test/prompt-helper.test.ts | 1 - .../ui-service-sub-generator/.eslintignore | 3 - .../ui-service-sub-generator/.eslintrc.js | 7 - .../ui-service-sub-generator/eslint.config.js | 13 + .../test/utils.test.ts | 1 - .../ui5-application-inquirer/.eslintignore | 3 - .../ui5-application-inquirer/.eslintrc.js | 7 - .../ui5-application-inquirer/eslint.config.js | 13 + .../src/prompts/index.ts | 3 +- .../src/prompts/prompt-helpers.ts | 2 +- packages/ui5-application-writer/.eslintignore | 4 - packages/ui5-application-writer/.eslintrc.js | 7 - .../ui5-application-writer/eslint.config.js | 13 + .../templates/optional/eslint/package.json | 6 +- .../optional/typescript/package.json | 6 +- .../test/__snapshots__/options.test.ts.snap | 18 +- packages/ui5-config/.eslintignore | 4 - packages/ui5-config/.eslintrc.js | 7 - packages/ui5-config/eslint.config.js | 13 + packages/ui5-config/src/defaults.ts | 2 +- packages/ui5-config/src/ui5config.ts | 4 +- packages/ui5-info/.eslintignore | 3 - packages/ui5-info/.eslintrc.js | 7 - packages/ui5-info/eslint.config.js | 13 + packages/ui5-info/test/commands.test.ts | 2 +- packages/ui5-library-inquirer/.eslintignore | 3 - packages/ui5-library-inquirer/.eslintrc.js | 7 - .../ui5-library-inquirer/eslint.config.js | 13 + .../.eslintignore | 2 - .../.eslintrc.js | 7 - .../eslint.config.js | 13 + .../test/unit/choices.test.ts | 3 +- .../test/unit/prompts/helpers.test.ts | 1 - .../.eslintignore | 3 - .../.eslintrc.js | 7 - .../eslint.config.js | 13 + .../test/unit/app.test.ts | 1 - .../test_project_lrop_v2/webapp/Component.js | 2 +- .../src/main/webapp/Component.js | 2 +- .../.eslintignore | 3 - .../ui5-library-reference-writer/.eslintrc.js | 7 - .../eslint.config.js | 13 + .../ui5-library-sub-generator/.eslintignore | 3 - .../ui5-library-sub-generator/.eslintrc.js | 7 - .../eslint.config.js | 13 + packages/ui5-library-writer/.eslintignore | 4 - packages/ui5-library-writer/.eslintrc.js | 7 - packages/ui5-library-writer/eslint.config.js | 13 + .../optional/typescript/package.json | 9 +- packages/ui5-proxy-middleware/.eslintignore | 4 - packages/ui5-proxy-middleware/.eslintrc.js | 7 - .../ui5-proxy-middleware/eslint.config.js | 13 + .../ui5-proxy-middleware/src/base/utils.ts | 1 + .../src/ui5/middleware.ts | 2 + .../test/base/proxy.test.ts | 2 +- .../test/base/utils.test.ts | 6 +- .../test/ui5/middleware.test.ts | 4 +- packages/ui5-test-writer/.eslintignore | 3 - packages/ui5-test-writer/.eslintrc.js | 7 - packages/ui5-test-writer/eslint.config.js | 13 + .../.eslintignore | 3 - .../xml-odata-annotation-converter/.eslintrc | 12 - .../eslint.config.js | 13 + .../src/printer/csdl-to-xml.ts | 9 +- .../src/printer/document-modifier.ts | 1 + packages/yaml/.eslintignore | 2 - packages/yaml/.eslintrc.js | 7 - packages/yaml/eslint.config.js | 13 + pnpm-lock.yaml | 2301 ++++++++--------- .../adaptation-editor/.eslintignore | 2 - .../adaptation-editor/.eslintrc.js | 10 - .../adaptation-editor/eslint.config.js | 17 + .../manual-test-case-reporter.ts | 2 +- .../adaptation-editor/package.json | 1 + .../adaptation-editor/src/global-setup.ts | 62 +- .../integration/adaptation-editor/version.js | 8 +- types/.eslintrc | 7 - types/.eslintrc.js | 10 - types/eslint.config.js | 18 + 706 files changed, 7083 insertions(+), 3771 deletions(-) delete mode 100644 .eslintrc create mode 100644 eslint.config.js delete mode 100644 examples/fe-fpm-cli/.eslintignore delete mode 100644 examples/fe-fpm-cli/.eslintrc create mode 100644 examples/fe-fpm-cli/eslint.config.js delete mode 100644 examples/odata-cli/.eslintignore delete mode 100644 examples/odata-cli/.eslintrc create mode 100644 examples/odata-cli/eslint.config.js delete mode 100644 examples/simple-generator/.eslintignore delete mode 100644 examples/simple-generator/.eslintrc create mode 100644 examples/simple-generator/eslint.config.js delete mode 100644 examples/ui-prompting-examples/.eslintignore delete mode 100644 examples/ui-prompting-examples/.eslintrc.js create mode 100644 examples/ui-prompting-examples/eslint.config.js delete mode 100644 packages/abap-deploy-config-inquirer/.eslintignore delete mode 100644 packages/abap-deploy-config-inquirer/.eslintrc.js create mode 100644 packages/abap-deploy-config-inquirer/eslint.config.js delete mode 100644 packages/abap-deploy-config-sub-generator/.eslintignore delete mode 100644 packages/abap-deploy-config-sub-generator/.eslintrc.js create mode 100644 packages/abap-deploy-config-sub-generator/eslint.config.js delete mode 100644 packages/abap-deploy-config-writer/.eslintignore delete mode 100644 packages/abap-deploy-config-writer/.eslintrc.js create mode 100644 packages/abap-deploy-config-writer/eslint.config.js delete mode 100644 packages/adp-flp-config-sub-generator/.eslintignore delete mode 100644 packages/adp-flp-config-sub-generator/.eslintrc.js create mode 100644 packages/adp-flp-config-sub-generator/eslint.config.js delete mode 100644 packages/adp-tooling/.eslintignore delete mode 100644 packages/adp-tooling/.eslintrc.js create mode 100644 packages/adp-tooling/eslint.config.js delete mode 100644 packages/annotation-generator/.eslintignore delete mode 100644 packages/annotation-generator/.eslintrc.js create mode 100644 packages/annotation-generator/eslint.config.js delete mode 100644 packages/app-config-writer/.eslintignore delete mode 100644 packages/app-config-writer/.eslintrc.js create mode 100644 packages/app-config-writer/eslint.config.js delete mode 100644 packages/axios-extension/.eslintignore delete mode 100644 packages/axios-extension/.eslintrc.js create mode 100644 packages/axios-extension/eslint.config.js delete mode 100644 packages/backend-proxy-middleware/.eslintignore delete mode 100644 packages/backend-proxy-middleware/.eslintrc.js create mode 100644 packages/backend-proxy-middleware/eslint.config.js delete mode 100644 packages/btp-utils/.eslintignore delete mode 100644 packages/btp-utils/.eslintrc.js create mode 100644 packages/btp-utils/eslint.config.js delete mode 100644 packages/cap-config-writer/.eslintignore delete mode 100644 packages/cap-config-writer/.eslintrc.js create mode 100644 packages/cap-config-writer/eslint.config.js create mode 100644 packages/cards-editor-config-writer/eslint.config.js create mode 100644 packages/cards-editor-middleware/eslint.config.js delete mode 100644 packages/cds-annotation-parser/.eslintignore delete mode 100644 packages/cds-annotation-parser/.eslintrc create mode 100644 packages/cds-annotation-parser/eslint.config.js delete mode 100644 packages/cds-odata-annotation-converter/.eslintignore delete mode 100644 packages/cds-odata-annotation-converter/.eslintrc create mode 100644 packages/cds-odata-annotation-converter/eslint.config.js delete mode 100644 packages/cf-deploy-config-inquirer/.eslintignore delete mode 100644 packages/cf-deploy-config-inquirer/.eslintrc.js create mode 100644 packages/cf-deploy-config-inquirer/eslint.config.js delete mode 100644 packages/cf-deploy-config-sub-generator/.eslintignore delete mode 100644 packages/cf-deploy-config-sub-generator/.eslintrc.js create mode 100644 packages/cf-deploy-config-sub-generator/eslint.config.js delete mode 100644 packages/cf-deploy-config-writer/.eslintignore delete mode 100644 packages/cf-deploy-config-writer/.eslintrc.js create mode 100644 packages/cf-deploy-config-writer/eslint.config.js delete mode 100644 packages/control-property-editor-common/.eslintignore delete mode 100644 packages/control-property-editor-common/.eslintrc.js create mode 100644 packages/control-property-editor-common/eslint.config.js delete mode 100644 packages/control-property-editor/.eslintignore delete mode 100644 packages/control-property-editor/.eslintrc.js create mode 100644 packages/control-property-editor/eslint.config.js delete mode 100644 packages/create/.eslintignore delete mode 100644 packages/create/.eslintrc.js create mode 100644 packages/create/eslint.config.js delete mode 100644 packages/deploy-config-generator-shared/.eslintignore delete mode 100644 packages/deploy-config-generator-shared/.eslintrc.js create mode 100644 packages/deploy-config-generator-shared/eslint.config.js delete mode 100644 packages/deploy-config-sub-generator/.eslintignore delete mode 100644 packages/deploy-config-sub-generator/.eslintrc.js create mode 100644 packages/deploy-config-sub-generator/eslint.config.js delete mode 100644 packages/deploy-tooling/.eslintignore delete mode 100644 packages/deploy-tooling/.eslintrc.js create mode 100644 packages/deploy-tooling/eslint.config.js delete mode 100644 packages/environment-check/.eslintignore delete mode 100644 packages/environment-check/.eslintrc.js create mode 100644 packages/environment-check/eslint.config.js delete mode 100644 packages/eslint-plugin-fiori-tools/.eslintignore delete mode 100644 packages/eslint-plugin-fiori-tools/.eslintrc.js create mode 100644 packages/eslint-plugin-fiori-tools/config/flat/eslintrc-common.js create mode 100644 packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js create mode 100644 packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js create mode 100644 packages/eslint-plugin-fiori-tools/config/flat/eslintrc-typescript.js rename packages/eslint-plugin-fiori-tools/{ => config/legacy}/eslintrc-common.js (100%) rename packages/eslint-plugin-fiori-tools/{ => config/legacy}/eslintrc-prod.js (93%) rename packages/eslint-plugin-fiori-tools/{ => config/legacy}/eslintrc-test.js (90%) rename packages/eslint-plugin-fiori-tools/{ => config/legacy}/eslintrc-typescript.js (95%) create mode 100644 packages/eslint-plugin-fiori-tools/eslint.config.js delete mode 100644 packages/fe-fpm-writer/.eslintignore delete mode 100644 packages/fe-fpm-writer/.eslintrc.js create mode 100644 packages/fe-fpm-writer/eslint.config.js delete mode 100644 packages/feature-toggle/.eslintignore delete mode 100644 packages/feature-toggle/.eslintrc.js create mode 100644 packages/feature-toggle/eslint.config.js delete mode 100644 packages/fiori-annotation-api/.eslintignore delete mode 100644 packages/fiori-annotation-api/.eslintrc.js create mode 100644 packages/fiori-annotation-api/eslint.config.js delete mode 100644 packages/fiori-app-sub-generator/.eslintignore delete mode 100644 packages/fiori-app-sub-generator/.eslintrc.js create mode 100644 packages/fiori-app-sub-generator/eslint.config.js delete mode 100644 packages/fiori-docs-embeddings/.eslintignore delete mode 100644 packages/fiori-docs-embeddings/.eslintrc.js create mode 100644 packages/fiori-docs-embeddings/eslint.config.js delete mode 100644 packages/fiori-elements-writer/.eslintignore delete mode 100644 packages/fiori-elements-writer/.eslintrc.js create mode 100644 packages/fiori-elements-writer/eslint.config.js delete mode 100644 packages/fiori-freestyle-writer/.eslintignore delete mode 100644 packages/fiori-freestyle-writer/.eslintrc.js create mode 100644 packages/fiori-freestyle-writer/eslint.config.js delete mode 100644 packages/fiori-generator-shared/.eslintignore delete mode 100644 packages/fiori-generator-shared/.eslintrc.js create mode 100644 packages/fiori-generator-shared/eslint.config.js delete mode 100644 packages/fiori-mcp-server/.eslintignore delete mode 100644 packages/fiori-mcp-server/.eslintrc.js create mode 100644 packages/fiori-mcp-server/eslint.config.js delete mode 100644 packages/fiori-tools-settings/.eslintignore delete mode 100644 packages/fiori-tools-settings/.eslintrc.js create mode 100644 packages/fiori-tools-settings/eslint.config.js delete mode 100644 packages/flp-config-inquirer/.eslintignore delete mode 100644 packages/flp-config-inquirer/.eslintrc.js create mode 100644 packages/flp-config-inquirer/eslint.config.js delete mode 100644 packages/flp-config-sub-generator/.eslintignore delete mode 100644 packages/flp-config-sub-generator/.eslintrc.js create mode 100644 packages/flp-config-sub-generator/eslint.config.js delete mode 100644 packages/generator-adp/.eslintignore delete mode 100644 packages/generator-adp/.eslintrc.js create mode 100644 packages/generator-adp/eslint.config.js delete mode 100644 packages/guided-answers-helper/.eslintignore delete mode 100644 packages/guided-answers-helper/.eslintrc.js create mode 100644 packages/guided-answers-helper/eslint.config.js delete mode 100644 packages/i18n/.eslintignore delete mode 100644 packages/i18n/.eslintrc.js create mode 100644 packages/i18n/eslint.config.js delete mode 100644 packages/i18n/test/unit/.eslintrc delete mode 100644 packages/inquirer-common/.eslintignore delete mode 100644 packages/inquirer-common/.eslintrc.js create mode 100644 packages/inquirer-common/eslint.config.js delete mode 100644 packages/jest-environment-ui5/.eslintrc.js create mode 100644 packages/jest-environment-ui5/eslint.config.js delete mode 100644 packages/jest-file-matchers/.eslintignore delete mode 100644 packages/jest-file-matchers/.eslintrc.js create mode 100644 packages/jest-file-matchers/eslint.config.js delete mode 100644 packages/jest-runner-puppeteer/.eslintignore delete mode 100644 packages/jest-runner-puppeteer/.eslintrc.js create mode 100644 packages/jest-runner-puppeteer/eslint.config.js delete mode 100644 packages/launch-config/.eslintignore delete mode 100644 packages/launch-config/.eslintrc.js create mode 100644 packages/launch-config/eslint.config.js delete mode 100644 packages/logger/.eslintignore delete mode 100644 packages/logger/.eslintrc.js create mode 100644 packages/logger/eslint.config.js delete mode 100644 packages/mockserver-config-writer/.eslintignore delete mode 100644 packages/mockserver-config-writer/.eslintrc.js create mode 100644 packages/mockserver-config-writer/eslint.config.js delete mode 100644 packages/nodejs-utils/.eslintignore delete mode 100644 packages/nodejs-utils/.eslintrc.js create mode 100644 packages/nodejs-utils/eslint.config.js delete mode 100644 packages/odata-annotation-core-types/.eslintignore delete mode 100644 packages/odata-annotation-core-types/.eslintrc create mode 100644 packages/odata-annotation-core-types/eslint.config.js delete mode 100644 packages/odata-annotation-core/.eslintignore delete mode 100644 packages/odata-annotation-core/.eslintrc create mode 100644 packages/odata-annotation-core/eslint.config.js delete mode 100644 packages/odata-entity-model/.eslintignore delete mode 100644 packages/odata-entity-model/.eslintrc create mode 100644 packages/odata-entity-model/eslint.config.js delete mode 100644 packages/odata-service-inquirer/.eslintignore delete mode 100644 packages/odata-service-inquirer/.eslintrc.js create mode 100644 packages/odata-service-inquirer/eslint.config.js delete mode 100644 packages/odata-service-writer/.eslintignore delete mode 100644 packages/odata-service-writer/.eslintrc.js create mode 100644 packages/odata-service-writer/eslint.config.js delete mode 100644 packages/odata-vocabularies/.eslintignore delete mode 100644 packages/odata-vocabularies/.eslintrc.js create mode 100644 packages/odata-vocabularies/eslint.config.js delete mode 100644 packages/playwright/.eslintignore delete mode 100644 packages/playwright/.eslintrc.js create mode 100644 packages/playwright/eslint.config.js delete mode 100644 packages/preview-middleware-client/.eslintignore delete mode 100644 packages/preview-middleware-client/.eslintrc.js create mode 100644 packages/preview-middleware-client/eslint.config.js delete mode 100644 packages/preview-middleware/.eslintignore delete mode 100644 packages/preview-middleware/.eslintrc.js create mode 100644 packages/preview-middleware/eslint.config.js delete mode 100644 packages/project-access/.eslintignore delete mode 100644 packages/project-access/.eslintrc.js create mode 100644 packages/project-access/eslint.config.js delete mode 100644 packages/project-input-validator/.eslintignore delete mode 100644 packages/project-input-validator/.eslintrc.js create mode 100644 packages/project-input-validator/eslint.config.js delete mode 100644 packages/project-integrity/.eslintignore delete mode 100644 packages/project-integrity/.eslintrc.js create mode 100644 packages/project-integrity/eslint.config.js delete mode 100644 packages/reload-middleware/.eslintignore delete mode 100644 packages/reload-middleware/.eslintrc.js create mode 100644 packages/reload-middleware/eslint.config.js delete mode 100644 packages/repo-app-import-sub-generator/.eslintignore delete mode 100644 packages/repo-app-import-sub-generator/.eslintrc.js create mode 100644 packages/repo-app-import-sub-generator/eslint.config.js delete mode 100644 packages/serve-static-middleware/.eslintignore delete mode 100644 packages/serve-static-middleware/.eslintrc.js create mode 100644 packages/serve-static-middleware/eslint.config.js delete mode 100644 packages/store/.eslintignore delete mode 100644 packages/store/.eslintrc.js create mode 100644 packages/store/eslint.config.js delete mode 100644 packages/system-access/.eslintignore delete mode 100644 packages/system-access/.eslintrc.js create mode 100644 packages/system-access/eslint.config.js delete mode 100644 packages/telemetry/.eslintignore delete mode 100644 packages/telemetry/.eslintrc.js create mode 100644 packages/telemetry/eslint.config.js delete mode 100644 packages/text-document-utils/.eslintignore delete mode 100644 packages/text-document-utils/.eslintrc.js create mode 100644 packages/text-document-utils/eslint.config.js delete mode 100644 packages/ui-components/.eslintignore delete mode 100644 packages/ui-components/.eslintrc.js create mode 100644 packages/ui-components/eslint.config.js delete mode 100644 packages/ui-prompting/.eslintignore delete mode 100644 packages/ui-prompting/.eslintrc.js create mode 100644 packages/ui-prompting/eslint.config.js delete mode 100644 packages/ui-service-inquirer/.eslintignore delete mode 100644 packages/ui-service-inquirer/.eslintrc.js create mode 100644 packages/ui-service-inquirer/eslint.config.js delete mode 100644 packages/ui-service-sub-generator/.eslintignore delete mode 100644 packages/ui-service-sub-generator/.eslintrc.js create mode 100644 packages/ui-service-sub-generator/eslint.config.js delete mode 100644 packages/ui5-application-inquirer/.eslintignore delete mode 100644 packages/ui5-application-inquirer/.eslintrc.js create mode 100644 packages/ui5-application-inquirer/eslint.config.js delete mode 100644 packages/ui5-application-writer/.eslintignore delete mode 100644 packages/ui5-application-writer/.eslintrc.js create mode 100644 packages/ui5-application-writer/eslint.config.js delete mode 100644 packages/ui5-config/.eslintignore delete mode 100644 packages/ui5-config/.eslintrc.js create mode 100644 packages/ui5-config/eslint.config.js delete mode 100644 packages/ui5-info/.eslintignore delete mode 100644 packages/ui5-info/.eslintrc.js create mode 100644 packages/ui5-info/eslint.config.js delete mode 100644 packages/ui5-library-inquirer/.eslintignore delete mode 100644 packages/ui5-library-inquirer/.eslintrc.js create mode 100644 packages/ui5-library-inquirer/eslint.config.js delete mode 100644 packages/ui5-library-reference-inquirer/.eslintignore delete mode 100644 packages/ui5-library-reference-inquirer/.eslintrc.js create mode 100644 packages/ui5-library-reference-inquirer/eslint.config.js delete mode 100644 packages/ui5-library-reference-sub-generator/.eslintignore delete mode 100644 packages/ui5-library-reference-sub-generator/.eslintrc.js create mode 100644 packages/ui5-library-reference-sub-generator/eslint.config.js delete mode 100644 packages/ui5-library-reference-writer/.eslintignore delete mode 100644 packages/ui5-library-reference-writer/.eslintrc.js create mode 100644 packages/ui5-library-reference-writer/eslint.config.js delete mode 100644 packages/ui5-library-sub-generator/.eslintignore delete mode 100644 packages/ui5-library-sub-generator/.eslintrc.js create mode 100644 packages/ui5-library-sub-generator/eslint.config.js delete mode 100644 packages/ui5-library-writer/.eslintignore delete mode 100644 packages/ui5-library-writer/.eslintrc.js create mode 100644 packages/ui5-library-writer/eslint.config.js delete mode 100644 packages/ui5-proxy-middleware/.eslintignore delete mode 100644 packages/ui5-proxy-middleware/.eslintrc.js create mode 100644 packages/ui5-proxy-middleware/eslint.config.js delete mode 100644 packages/ui5-test-writer/.eslintignore delete mode 100644 packages/ui5-test-writer/.eslintrc.js create mode 100644 packages/ui5-test-writer/eslint.config.js delete mode 100644 packages/xml-odata-annotation-converter/.eslintignore delete mode 100644 packages/xml-odata-annotation-converter/.eslintrc create mode 100644 packages/xml-odata-annotation-converter/eslint.config.js delete mode 100644 packages/yaml/.eslintignore delete mode 100644 packages/yaml/.eslintrc.js create mode 100644 packages/yaml/eslint.config.js delete mode 100644 tests/integration/adaptation-editor/.eslintignore delete mode 100644 tests/integration/adaptation-editor/.eslintrc.js create mode 100644 tests/integration/adaptation-editor/eslint.config.js delete mode 100644 types/.eslintrc delete mode 100644 types/.eslintrc.js create mode 100644 types/eslint.config.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index d3c19bafc04..00000000000 --- a/.eslintrc +++ /dev/null @@ -1,312 +0,0 @@ -{ - "root": true, - "env": { - "node": true, - "es6": true - }, - "plugins": ["promise", "prettier", "jsdoc", "@typescript-eslint", "import", "sonarjs"], - "extends": ["plugin:jsdoc/recommended", "plugin:prettier/recommended"], - "overrides": [ - { - "parser": "@typescript-eslint/parser", - "files": ["**/*.ts", "**/*.tsx"], - "extends": ["plugin:@typescript-eslint/recommended"], - "rules": { - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/explicit-function-return-type": "warn", - "@typescript-eslint/no-unsafe-assignment": "warn", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-inferrable-types": "off", - "@typescript-eslint/no-unused-vars": [ - "error", - { - "varsIgnorePattern": "^_", - "argsIgnorePattern": "^_" - } - ], - "@typescript-eslint/no-floating-promises": ["error"], - "@typescript-eslint/consistent-type-imports": [ - "error", - { - "prefer": "type-imports", - "disallowTypeAnnotations": true - } - ], - "@typescript-eslint/no-misused-promises": ["error", { "checksVoidReturn": false }], - "@typescript-eslint/no-use-before-define": ["error", "nofunc"], - "@typescript-eslint/prefer-nullish-coalescing": "warn", - "@typescript-eslint/prefer-optional-chain": "warn", - "jsdoc/require-param-type": "off", - "jsdoc/require-returns-type": "off", - "prefer-const": [ - "error", - { - "destructuring": "all" - } - ], - "jsdoc/tag-lines": [ - "error", - "never", - { - "startLines": 1 - } - ] - }, - "settings": { - "jsdoc": { - "mode": "typescript" - } - } - }, - { - "parser": "@typescript-eslint/parser", - "files": ["**/test/**/*.js", "**/test/**/*.ts", "**/test/**/*.tsx"], - "rules": { - "@typescript-eslint/explicit-function-return-type": "off", - "jsdoc/require-param": "off", - "jsdoc/require-param-description": "off", - "jsdoc/require-param-name": "off", - "jsdoc/require-param-type": "off", - "jsdoc/require-returns": "off", - "jsdoc/require-returns-check": "off", - "jsdoc/require-returns-description": "off", - "jsdoc/require-returns-type": "off", - "jsdoc/require-jsdoc": [ - "off", - { - "require": { - "ClassDeclaration": true, - "MethodDefinition": true - }, - "exemptEmptyFunctions": true - } - ], - "jsdoc/valid-types": "off", - "jsdoc/check-types": "off", - "jsdoc/check-tag-names": "off", - "jsdoc/match-description": "off", - "promise/param-names": "off", - "promise/catch-or-return": "off", - "@typescript-eslint/no-unused-vars": "off", - "@typescript-eslint/consistent-type-imports": [ - "error", - { - "prefer": "type-imports", - "disallowTypeAnnotations": true - } - ], - "@typescript-eslint/no-use-before-define": ["error", "nofunc"] - } - }, - { - "files": ["**/test/**/*.js", "**/test/**/*.ts", "**/test/**/*.tsx"], - "rules": { - "no-console": "off", - "jsdoc/require-jsdoc": "off", - "jsdoc/require-returns-description": "off", - "jsdoc/require-param-description": "off", - "max-nested-callbacks": ["warn", 5], - "sonarjs/cognitive-complexity": "off" - } - } - ], - "rules": { - "comma-dangle": ["error", "never"], - "jsdoc/require-param": "error", - "jsdoc/require-param-description": "warn", - "jsdoc/require-param-name": "error", - "jsdoc/require-param-type": "warn", - "jsdoc/require-returns": "error", - "jsdoc/require-returns-check": "error", - "jsdoc/require-returns-description": "warn", - "jsdoc/require-returns-type": "error", - "jsdoc/require-jsdoc": [ - "warn", - { - "require": { - "ClassDeclaration": true, - "MethodDefinition": true - }, - "exemptEmptyFunctions": true, - "contexts": ["TSMethodSignature"] - } - ], - "jsdoc/valid-types": "error", - "jsdoc/check-types": "error", - "jsdoc/check-param-names": "error", - "jsdoc/check-tag-names": [ - "error", - { - "definedTags": ["ui5-restricted", "experimental", "final"] - } - ], - "jsdoc/match-description": "error", - "promise/always-return": "off", - "promise/no-return-wrap": "off", - "promise/param-names": "error", - "promise/catch-or-return": "error", - "promise/no-native": "off", - "promise/no-nesting": "warn", - "promise/no-promise-in-callback": "warn", - "promise/no-callback-in-promise": "warn", - "promise/avoid-new": "off", - "promise/no-new-statics": "error", - "promise/no-return-in-finally": "warn", - "promise/valid-params": "warn", - "no-cond-assign": "error", - "no-console": "warn", - "no-constant-condition": "error", - "no-control-regex": "error", - "no-debugger": "error", - "no-dupe-args": "error", - "no-dupe-keys": "error", - "no-duplicate-case": "error", - "no-empty-character-class": "error", - "no-empty": "error", - "no-ex-assign": "error", - "no-extra-boolean-cast": "warn", - "no-extra-parens": ["error", "functions"], - "no-extra-semi": "error", - "no-func-assign": "error", - "no-inner-declarations": ["error", "functions"], - "no-invalid-regexp": "error", - "no-irregular-whitespace": "error", - "no-negated-in-lhs": "error", - "no-obj-calls": "error", - "no-regex-spaces": "error", - "no-sparse-arrays": "error", - "no-unreachable": "error", - "use-isnan": "error", - "valid-typeof": "error", - "accessor-pairs": "error", - "block-scoped-var": "warn", - "consistent-return": "warn", - "curly": ["error", "all"], - "default-case": "warn", - "no-alert": "error", - "no-caller": "error", - "no-div-regex": "error", - "no-eval": "error", - "no-extend-native": "error", - "no-extra-bind": "error", - "no-fallthrough": "error", - "no-floating-decimal": "error", - "no-implied-eval": "error", - "no-iterator": "error", - "no-labels": "error", - "no-lone-blocks": "error", - "no-loop-func": "error", - "no-native-reassign": "error", - "no-new-func": "error", - "no-new-wrappers": "warn", - "no-new": "warn", - "no-octal-escape": "error", - "no-octal": "error", - "no-proto": "error", - "no-redeclare": "warn", - "no-return-assign": "error", - "no-script-url": "error", - "no-self-compare": "error", - "no-sequences": "error", - "no-unused-expressions": "warn", - "no-void": "error", - "no-warning-comments": "warn", - "no-with": "error", - "radix": "error", - "wrap-iife": ["error", "any"], - "yoda": "error", - "strict": ["error", "function"], - "no-catch-shadow": "error", - "no-delete-var": "error", - "no-label-var": "error", - "no-shadow-restricted-names": "error", - "no-undef-init": "error", - "no-undef": "error", - "no-unused-vars": [ - "error", - { - "vars": "all", - "args": "none" - } - ], - "no-use-before-define": "off", - "camelcase": "warn", - "consistent-this": ["warn", "that"], - "max-nested-callbacks": ["warn", 3], - "new-cap": "warn", - "new-parens": "error", - "no-array-constructor": "error", - "no-lonely-if": "warn", - "no-mixed-spaces-and-tabs": ["error", "smart-tabs"], - "no-nested-ternary": "error", - "no-new-object": "error", - "no-spaced-func": "error", - "quote-props": [ - "error", - "as-needed", - { - "keywords": false, - "unnecessary": false - } - ], - "semi-spacing": [ - "warn", - { - "before": false, - "after": true - } - ], - "semi": "error", - "keyword-spacing": [ - "error", - { - "after": true - } - ], - "sonarjs/cognitive-complexity": "warn", - "sonarjs/no-nested-template-literals": "warn", - "space-infix-ops": "error", - "space-unary-ops": [ - "error", - { - "words": true, - "nonwords": false - } - ], - // "sap-no-jquery": 2 - // turn on errors for missing imports - "import/no-unresolved": "error", - "import/no-extraneous-dependencies": [ - "error", - { - "devDependencies": true, - "optionalDependencies": true, - "peerDependencies": true, - "bundledDependencies": false - } - ], - "prettier/prettier": [ - "error", - { - "endOfLine": "auto", - "quoteProps": "preserve" - } - ] - }, - "settings": { - "jsdoc": { - "tagNamePreference": { - "augments": { - "message": "@extends is to be used over @augments as it is more evocative of classes than @augments", - "replacement": "extends" - } - } - }, - "import/resolver": { - "typescript": { - "alwaysTryTypes": true, // always try to resolve types under `@types` directory even it doesn't contain any source code, like `@types/unist` - "project": ["./packages/*/tsconfig.json", "./tsconfig.json"] - } - } - } -} diff --git a/eslint.config.js b/eslint.config.js new file mode 100644 index 00000000000..5110533f06b --- /dev/null +++ b/eslint.config.js @@ -0,0 +1,403 @@ +const { FlatCompat } = require('@eslint/eslintrc'); +const tsParser = require('@typescript-eslint/parser'); +const eslintPluginPrettierRecommended = require('eslint-plugin-prettier/recommended'); +const pluginPromise = require('eslint-plugin-promise'); +const pluginJsdoc = require('eslint-plugin-jsdoc'); +const tseslint = require('typescript-eslint'); +const importPlugin = require('eslint-plugin-import'); +const sonarjs = require('eslint-plugin-sonarjs'); + +const compat = new FlatCompat({ + baseDirectory: __dirname, // optional; default: process.cwd() + resolvePluginsRelativeTo: __dirname // optional +}); + +module.exports = [ + { + ignores: [ + '**/eslint.config.cjs', + // '**/*.d.ts', + 'dist', + 'coverage', + 'test/unit/coverage', + 'node_modules', + 'jest.config.js', + 'jest*.js', + 'eslint.config.js', + 'scripts', + 'test/data', + 'test/test-data', + 'test/test-input', + 'test/manual', + 'test/fixtures', + 'test/__fixtures__', + 'test/**/fixtures', + '**/fixtures-copy/', + 'test/unit/expected-output', + 'test/unit/sample', + 'test/sample', + 'test/__mocks__', + 'templates', + 'test/test-output', + 'test/int/test-output', + 'esbuild.js', + ' esbuild*.js', + '__mocks__', + 'test/tools-suite-telemetry/fixtures', + 'lint-staged.config.js', + 'generators/', + 'lib', + 'eslintrc-typescript.js', + 'eslintrc-test.js', + 'eslintrc-prod.js', + 'eslintrc-common.js', + '.storybook', + '**/snapshotResolver.js', + '**/expected-output/**', + ] + }, + eslintPluginPrettierRecommended, + pluginPromise.configs['flat/recommended'], + pluginJsdoc.configs['flat/recommended'], + ...tseslint.configs.recommended, + importPlugin.flatConfigs.recommended, + { + files: ['**/*.ts', '**/*.tsx'], + rules: { + 'comma-dangle': ['error', 'never'], + 'jsdoc/require-param': 'warn', // TODO revert to error + 'jsdoc/require-param-description': 'warn', + 'jsdoc/require-param-name': 'error', + 'jsdoc/require-param-type': 'warn', + 'jsdoc/require-returns': 'warn', // TODO revert to error + 'jsdoc/require-returns-check': 'error', + 'jsdoc/require-returns-description': 'warn', + 'jsdoc/require-returns-type': 'error', + + 'jsdoc/require-jsdoc': [ + 'warn', + { + require: { + ClassDeclaration: true, + MethodDefinition: true + }, + + exemptEmptyFunctions: true, + contexts: ['TSMethodSignature'] + } + ], + + 'jsdoc/valid-types': 'error', + 'jsdoc/check-types': 'error', + 'jsdoc/check-param-names': 'error', + + 'jsdoc/check-tag-names': [ + 'warn', // TODO revert to error + { + definedTags: ['ui5-restricted', 'experimental', 'final'] + } + ], + + 'jsdoc/match-description': 'warn', // TODO revert to error + 'promise/always-return': 'off', + 'promise/no-return-wrap': 'off', + 'promise/param-names': 'error', + 'promise/catch-or-return': 'error', + 'promise/no-native': 'off', + 'promise/no-nesting': 'warn', + 'promise/no-promise-in-callback': 'warn', + 'promise/no-callback-in-promise': 'warn', + 'promise/avoid-new': 'off', + 'promise/no-new-statics': 'error', + 'promise/no-return-in-finally': 'warn', + 'promise/valid-params': 'warn', + 'no-cond-assign': 'error', + 'no-console': 'warn', + 'no-constant-condition': 'error', + 'no-control-regex': 'error', + 'no-debugger': 'error', + 'no-dupe-args': 'error', + 'no-dupe-keys': 'error', + 'no-duplicate-case': 'error', + 'no-empty-character-class': 'error', + 'no-empty': 'error', + 'no-ex-assign': 'error', + 'no-extra-boolean-cast': 'warn', + 'no-extra-parens': ['error', 'functions'], + 'no-extra-semi': 'error', + 'no-func-assign': 'error', + 'no-inner-declarations': ['error', 'functions'], + 'no-invalid-regexp': 'error', + 'no-irregular-whitespace': 'error', + 'no-negated-in-lhs': 'error', + 'no-obj-calls': 'error', + 'no-regex-spaces': 'error', + 'no-sparse-arrays': 'error', + 'no-unreachable': 'error', + 'use-isnan': 'error', + 'valid-typeof': 'error', + 'accessor-pairs': 'error', + 'block-scoped-var': 'warn', + 'consistent-return': 'warn', + curly: ['error', 'all'], + 'default-case': 'warn', + 'no-alert': 'error', + 'no-caller': 'error', + 'no-div-regex': 'error', + 'no-eval': 'error', + 'no-extend-native': 'error', + 'no-extra-bind': 'error', + 'no-fallthrough': 'error', + 'no-floating-decimal': 'error', + 'no-implied-eval': 'error', + 'no-iterator': 'error', + 'no-labels': 'error', + 'no-lone-blocks': 'error', + 'no-loop-func': 'error', + 'no-native-reassign': 'error', + 'no-new-func': 'error', + 'no-new-wrappers': 'warn', + 'no-new': 'warn', + 'no-octal-escape': 'error', + 'no-octal': 'error', + 'no-proto': 'error', + 'no-redeclare': 'warn', + 'no-return-assign': 'error', + 'no-script-url': 'error', + 'no-self-compare': 'error', + 'no-sequences': 'error', + 'no-unused-expressions': 'warn', + 'no-void': 'error', + 'no-warning-comments': 'warn', + 'no-with': 'error', + radix: 'error', + 'wrap-iife': ['error', 'any'], + yoda: 'error', + strict: ['error', 'function'], + 'no-catch-shadow': 'error', + 'no-delete-var': 'error', + 'no-label-var': 'error', + 'no-shadow-restricted-names': 'error', + 'no-undef-init': 'error', + // 'no-undef': 'error', It is safe to disable this rule when using TypeScript because TypeScript's compiler enforces this check. + // 'no-unused-vars': ['error', { // disable and use @typescript-eslint/no-unused-vars instead + // vars: 'all', + // args: 'none', + // }], + + 'no-use-before-define': 'off', + camelcase: 'warn', + 'consistent-this': ['warn', 'that'], + 'max-nested-callbacks': ['warn', 3], + 'new-cap': 'warn', + 'new-parens': 'error', + 'no-array-constructor': 'error', + 'no-lonely-if': 'warn', + 'no-mixed-spaces-and-tabs': ['error', 'smart-tabs'], + 'no-nested-ternary': 'error', + 'no-new-object': 'error', + 'quote-props': [ + 'error', + 'as-needed', + { + keywords: false, + unnecessary: false + } + ], + + 'semi-spacing': [ + 'warn', + { + before: false, + after: true + } + ], + + semi: 'error', + + 'keyword-spacing': [ + 'error', + { + after: true + } + ], + + 'sonarjs/cognitive-complexity': 'warn', + 'sonarjs/no-nested-template-literals': 'warn', + 'space-infix-ops': 'error', + + 'space-unary-ops': [ + 'error', + { + words: true, + nonwords: false + } + ], + + 'import/no-unresolved': 'error', + + 'import/no-extraneous-dependencies': [ + 'error', + { + devDependencies: true, + optionalDependencies: true, + peerDependencies: true, + bundledDependencies: false + } + ], + + 'prettier/prettier': [ + 'error', + { + endOfLine: 'auto', + quoteProps: 'preserve' + } + ] + } + }, + { + name: 'typescript-eslint-1', + languageOptions: { + parser: tsParser + }, + files: ['**/*.ts', '**/*.tsx'], + // 'extends': ['plugin:@typescript-eslint/recommended'], + rules: { + '@typescript-eslint/ban-types': 'off', + '@typescript-eslint/explicit-function-return-type': 'warn', + '@typescript-eslint/no-wrapper-object-types': 'warn', + '@typescript-eslint/no-unsafe-assignment': 'warn', + '@typescript-eslint/no-explicit-any': 'off', + '@typescript-eslint/no-inferrable-types': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { + 'varsIgnorePattern': '^_', + 'argsIgnorePattern': '^_', + 'caughtErrors': 'none' + } + ], + '@typescript-eslint/no-floating-promises': ['error'], + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + 'prefer': 'type-imports', + 'disallowTypeAnnotations': true + } + ], + '@typescript-eslint/no-misused-promises': ['error', { 'checksVoidReturn': false }], + '@typescript-eslint/no-use-before-define': ['error', 'nofunc'], + '@typescript-eslint/prefer-nullish-coalescing': 'warn', + '@typescript-eslint/prefer-optional-chain': 'warn', + '@typescript-eslint/no-unsafe-function-type': 'warn', + '@typescript-eslint/no-empty-object-type': 'warn', + '@typescript-eslint/no-require-imports': [ + 'error', + { + 'allowAsImport': true + } + ], + 'jsdoc/require-param-type': 'off', + 'jsdoc/require-returns-type': 'off', + 'prefer-const': [ + 'error', + { + 'destructuring': 'all' + } + ], + 'jsdoc/tag-lines': [ + 'error', + 'never', + { + 'startLines': 1 + } + ] + }, + 'settings': { + 'jsdoc': { + 'mode': 'typescript' + } + } + }, + { + name: 'typescript-eslint-2', + languageOptions: { + parser: tsParser + }, + files: ['**/test/**/*.js', '**/test/**/*.ts', '**/test/**/*.tsx'], + rules: { + '@typescript-eslint/explicit-function-return-type': 'off', + '@typescript-eslint/no-floating-promises': 'off', + 'jsdoc/require-param': 'off', + 'jsdoc/require-param-description': 'off', + 'jsdoc/require-param-name': 'off', + 'jsdoc/require-param-type': 'off', + 'jsdoc/require-returns': 'off', + 'jsdoc/require-returns-check': 'off', + 'jsdoc/require-returns-description': 'off', + 'jsdoc/require-returns-type': 'off', + 'jsdoc/require-jsdoc': [ + 'off', + { + 'require': { + 'ClassDeclaration': true, + 'MethodDefinition': true + }, + 'exemptEmptyFunctions': true + } + ], + 'jsdoc/valid-types': 'off', + 'jsdoc/check-types': 'off', + 'jsdoc/check-tag-names': 'off', + 'jsdoc/match-description': 'off', + 'promise/param-names': 'off', + 'promise/catch-or-return': 'off', + '@typescript-eslint/no-unused-vars': 'off', + '@typescript-eslint/consistent-type-imports': [ + 'error', + { + 'prefer': 'type-imports', + 'disallowTypeAnnotations': true + } + ], + '@typescript-eslint/no-use-before-define': ['error', 'nofunc'] + } + }, + { + files: ['**/test/**/*.js', '**/test/**/*.ts', '**/test/**/*.tsx'], + rules: { + 'no-console': 'off', + 'jsdoc/require-jsdoc': 'off', + 'jsdoc/require-returns-description': 'off', + 'jsdoc/require-param-description': 'off', + 'max-nested-callbacks': ['warn', 5], + 'sonarjs/cognitive-complexity': 'off' + } + }, + { + plugins: { sonarjs }, + rules: { + 'sonarjs/no-implicit-dependencies': 'error' + } + }, + { + settings: { + jsdoc: { + tagNamePreference: { + augments: { + message: + '@extends is to be used over @augments as it is more evocative of classes than @augments', + replacement: 'extends' + } + } + }, + + 'import/resolver': { + typescript: { + alwaysTryTypes: true, + project: ['./packages/*/tsconfig.json', './tsconfig.json'] + } + } + } + } +]; diff --git a/examples/fe-fpm-cli/.eslintignore b/examples/fe-fpm-cli/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/examples/fe-fpm-cli/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/examples/fe-fpm-cli/.eslintrc b/examples/fe-fpm-cli/.eslintrc deleted file mode 100644 index 28edeb74108..00000000000 --- a/examples/fe-fpm-cli/.eslintrc +++ /dev/null @@ -1,6 +0,0 @@ -{ - "extends": [ - "../../.eslintrc" - ], - "parserOptions": { "project": "./tsconfig.eslint.json" } -} \ No newline at end of file diff --git a/examples/fe-fpm-cli/eslint.config.js b/examples/fe-fpm-cli/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/examples/fe-fpm-cli/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/examples/fe-fpm-cli/package.json b/examples/fe-fpm-cli/package.json index ae993f1d76a..90219edf6ed 100644 --- a/examples/fe-fpm-cli/package.json +++ b/examples/fe-fpm-cli/package.json @@ -25,8 +25,7 @@ "@types/mem-fs": "1.1.2", "@types/mem-fs-editor": "7.0.1", "@types/vinyl": "2.0.7", - "@typescript-eslint/eslint-plugin": "^5.59.0", - "@typescript-eslint/parser": "^5.59.0" + "typescript-eslint": "^8.46.2" }, "files": [ "dist", diff --git a/examples/odata-cli/.eslintignore b/examples/odata-cli/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/examples/odata-cli/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/examples/odata-cli/.eslintrc b/examples/odata-cli/.eslintrc deleted file mode 100644 index d457ba9bc3a..00000000000 --- a/examples/odata-cli/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "parserOptions": { "project": "./tsconfig.eslint.json" }, - "rules": { - "no-console": "off" - } -} diff --git a/examples/odata-cli/eslint.config.js b/examples/odata-cli/eslint.config.js new file mode 100644 index 00000000000..7e6acdc3728 --- /dev/null +++ b/examples/odata-cli/eslint.config.js @@ -0,0 +1,18 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + } + } + }, + { + rules: { + 'no-console': 'off' + } + } +]; diff --git a/examples/simple-generator/.eslintignore b/examples/simple-generator/.eslintignore deleted file mode 100644 index 881c20afa40..00000000000 --- a/examples/simple-generator/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -generators -dist \ No newline at end of file diff --git a/examples/simple-generator/.eslintrc b/examples/simple-generator/.eslintrc deleted file mode 100644 index ee4e7e38dad..00000000000 --- a/examples/simple-generator/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "parserOptions": { "project": "./tsconfig.eslint.json" }, - "rules": { - "quote-props": 0 - } -} diff --git a/examples/simple-generator/eslint.config.js b/examples/simple-generator/eslint.config.js new file mode 100644 index 00000000000..4c76cb0cb49 --- /dev/null +++ b/examples/simple-generator/eslint.config.js @@ -0,0 +1,18 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + } + } + }, + { + 'rules': { + 'quote-props': 0 + } + } +]; diff --git a/examples/ui-prompting-examples/.eslintignore b/examples/ui-prompting-examples/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/examples/ui-prompting-examples/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/examples/ui-prompting-examples/.eslintrc.js b/examples/ui-prompting-examples/.eslintrc.js deleted file mode 100644 index 3a82a63cdb8..00000000000 --- a/examples/ui-prompting-examples/.eslintrc.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc', 'plugin:react/recommended', 'plugin:storybook/recommended'], - parserOptions: { - 'EXPERIMENTAL_useSourceOfProjectReferenceRedirect': true, - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - overrides: [ - { - 'parser': '@typescript-eslint/parser', - 'files': ['./test/**/*.tsx'], - 'rules': { - 'no-loop-func': 'off' - } - }, - { - 'parser': '@typescript-eslint/parser', - 'files': ['./src/**/*.tsx'], - 'rules': { - '@typescript-eslint/no-unused-vars': [ - 'error', - { 'varsIgnorePattern': '^_', 'argsIgnorePattern': '^_', 'ignoreRestSiblings': true } - ] - } - } - ], - rules: { - 'react/no-unknown-property': ['error', { 'ignore': ['onFocusCapture'] }], - 'jsdoc/require-param-description': 'off', - 'jsdoc/require-returns-description': 'off', - 'jsdoc/no-undefined-types': 'off' - }, - settings: { - 'react': { - 'version': 'detect' - } - } -}; diff --git a/examples/ui-prompting-examples/eslint.config.js b/examples/ui-prompting-examples/eslint.config.js new file mode 100644 index 00000000000..09cf289a724 --- /dev/null +++ b/examples/ui-prompting-examples/eslint.config.js @@ -0,0 +1,59 @@ +const base = require('../../eslint.config.js'); +const reactPlugin = require('eslint-plugin-react'); +const globals = require('globals'); +const storybookPlugin = require('eslint-plugin-storybook'); +const tsParser = require('@typescript-eslint/parser'); +const { parser } = require('typescript-eslint'); + +module.exports = [ + ...base, + reactPlugin.configs.flat.recommended, + ...storybookPlugin.configs['flat/recommended'], + { + plugins: { + reactPlugin + }, + languageOptions: { + parserOptions: { + parser: tsParser, + project: 'tsconfig.eslint.json', + tsconfigRootDir: __dirname + }, + globals: { + ...globals.browser + } + }, + rules: { + 'react/no-unknown-property': ['error', { 'ignore': ['onFocusCapture'] }], + 'jsdoc/require-param-description': 'off', + 'jsdoc/require-returns-description': 'off', + 'jsdoc/no-undefined-types': 'off' + }, + settings: { + 'react': { + 'version': 'detect' + } + } + }, + { + languageOptions: { + 'parser': tsParser + }, + files: ['./test/**/*.tsx'], + rules: { + 'no-loop-func': 'off' + } + }, + { + languageOptions: { + parser: tsParser + }, + files: ['./src/**/*.tsx'], + rules: { + '@typescript-eslint/no-unused-vars': [ + 'error', + { 'varsIgnorePattern': '^_', 'argsIgnorePattern': '^_', 'ignoreRestSiblings': true } + ] + } + } +]; diff --git a/examples/ui-prompting-examples/package.json b/examples/ui-prompting-examples/package.json index 3f75b20c516..1c6630888ec 100644 --- a/examples/ui-prompting-examples/package.json +++ b/examples/ui-prompting-examples/package.json @@ -53,8 +53,8 @@ "babel-loader": "9.1.3", "copyfiles": "2.4.1", "css-loader": "6.8.1", - "eslint-plugin-react": "7.33.2", - "eslint-plugin-storybook": "0.6.15", + "eslint-plugin-react": "7.37.4", + "eslint-plugin-storybook": "0.12.0", "mem-fs": "2.1.0", "mem-fs-editor": "9.4.0", "npm-run-all2": "6.2.0", diff --git a/examples/ui-prompting-examples/src/addons/preview/component.tsx b/examples/ui-prompting-examples/src/addons/preview/component.tsx index 7cab33b15b9..545d10aee33 100644 --- a/examples/ui-prompting-examples/src/addons/preview/component.tsx +++ b/examples/ui-prompting-examples/src/addons/preview/component.tsx @@ -24,7 +24,7 @@ export const CodePreview = (props: { active?: boolean }): React.ReactElement => let answersPreview: string; try { answersPreview = JSON.stringify(responseAction.answers, undefined, 4); - } catch (e) { + } catch { answersPreview = '{}'; } setPreview({ diff --git a/examples/ui-prompting-examples/src/backend/connection.ts b/examples/ui-prompting-examples/src/backend/connection.ts index 82dab3fa081..ccb9412cf18 100644 --- a/examples/ui-prompting-examples/src/backend/connection.ts +++ b/examples/ui-prompting-examples/src/backend/connection.ts @@ -41,8 +41,7 @@ import type { ResponseI18n } from '../utils/types'; import type { AddonActions } from '../addons/types'; -import { handleAction as handleAddonAction } from '../addons/project'; -import { testAppPath, getApplication } from '../addons/project'; +import { handleAction as handleAddonAction, testAppPath, getApplication } from '../addons/project'; import { GET_PROJECT_PATH, SET_PROJECT_PATH, VALIDATE_ANSWERS } from '../addons/project/types'; import type { ApplicationInformation, SetProjectPath } from '../addons/project/types'; import type { DynamicChoices } from '@sap-ux/ui-prompting'; diff --git a/examples/ui-prompting-examples/src/utils/hooks.ts b/examples/ui-prompting-examples/src/utils/hooks.ts index 4ee781e452a..1d930d2ce0a 100644 --- a/examples/ui-prompting-examples/src/utils/hooks.ts +++ b/examples/ui-prompting-examples/src/utils/hooks.ts @@ -6,9 +6,8 @@ import { subscribeOnChoicesUpdate, unsubscribeOnChoicesUpdate } from './communication'; -import type { DynamicChoices, PromptQuestion, TranslationProperties } from '@sap-ux/ui-prompting'; +import type { DynamicChoices, PromptQuestion, TranslationProperties, PromptsGroup } from '@sap-ux/ui-prompting'; import type { PromptsType } from './types'; -import type { PromptsGroup } from '@sap-ux/ui-prompting'; import type { Answers } from 'inquirer'; import type { I18nBundle, TranslationEntry } from '@sap-ux/ui-components'; diff --git a/examples/ui-prompting-examples/src/utils/types.ts b/examples/ui-prompting-examples/src/utils/types.ts index 2089578df82..71d4a82fcdc 100644 --- a/examples/ui-prompting-examples/src/utils/types.ts +++ b/examples/ui-prompting-examples/src/utils/types.ts @@ -4,12 +4,14 @@ import { type TablePromptsAnswer, type PagePromptsAnswer, type Prompts, - type RichTextEditorPromptsAnswer + type RichTextEditorPromptsAnswer, + type SupportedGeneratorAnswers, + type Answers, + type CodeSnippet, + PromptsType } from '@sap-ux/fe-fpm-writer'; -import { PromptsType } from '@sap-ux/fe-fpm-writer/dist/prompts/types'; import type { AddonActions } from '../addons/types'; import type { DynamicChoices, TranslationProperties } from '@sap-ux/ui-prompting'; -import type { Answers, CodeSnippet, SupportedGeneratorAnswers } from '@sap-ux/fe-fpm-writer'; import type { I18nBundle } from '@sap-ux/i18n'; export type Actions = diff --git a/package.json b/package.json index ac58516f3db..065ea60f29c 100644 --- a/package.json +++ b/package.json @@ -5,24 +5,26 @@ "author": "@SAP/ux-tools-team", "private": true, "devDependencies": { - "@changesets/cli": "2.29.7", + "@changesets/cli": "2.27.10", + "@eslint/eslintrc": "3.3.0", + "@eslint/js": "9.22.0", "@playwright/test": "1.56.1", "@types/jest": "30.0.0", "@types/node": "18.19.130", - "@typescript-eslint/eslint-plugin": "^7.18.0", - "@typescript-eslint/parser": "^7.18.0", "autoprefixer": "10.4.21", "check-dependency-version-consistency": "5.0.1", "esbuild": "0.25.11", "esbuild-sass-plugin": "3.3.1", - "eslint": "8.57.1", - "eslint-config-prettier": "8.10.2", - "eslint-import-resolver-typescript": "3.10.1", - "eslint-plugin-import": "2.32.0", - "eslint-plugin-jsdoc": "46.10.1", - "eslint-plugin-prettier": "4.2.5", - "eslint-plugin-promise": "6.6.0", - "eslint-plugin-sonarjs": "0.25.1", + "eslint": "9.36.0", + "eslint-config-prettier": "10.1.1", + "eslint-import-resolver-typescript": "4.2.2", + "eslint-plugin-import": "2.31.0", + "eslint-plugin-jsdoc": "50.6.8", + "eslint-plugin-prettier": "5.2.3", + "eslint-plugin-promise": "7.2.1", + "eslint-plugin-sonarjs": "3.0.2", + "typescript-eslint": "8.46.2", + "globals": "16.0.0", "husky": "8.0.3", "jest": "30.2.0", "jest-sonar": "0.2.16", @@ -30,7 +32,7 @@ "nx": "21.6.5", "postcss": "8.5.6", "prebuild-install": "^7.1.3", - "prettier": "2.8.8", + "prettier": "3.6.2", "pretty-quick": "3.3.1", "react-select": "5.10.2", "react-virtualized": "9.22.6", diff --git a/packages/abap-deploy-config-inquirer/.eslintignore b/packages/abap-deploy-config-inquirer/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/abap-deploy-config-inquirer/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/abap-deploy-config-inquirer/.eslintrc.js b/packages/abap-deploy-config-inquirer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/abap-deploy-config-inquirer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/abap-deploy-config-inquirer/eslint.config.js b/packages/abap-deploy-config-inquirer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/abap-deploy-config-inquirer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/abap-deploy-config-inquirer/src/prompts/defaults.ts b/packages/abap-deploy-config-inquirer/src/prompts/defaults.ts index 7a7e6e5bcd5..d93e357d918 100644 --- a/packages/abap-deploy-config-inquirer/src/prompts/defaults.ts +++ b/packages/abap-deploy-config-inquirer/src/prompts/defaults.ts @@ -30,7 +30,7 @@ export function defaultTargetSystem(targetSystems?: AbapSystemChoice[]): string * @returns default url */ export function defaultUrl(targetSystem?: string): string { - return targetSystem === TargetSystemType.Url ? '' : PromptState.abapDeployConfig.url ?? ''; + return targetSystem === TargetSystemType.Url ? '' : (PromptState.abapDeployConfig.url ?? ''); } /** diff --git a/packages/abap-deploy-config-inquirer/src/prompts/helpers.ts b/packages/abap-deploy-config-inquirer/src/prompts/helpers.ts index ecdfd06e0d8..73f5dda4a3a 100644 --- a/packages/abap-deploy-config-inquirer/src/prompts/helpers.ts +++ b/packages/abap-deploy-config-inquirer/src/prompts/helpers.ts @@ -77,7 +77,7 @@ async function getBackendTargetChoices( return { name: isDefault ? `${getBackendSystemDisplayName(system)} (Source system)` - : getBackendSystemDisplayName(system) ?? '', + : (getBackendSystemDisplayName(system) ?? ''), value: system.url, isDefault, scp: !!system.serviceKeys, // legacy service key store entries @@ -250,7 +250,7 @@ export async function getPackageChoices( packages = await queryPackages(input, systemConfig, backendTarget); morePackageResultsMsg = - packages && packages.length === ABAP_PACKAGE_SEARCH_MAX_RESULTS + packages?.length === ABAP_PACKAGE_SEARCH_MAX_RESULTS ? t('prompts.config.package.packageAutocomplete.sourceMessage', { numResults: packages.length }) : morePackageResultsMsg; diff --git a/packages/abap-deploy-config-inquirer/src/utils.ts b/packages/abap-deploy-config-inquirer/src/utils.ts index e9aa0bf3c45..a6e9bad56ad 100644 --- a/packages/abap-deploy-config-inquirer/src/utils.ts +++ b/packages/abap-deploy-config-inquirer/src/utils.ts @@ -165,8 +165,8 @@ export function getPackageAnswer(previousAnswers?: AbapDeployConfigAnswersIntern return ( statePackage ?? (previousAnswers?.packageInputChoice === PackageInputChoices.ListExistingChoice - ? previousAnswers?.packageAutocomplete ?? '' - : previousAnswers?.packageManual ?? '') + ? (previousAnswers?.packageAutocomplete ?? '') + : (previousAnswers?.packageManual ?? '')) ); } diff --git a/packages/abap-deploy-config-inquirer/test/prompts/defaults.test.ts b/packages/abap-deploy-config-inquirer/test/prompts/defaults.test.ts index 819a2197e48..87a64cdfc27 100644 --- a/packages/abap-deploy-config-inquirer/test/prompts/defaults.test.ts +++ b/packages/abap-deploy-config-inquirer/test/prompts/defaults.test.ts @@ -8,8 +8,7 @@ import { import { getAbapSystemChoices } from '../../src/prompts/helpers'; import { mockTargetSystems } from '../fixtures/targets'; import { PromptState } from '../../src/prompts/prompt-state'; -import type { TransportConfig } from '../../src/types'; -import { PackageInputChoices, TargetSystemType, TransportChoices } from '../../src/types'; +import { PackageInputChoices, TargetSystemType, TransportChoices, type TransportConfig } from '../../src/types'; describe('defaults', () => { beforeEach(() => { diff --git a/packages/abap-deploy-config-sub-generator/.eslintignore b/packages/abap-deploy-config-sub-generator/.eslintignore deleted file mode 100644 index bbeec06de7e..00000000000 --- a/packages/abap-deploy-config-sub-generator/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -generators \ No newline at end of file diff --git a/packages/abap-deploy-config-sub-generator/.eslintrc.js b/packages/abap-deploy-config-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/abap-deploy-config-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/abap-deploy-config-sub-generator/eslint.config.js b/packages/abap-deploy-config-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/abap-deploy-config-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/abap-deploy-config-sub-generator/test/app.test.ts b/packages/abap-deploy-config-sub-generator/test/app.test.ts index 97345c121a5..bf7e3af241f 100644 --- a/packages/abap-deploy-config-sub-generator/test/app.test.ts +++ b/packages/abap-deploy-config-sub-generator/test/app.test.ts @@ -37,9 +37,9 @@ mockGetService.mockResolvedValueOnce({ jest.mock('fs', () => { const fsLib = jest.requireActual('fs'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const Union = require('unionfs').Union; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const vol = require('memfs').vol; const _fs = new Union().use(fsLib); _fs.constants = fsLib.constants; @@ -49,7 +49,6 @@ jest.mock('fs', () => { }); jest.mock('@sap-ux/fiori-generator-shared', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/fiori-generator-shared') as {}), sendTelemetry: jest.fn(), isExtensionInstalled: jest.fn().mockReturnValue(true), @@ -63,6 +62,11 @@ jest.mock('@sap-ux/fiori-generator-shared', () => ({ const mockGetHostEnvironment = getHostEnvironment as jest.Mock; const mockSendTelemetry = sendTelemetry as jest.Mock; +jest.mock('@sap-ux/telemetry', () => ({ + ...(jest.requireActual('@sap-ux/telemetry') as {}), + initTelemetrySettings: jest.fn() +})); + const abapDeployGenPath = join(__dirname, '../../src/app'); describe('Test abap deploy configuration generator', () => { diff --git a/packages/abap-deploy-config-sub-generator/test/unit/app/questions.test.ts b/packages/abap-deploy-config-sub-generator/test/unit/app/questions.test.ts index bc3274dad95..427d16bb954 100644 --- a/packages/abap-deploy-config-sub-generator/test/unit/app/questions.test.ts +++ b/packages/abap-deploy-config-sub-generator/test/unit/app/questions.test.ts @@ -7,27 +7,23 @@ import { AuthenticationType } from '@sap-ux/store'; import { DefaultLogger, getHostEnvironment, hostEnvironment } from '@sap-ux/fiori-generator-shared'; jest.mock('@sap-ux/btp-utils', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/btp-utils') as {}), isAppStudio: jest.fn() })); const mockIsAppStudio = isAppStudio as jest.Mock; jest.mock('@sap-ux/project-access', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/project-access') as {}), readUi5Yaml: jest.fn() })); const mockReadUi5Yaml = readUi5Yaml as jest.Mock; jest.mock('@sap-ux/abap-deploy-config-inquirer', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/abap-deploy-config-inquirer') as {}), getPrompts: jest.fn() })); jest.mock('@sap-ux/fiori-generator-shared', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/fiori-generator-shared') as {}), getHostEnvironment: jest.fn() })); diff --git a/packages/abap-deploy-config-writer/.eslintignore b/packages/abap-deploy-config-writer/.eslintignore deleted file mode 100644 index 5d34d8f445f..00000000000 --- a/packages/abap-deploy-config-writer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -test/sample -dist \ No newline at end of file diff --git a/packages/abap-deploy-config-writer/.eslintrc.js b/packages/abap-deploy-config-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/abap-deploy-config-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/abap-deploy-config-writer/eslint.config.js b/packages/abap-deploy-config-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/abap-deploy-config-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/abap-deploy-config-writer/src/scripts.ts b/packages/abap-deploy-config-writer/src/scripts.ts index 7dbfc99589a..d8c90fdfcf9 100644 --- a/packages/abap-deploy-config-writer/src/scripts.ts +++ b/packages/abap-deploy-config-writer/src/scripts.ts @@ -19,7 +19,7 @@ export async function updateScripts( fs: Editor, options?: DeployConfigOptions ): Promise { - const buildPrefix = options?.addBuildToUndeployScript ?? true ? `${BUILD_SCRIPT} && ` : ''; + const buildPrefix = (options?.addBuildToUndeployScript ?? true) ? `${BUILD_SCRIPT} && ` : ''; // deploy script const deployScript = `${BUILD_SCRIPT} && ${DEPLOY_SCRIPT} --config ${deployConfigFile}`; diff --git a/packages/abap-deploy-config-writer/test/sample/test-ts-app/webapp/Component.ts b/packages/abap-deploy-config-writer/test/sample/test-ts-app/webapp/Component.ts index 4b824a2ac12..3867df13306 100644 --- a/packages/abap-deploy-config-writer/test/sample/test-ts-app/webapp/Component.ts +++ b/packages/abap-deploy-config-writer/test/sample/test-ts-app/webapp/Component.ts @@ -1,28 +1,28 @@ -import BaseComponent from "sap/ui/core/UIComponent"; -import { createDeviceModel } from "./model/models"; +import BaseComponent from 'sap/ui/core/UIComponent'; +import { createDeviceModel } from './model/models'; /** * @namespace tsbasic */ export default class Component extends BaseComponent { - - public static metadata = { - manifest: "json" - }; + public static metadata = { + manifest: 'json' + }; /** * The component is initialized by UI5 automatically during the startup of the app and calls the init method once. + * * @public * @override */ - public init() : void { - // call the base component's init function - super.init(); + public init(): void { + // call the base component's init function + super.init(); // enable routing this.getRouter().initialize(); // set the device model - this.setModel(createDeviceModel(), "device"); - } -} \ No newline at end of file + this.setModel(createDeviceModel(), 'device'); + } +} diff --git a/packages/abap-deploy-config-writer/test/sample/test-ts-app/webapp/controller/App.controller.ts b/packages/abap-deploy-config-writer/test/sample/test-ts-app/webapp/controller/App.controller.ts index e01eb4f61dd..1d0588f65d7 100644 --- a/packages/abap-deploy-config-writer/test/sample/test-ts-app/webapp/controller/App.controller.ts +++ b/packages/abap-deploy-config-writer/test/sample/test-ts-app/webapp/controller/App.controller.ts @@ -4,6 +4,5 @@ import Controller from 'sap/ui/core/mvc/Controller'; * @namespace tsbasic.controller */ export default class App extends Controller { - /*eslint-disable @typescript-eslint/no-empty-function*/ public onInit(): void {} } diff --git a/packages/adp-flp-config-sub-generator/.eslintignore b/packages/adp-flp-config-sub-generator/.eslintignore deleted file mode 100644 index 09379ed8fa5..00000000000 --- a/packages/adp-flp-config-sub-generator/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -/test/unit/expected-output/ -generators diff --git a/packages/adp-flp-config-sub-generator/.eslintrc.js b/packages/adp-flp-config-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/adp-flp-config-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/adp-flp-config-sub-generator/eslint.config.js b/packages/adp-flp-config-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/adp-flp-config-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/adp-flp-config-sub-generator/test/app.test.ts b/packages/adp-flp-config-sub-generator/test/app.test.ts index b62fb5e539e..13dd5e13474 100644 --- a/packages/adp-flp-config-sub-generator/test/app.test.ts +++ b/packages/adp-flp-config-sub-generator/test/app.test.ts @@ -55,11 +55,10 @@ jest.mock('@sap-ux/inquirer-common', () => ({ () => ({ getValidationErrorHelp: () => 'Network Error' - } as unknown as inquirerCommon.ErrorHandler) + }) as unknown as inquirerCommon.ErrorHandler ) })); jest.mock('@sap-ux/fiori-generator-shared', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/fiori-generator-shared') as {}), sendTelemetry: jest.fn().mockReturnValue(new Promise(() => {})), TelemetryHelper: { diff --git a/packages/adp-tooling/.eslintignore b/packages/adp-tooling/.eslintignore deleted file mode 100644 index a05600c0fd6..00000000000 --- a/packages/adp-tooling/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/fixtures -templates -dist \ No newline at end of file diff --git a/packages/adp-tooling/.eslintrc.js b/packages/adp-tooling/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/adp-tooling/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/adp-tooling/eslint.config.js b/packages/adp-tooling/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/adp-tooling/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/adp-tooling/src/base/abap/manifest-service.ts b/packages/adp-tooling/src/base/abap/manifest-service.ts index 1cbe5d3d10d..0b7741dbdfa 100644 --- a/packages/adp-tooling/src/base/abap/manifest-service.ts +++ b/packages/adp-tooling/src/base/abap/manifest-service.ts @@ -45,7 +45,10 @@ export class ManifestService { * @param provider - The ABAP service provider. * @param logger - The logger instance. */ - private constructor(private readonly provider: AbapServiceProvider, private readonly logger: ToolsLogger) {} + private constructor( + private readonly provider: AbapServiceProvider, + private readonly logger: ToolsLogger + ) {} /** * Creates an instance of the ManifestService and fetches the base manifest of the application. diff --git a/packages/adp-tooling/src/base/helper.ts b/packages/adp-tooling/src/base/helper.ts index 56ed4e99249..cf42ca689f6 100644 --- a/packages/adp-tooling/src/base/helper.ts +++ b/packages/adp-tooling/src/base/helper.ts @@ -146,18 +146,21 @@ export function filterAndMapInboundsToManifest(inbounds: Inbound[]): ManifestNam if (!inbounds || inbounds.length === 0) { return undefined; } - const filteredInbounds = inbounds.reduce((acc: { [key: string]: InboundContent }, inbound) => { - // Skip if hideLauncher is true - if (!inbound?.content || inbound.content.hideLauncher === true) { + const filteredInbounds = inbounds.reduce( + (acc: { [key: string]: InboundContent }, inbound) => { + // Skip if hideLauncher is true + if (!inbound?.content || inbound.content.hideLauncher === true) { + return acc; + } + const { semanticObject, action } = inbound.content; + if (semanticObject && action) { + const key = `${semanticObject}-${action}`; + acc[key] = inbound.content; + } return acc; - } - const { semanticObject, action } = inbound.content; - if (semanticObject && action) { - const key = `${semanticObject}-${action}`; - acc[key] = inbound.content; - } - return acc; - }, {} as { [key: string]: InboundContent }); + }, + {} as { [key: string]: InboundContent } + ); return Object.keys(filteredInbounds).length === 0 ? undefined : filteredInbounds; } diff --git a/packages/adp-tooling/src/preview/adp-preview.ts b/packages/adp-tooling/src/preview/adp-preview.ts index 3aca81fc500..2258a5354ea 100644 --- a/packages/adp-tooling/src/preview/adp-preview.ts +++ b/packages/adp-tooling/src/preview/adp-preview.ts @@ -1,5 +1,7 @@ import ZipFile from 'adm-zip'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection } from '@ui5/fs'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { MiddlewareUtils } from '@ui5/server'; import type { NextFunction, Request, Response, Router, RequestHandler } from 'express'; @@ -31,7 +33,7 @@ import { import { addCustomSectionFragment } from './descriptor-change-handler'; declare global { // false positive, const can't be used here https://github.com/eslint/eslint/issues/15896 - // eslint-disable-next-line no-var + var __SAP_UX_MANIFEST_SYNC_REQUIRED__: boolean | undefined; } diff --git a/packages/adp-tooling/src/preview/routes-handler.ts b/packages/adp-tooling/src/preview/routes-handler.ts index 90840ed22c9..b77f6a3a1cb 100644 --- a/packages/adp-tooling/src/preview/routes-handler.ts +++ b/packages/adp-tooling/src/preview/routes-handler.ts @@ -5,7 +5,9 @@ import { renderFile } from 'ejs'; import sanitize from 'sanitize-filename'; import { isAppStudio } from '@sap-ux/btp-utils'; import type { ToolsLogger } from '@sap-ux/logger'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { MiddlewareUtils } from '@ui5/server'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection, Resource } from '@ui5/fs'; import type { NextFunction, Request, Response } from 'express'; diff --git a/packages/adp-tooling/src/types.ts b/packages/adp-tooling/src/types.ts index d8c94ba4096..73041c95e6d 100644 --- a/packages/adp-tooling/src/types.ts +++ b/packages/adp-tooling/src/types.ts @@ -493,16 +493,16 @@ export const ChangeTypeMap: Record = { export type GeneratorData = T extends ChangeType.ADD_ANNOTATIONS_TO_ODATA ? AnnotationsData : T extends ChangeType.ADD_COMPONENT_USAGES - ? ComponentUsagesData - : T extends ChangeType.ADD_LIBRARY_REFERENCE - ? ComponentUsagesData - : T extends ChangeType.ADD_NEW_MODEL - ? NewModelData - : T extends ChangeType.CHANGE_DATA_SOURCE - ? DataSourceData - : T extends ChangeType.CHANGE_INBOUND - ? InboundData - : never; + ? ComponentUsagesData + : T extends ChangeType.ADD_LIBRARY_REFERENCE + ? ComponentUsagesData + : T extends ChangeType.ADD_NEW_MODEL + ? NewModelData + : T extends ChangeType.CHANGE_DATA_SOURCE + ? DataSourceData + : T extends ChangeType.CHANGE_INBOUND + ? InboundData + : never; export interface AnnotationsData { variant: DescriptorVariant; diff --git a/packages/adp-tooling/src/writer/changes/writers/component-usages-writer.ts b/packages/adp-tooling/src/writer/changes/writers/component-usages-writer.ts index 768c2cb6a34..fad547152f4 100644 --- a/packages/adp-tooling/src/writer/changes/writers/component-usages-writer.ts +++ b/packages/adp-tooling/src/writer/changes/writers/component-usages-writer.ts @@ -12,7 +12,10 @@ export class ComponentUsagesWriter implements IWriter { * @param {Editor} fs - The filesystem editor instance. * @param {string} projectPath - The root path of the project. */ - constructor(private fs: Editor, private projectPath: string) {} + constructor( + private fs: Editor, + private projectPath: string + ) {} /** * Constructs the content for an component usages change based on provided data. diff --git a/packages/adp-tooling/src/writer/changes/writers/data-source-writer.ts b/packages/adp-tooling/src/writer/changes/writers/data-source-writer.ts index 7c206b8d4d5..2211c7237df 100644 --- a/packages/adp-tooling/src/writer/changes/writers/data-source-writer.ts +++ b/packages/adp-tooling/src/writer/changes/writers/data-source-writer.ts @@ -12,7 +12,10 @@ export class DataSourceWriter implements IWriter { * @param {Editor} fs - The filesystem editor instance. * @param {string} projectPath - The root path of the project. */ - constructor(private fs: Editor, private projectPath: string) {} + constructor( + private fs: Editor, + private projectPath: string + ) {} /** * Constructs content for a data source change. diff --git a/packages/adp-tooling/src/writer/changes/writers/inbound-writer.ts b/packages/adp-tooling/src/writer/changes/writers/inbound-writer.ts index 45d6ec4baac..4472b68577d 100644 --- a/packages/adp-tooling/src/writer/changes/writers/inbound-writer.ts +++ b/packages/adp-tooling/src/writer/changes/writers/inbound-writer.ts @@ -18,7 +18,10 @@ export class InboundWriter implements IWriter { * @param {Editor} fs - The filesystem editor instance. * @param {string} projectPath - The root path of the project. */ - constructor(private fs: Editor, private projectPath: string) {} + constructor( + private fs: Editor, + private projectPath: string + ) {} /** * Constructs the content for an inbound data change based on provided data. diff --git a/packages/adp-tooling/src/writer/changes/writers/new-model-writer.ts b/packages/adp-tooling/src/writer/changes/writers/new-model-writer.ts index 8eef725afc0..02d1e4c7de0 100644 --- a/packages/adp-tooling/src/writer/changes/writers/new-model-writer.ts +++ b/packages/adp-tooling/src/writer/changes/writers/new-model-writer.ts @@ -24,7 +24,10 @@ export class NewModelWriter implements IWriter { * @param {Editor} fs - The filesystem editor instance. * @param {string} projectPath - The root path of the project. */ - constructor(private fs: Editor, private projectPath: string) {} + constructor( + private fs: Editor, + private projectPath: string + ) {} /** * Constructs the content for an new model change based on provided data. diff --git a/packages/adp-tooling/src/writer/options.ts b/packages/adp-tooling/src/writer/options.ts index b7c6738726b..deab1ca53f8 100644 --- a/packages/adp-tooling/src/writer/options.ts +++ b/packages/adp-tooling/src/writer/options.ts @@ -296,9 +296,8 @@ function getInboundChangeContentWithNewInboundID( }; if (flpConfiguration.subTitle) { - content.inbound[ - flpConfiguration.inboundId - ].subTitle = `{{${appId}_sap.app.crossNavigation.inbounds.${flpConfiguration.inboundId}.subTitle}}`; + content.inbound[flpConfiguration.inboundId].subTitle = + `{{${appId}_sap.app.crossNavigation.inbounds.${flpConfiguration.inboundId}.subTitle}}`; } return content; diff --git a/packages/adp-tooling/test/unit/base/abap/manifest-service.test.ts b/packages/adp-tooling/test/unit/base/abap/manifest-service.test.ts index 4745a9a0130..cbd8da2d452 100644 --- a/packages/adp-tooling/test/unit/base/abap/manifest-service.test.ts +++ b/packages/adp-tooling/test/unit/base/abap/manifest-service.test.ts @@ -67,7 +67,7 @@ describe('ManifestService', () => { ({ addFile: jest.fn(), toBuffer: jest.fn().mockReturnValue(Buffer.from('zip content')) - } as unknown as ZipFile) + }) as unknown as ZipFile ); }); diff --git a/packages/adp-tooling/test/unit/base/helper.test.ts b/packages/adp-tooling/test/unit/base/helper.test.ts index 669bec5fd73..c16ce9a1799 100644 --- a/packages/adp-tooling/test/unit/base/helper.test.ts +++ b/packages/adp-tooling/test/unit/base/helper.test.ts @@ -5,8 +5,7 @@ import type { create, Editor } from 'mem-fs-editor'; import { UI5Config } from '@sap-ux/ui5-config'; import type { Inbound } from '@sap-ux/axios-extension'; import type { DescriptorVariant } from '../../../src/types'; -import type { CustomMiddleware } from '@sap-ux/ui5-config'; -import type { FioriToolsProxyConfig } from '@sap-ux/ui5-config'; +import type { CustomMiddleware, FioriToolsProxyConfig } from '@sap-ux/ui5-config'; import { getVariant, diff --git a/packages/adp-tooling/test/unit/cf/app/html5-repo.test.ts b/packages/adp-tooling/test/unit/cf/app/html5-repo.test.ts index 34a14cc06db..c31672ac09b 100644 --- a/packages/adp-tooling/test/unit/cf/app/html5-repo.test.ts +++ b/packages/adp-tooling/test/unit/cf/app/html5-repo.test.ts @@ -85,7 +85,6 @@ describe('HTML5 Repository', () => { test('should successfully get OAuth token', async () => { const mockResponse = { data: { - // eslint-disable-next-line @typescript-eslint/naming-convention access_token: 'test-access-token' } }; @@ -227,7 +226,6 @@ describe('HTML5 Repository', () => { mockAxios.get .mockResolvedValueOnce({ data: { - // eslint-disable-next-line @typescript-eslint/naming-convention access_token: 'test-token' } }) diff --git a/packages/adp-tooling/test/unit/cf/core/auth.test.ts b/packages/adp-tooling/test/unit/cf/core/auth.test.ts index ea48a65704d..fb15bc7d542 100644 --- a/packages/adp-tooling/test/unit/cf/core/auth.test.ts +++ b/packages/adp-tooling/test/unit/cf/core/auth.test.ts @@ -7,7 +7,7 @@ jest.mock('@sap/cf-tools/out/src/cf-local', () => ({ cfGetAvailableOrgs: jest.fn() })); -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-require-imports const mockCFLocal = require('@sap/cf-tools/out/src/cf-local'); const mockCfConfig: CfConfig = { diff --git a/packages/adp-tooling/test/unit/preview/adp-preview.test.ts b/packages/adp-tooling/test/unit/preview/adp-preview.test.ts index c074c1bdc5f..d3284a6ef30 100644 --- a/packages/adp-tooling/test/unit/preview/adp-preview.test.ts +++ b/packages/adp-tooling/test/unit/preview/adp-preview.test.ts @@ -5,6 +5,7 @@ import express from 'express'; import { renderFile } from 'ejs'; import supertest from 'supertest'; import type { Editor } from 'mem-fs-editor'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection } from '@ui5/fs'; import type { SuperTest, Test } from 'supertest'; @@ -900,7 +901,6 @@ describe('AdaptationProject', () => { test('GET /adp/api/annotation => Metadata fetch error', async () => { jest.spyOn(manifestService.ManifestService, 'initMergedManifest').mockResolvedValue({ - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment getDataSourceMetadata: jest.fn().mockRejectedValue(new Error('Metadata fetch error')), getManifestDataSources: jest.fn().mockReturnValue({ mainService: { diff --git a/packages/adp-tooling/test/unit/ui5/validator.test.ts b/packages/adp-tooling/test/unit/ui5/validator.test.ts index b95f38fc146..962f9c41fcf 100644 --- a/packages/adp-tooling/test/unit/ui5/validator.test.ts +++ b/packages/adp-tooling/test/unit/ui5/validator.test.ts @@ -3,8 +3,7 @@ import { validateEmptyString } from '@sap-ux/project-input-validator'; import { getOfficialBaseUI5VersionUrl, getFormattedVersion } from '../../../src/ui5/format'; import { validateUI5VersionExists } from '../../../src'; import { fetchMock } from '../../__mock__/global'; -import { t } from '../../../src/i18n'; -import { initI18n } from '../../../src/i18n'; +import { t, initI18n } from '../../../src/i18n'; jest.mock('@sap-ux/project-input-validator', () => ({ validateEmptyString: jest.fn() diff --git a/packages/adp-tooling/test/unit/writer/i18n/index.test.ts b/packages/adp-tooling/test/unit/writer/i18n/index.test.ts index 4c3ffec652d..4738d9fe05a 100644 --- a/packages/adp-tooling/test/unit/writer/i18n/index.test.ts +++ b/packages/adp-tooling/test/unit/writer/i18n/index.test.ts @@ -8,8 +8,12 @@ import { BASE_I18N_DESCRIPTION, TRANSLATION_UUID_TEXT } from '../../../../src'; -import { getI18nDescription } from '../../../../src/writer/i18n'; -import { writeI18nModels, extractResourceModelPath, getI18nModels } from '../../../../src/writer/i18n'; +import { + getI18nDescription, + writeI18nModels, + extractResourceModelPath, + getI18nModels +} from '../../../../src/writer/i18n'; jest.mock('uuid', () => ({ v4: jest.fn() diff --git a/packages/annotation-generator/.eslintignore b/packages/annotation-generator/.eslintignore deleted file mode 100644 index a2a8f895ae1..00000000000 --- a/packages/annotation-generator/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -dist -docs -reports -jest.setup.js diff --git a/packages/annotation-generator/.eslintrc.js b/packages/annotation-generator/.eslintrc.js deleted file mode 100644 index 4e6154b16f1..00000000000 --- a/packages/annotation-generator/.eslintrc.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - overrides: [ - { - parser: '@typescript-eslint/parser', - files: ['src/**/*.ts'], - rules: { - 'jsdoc/require-jsdoc': [ - 'error', - { - 'publicOnly': true, - 'require': { - 'FunctionDeclaration': true, - 'MethodDefinition': true, - 'ClassDeclaration': true, - 'ArrowFunctionExpression': true, - 'FunctionExpression': true - }, - 'exemptEmptyFunctions': true - } - ] - } - } - ] -}; diff --git a/packages/annotation-generator/eslint.config.js b/packages/annotation-generator/eslint.config.js new file mode 100644 index 00000000000..f84537d557b --- /dev/null +++ b/packages/annotation-generator/eslint.config.js @@ -0,0 +1,29 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json' + } + }, + rules: { + 'jsdoc/require-jsdoc': [ + 'error', + { + 'publicOnly': true, + 'require': { + 'FunctionDeclaration': true, + 'MethodDefinition': true, + 'ClassDeclaration': true, + 'ArrowFunctionExpression': true, + 'FunctionExpression': true + }, + 'exemptEmptyFunctions': true + } + ] + } + } +]; diff --git a/packages/annotation-generator/src/generation.ts b/packages/annotation-generator/src/generation.ts index 34c5a07c15d..0bca078c422 100644 --- a/packages/annotation-generator/src/generation.ts +++ b/packages/annotation-generator/src/generation.ts @@ -325,7 +325,7 @@ function getDataFieldRecordCollection(context: Context, isListReport = false): A type === 'Edm.Guid' || !type?.startsWith('Edm') || // can't use nullish coalescing for boolean values - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + mdElement?.isCollectionValued || // for CDS: no fields from sap.cds.common ((project.projectType === 'CAPJava' || project.projectType === 'CAPNodejs') && diff --git a/packages/annotation-generator/tsconfig.eslint.json b/packages/annotation-generator/tsconfig.eslint.json index fa84f56b9ac..208740358d4 100644 --- a/packages/annotation-generator/tsconfig.eslint.json +++ b/packages/annotation-generator/tsconfig.eslint.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", - "include": ["src", "test", ".eslintrc.js"] + "include": ["src", "test", "eslintrc.config.js"], } \ No newline at end of file diff --git a/packages/app-config-writer/.eslintignore b/packages/app-config-writer/.eslintignore deleted file mode 100644 index afb972cd24d..00000000000 --- a/packages/app-config-writer/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -templates \ No newline at end of file diff --git a/packages/app-config-writer/.eslintrc.js b/packages/app-config-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/app-config-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/app-config-writer/eslint.config.js b/packages/app-config-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/app-config-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/app-config-writer/src/common/package-json.ts b/packages/app-config-writer/src/common/package-json.ts index 621daa17796..a8d1aa6ad6f 100644 --- a/packages/app-config-writer/src/common/package-json.ts +++ b/packages/app-config-writer/src/common/package-json.ts @@ -85,7 +85,6 @@ export function isValidPreviewScript(script: Script, convertTests: boolean = fal script.name != 'start-control-property-editor' && script.name != 'start-cards-generator'; - //eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing const startsWebServer = !!(script.value.includes('ui5 serve') || script.value.includes('fiori run')); const { path } = extractUrlDetails(script.value); const opensTest = isTestPath(script ?? ''); diff --git a/packages/axios-extension/.eslintignore b/packages/axios-extension/.eslintignore deleted file mode 100644 index ac236973dfd..00000000000 --- a/packages/axios-extension/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -test/abap/mockResponses/ diff --git a/packages/axios-extension/.eslintrc.js b/packages/axios-extension/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/axios-extension/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/axios-extension/eslint.config.js b/packages/axios-extension/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/axios-extension/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/axios-extension/src/abap/abap-service-provider.ts b/packages/axios-extension/src/abap/abap-service-provider.ts index 0aa5c8e6098..c9de3b2d5af 100644 --- a/packages/axios-extension/src/abap/abap-service-provider.ts +++ b/packages/axios-extension/src/abap/abap-service-provider.ts @@ -9,7 +9,7 @@ import type { AbapCDSView, AtoSettings, BusinessObject, SystemInfo } from './typ import { TenantType } from './types'; import { Ui5AbapRepositoryService } from './ui5-abap-repository-service'; // Can't use an `import type` here. We need the classname at runtime to create object instances: -// eslint-disable-next-line @typescript-eslint/consistent-type-imports + import { ODataServiceGenerator } from './adt-catalog/generators/odata-service-generator'; import type { GeneratorEntry } from './adt-catalog/generators/types'; import { UiServiceGenerator } from './adt-catalog/generators/ui-service-generator'; diff --git a/packages/axios-extension/src/abap/message.ts b/packages/axios-extension/src/abap/message.ts index 1f896368592..0c41af7ed56 100644 --- a/packages/axios-extension/src/abap/message.ts +++ b/packages/axios-extension/src/abap/message.ts @@ -59,7 +59,7 @@ function logLevel(severity: string, msg: string, log: Logger, error = false): vo log[severity](msg); } } else { - error ? log.error(msg) : log.info(msg); + log[error ? 'error' : 'info'](msg); } } diff --git a/packages/axios-extension/src/auth/uaa.ts b/packages/axios-extension/src/auth/uaa.ts index 44ed9e95d98..c99c0b8d23f 100644 --- a/packages/axios-extension/src/auth/uaa.ts +++ b/packages/axios-extension/src/auth/uaa.ts @@ -24,7 +24,10 @@ export class Uaa { * @param serviceInfo service Information * @param log logger */ - constructor(serviceInfo: ServiceInfo, protected log: Logger) { + constructor( + serviceInfo: ServiceInfo, + protected log: Logger + ) { this.validatePropertyExists(serviceInfo.uaa.clientid, 'Client ID missing'); this.validatePropertyExists(serviceInfo.uaa.clientsecret, 'Client Secret missing'); this.validatePropertyExists(serviceInfo.uaa.url, 'UAA URL missing'); diff --git a/packages/axios-extension/src/factory.ts b/packages/axios-extension/src/factory.ts index c836d5f3322..0860571a7d3 100644 --- a/packages/axios-extension/src/factory.ts +++ b/packages/axios-extension/src/factory.ts @@ -31,7 +31,10 @@ type Class = new (...args: any[]) => T; /** * PatchedHttpsProxyAgent is a custom implementation of HttpsProxyAgent that allows to pass additional options, currently not supported by the original implementation when calling tls.connect */ -// eslint-disable-next-line jsdoc/require-jsdoc + +/** + * + */ export class PatchedHttpsProxyAgent extends HttpsProxyAgent { private readonly extraOptions: any; diff --git a/packages/axios-extension/test/abap/lrep-service.test.ts b/packages/axios-extension/test/abap/lrep-service.test.ts index ebdd7925db3..fec5d11aa80 100644 --- a/packages/axios-extension/test/abap/lrep-service.test.ts +++ b/packages/axios-extension/test/abap/lrep-service.test.ts @@ -1,9 +1,8 @@ import nock from 'nock'; import fs from 'node:fs'; import type { Message } from '../../src/abap/lrep-service'; -import type { AdaptationConfig } from '../../src'; +import type { AdaptationConfig, AxiosError } from '../../src'; import { LayeredRepositoryService, createForAbap } from '../../src'; -import type { AxiosError } from '../../src'; import type { ToolsLogger } from '@sap-ux/logger'; import * as Logger from '@sap-ux/logger'; diff --git a/packages/backend-proxy-middleware/.eslintignore b/packages/backend-proxy-middleware/.eslintignore deleted file mode 100644 index 0fc18a40e56..00000000000 --- a/packages/backend-proxy-middleware/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test -dist diff --git a/packages/backend-proxy-middleware/.eslintrc.js b/packages/backend-proxy-middleware/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/backend-proxy-middleware/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/backend-proxy-middleware/eslint.config.js b/packages/backend-proxy-middleware/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/backend-proxy-middleware/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/backend-proxy-middleware/src/ext/bsp.ts b/packages/backend-proxy-middleware/src/ext/bsp.ts index 5184e4c75a7..2894b311a12 100644 --- a/packages/backend-proxy-middleware/src/ext/bsp.ts +++ b/packages/backend-proxy-middleware/src/ext/bsp.ts @@ -82,7 +82,7 @@ export async function addOptionsForEmbeddedBSP(bspPath: string, proxyOptions: Op const protocol = 'protocol' in req ? req.protocol - : req.headers.referer?.substring(0, req.headers.referer.indexOf(':')) ?? 'http'; + : (req.headers.referer?.substring(0, req.headers.referer.indexOf(':')) ?? 'http'); return protocol + '://' + req.headers.host; } else { return undefined; diff --git a/packages/backend-proxy-middleware/test/base/proxy.test.ts b/packages/backend-proxy-middleware/test/base/proxy.test.ts index eefca9979da..c4a8ea9e39b 100644 --- a/packages/backend-proxy-middleware/test/base/proxy.test.ts +++ b/packages/backend-proxy-middleware/test/base/proxy.test.ts @@ -10,8 +10,9 @@ import { type EnhancedIncomingMessage } from '../../src/base/proxy'; import { generateProxyMiddlewareOptions, createProxy } from '../../src'; -import { BackendConfig, DestinationBackendConfig, LocalBackendConfig } from '../../src/base/types'; -import { AuthenticationType, BackendSystem } from '@sap-ux/store'; +import type { BackendConfig, DestinationBackendConfig, LocalBackendConfig } from '../../src/base/types'; +import type { BackendSystem } from '@sap-ux/store'; +import { AuthenticationType } from '@sap-ux/store'; import { getInstance } from '@sap-ux/store/dist/services/backend-system'; jest.mock('@sap-ux/store/dist/services/api-hub', () => ({ diff --git a/packages/backend-proxy-middleware/test/middleware.test.ts b/packages/backend-proxy-middleware/test/middleware.test.ts index 7e3200084a4..7bc6f63ce06 100644 --- a/packages/backend-proxy-middleware/test/middleware.test.ts +++ b/packages/backend-proxy-middleware/test/middleware.test.ts @@ -2,9 +2,9 @@ import express from 'express'; import supertest from 'supertest'; import * as proxy from '../src/base/proxy'; import * as proxyMiddleware from '../src/middleware'; -import { BackendMiddlewareConfig } from '../src/base/types'; +import type { BackendMiddlewareConfig } from '../src/base/types'; import nock from 'nock'; -import { Options } from 'http-proxy-middleware'; +import type { Options } from 'http-proxy-middleware'; import connect = require('connect'); import { ToolsLogger } from '@sap-ux/logger'; diff --git a/packages/btp-utils/.eslintignore b/packages/btp-utils/.eslintignore deleted file mode 100644 index 0fc18a40e56..00000000000 --- a/packages/btp-utils/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test -dist diff --git a/packages/btp-utils/.eslintrc.js b/packages/btp-utils/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/btp-utils/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/btp-utils/eslint.config.js b/packages/btp-utils/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/btp-utils/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/btp-utils/src/app-studio.ts b/packages/btp-utils/src/app-studio.ts index 18342a217f4..16a57ad87e8 100644 --- a/packages/btp-utils/src/app-studio.ts +++ b/packages/btp-utils/src/app-studio.ts @@ -6,7 +6,7 @@ import { apiGetServicesInstancesFilteredByType, cfGetInstanceKeyParameters, cfGetTarget, - type ServiceInstanceInfo + type ServiceInstanceInfo // eslint-disable-line @typescript-eslint/no-unused-vars } from '@sap/cf-tools'; import axios from 'axios'; import { ENV } from './app-studio.env'; @@ -145,7 +145,7 @@ export async function exposePort(port: number, logger?: Logger): Promise try { const response = await axios.get(`http://localhost:3001/AppStudio/api/getHostByPort?port=${port}`); return `${response.data.result}`; - } catch (error) { + } catch { logger?.error(`Port ${port} was not exposed!`); return ''; } diff --git a/packages/btp-utils/test/app-studio.test.ts b/packages/btp-utils/test/app-studio.test.ts index 1694fcd6aa5..a2bcb5fe0b5 100644 --- a/packages/btp-utils/test/app-studio.test.ts +++ b/packages/btp-utils/test/app-studio.test.ts @@ -28,7 +28,7 @@ const mockInstanceSettings = { clientsecret: 'CLIENT_SECRET' }; -let cfDiscoveredAbapEnvsMock: ServiceInstanceInfo[] = [ +const cfDiscoveredAbapEnvsMock: ServiceInstanceInfo[] = [ { label: 'system1', serviceName: 'service1' }, { label: 'system2', serviceName: 'service2' } ]; diff --git a/packages/btp-utils/test/destination.test.ts b/packages/btp-utils/test/destination.test.ts index 658085d3336..db44dd3216e 100644 --- a/packages/btp-utils/test/destination.test.ts +++ b/packages/btp-utils/test/destination.test.ts @@ -1,6 +1,6 @@ import { DestinationProxyType } from '../dist'; import { - Destination, + type Destination, isAbapEnvironmentOnBtp, isAbapSystem, isGenericODataDestination, diff --git a/packages/cap-config-writer/.eslintignore b/packages/cap-config-writer/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/packages/cap-config-writer/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/packages/cap-config-writer/.eslintrc.js b/packages/cap-config-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/cap-config-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/cap-config-writer/eslint.config.js b/packages/cap-config-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/cap-config-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/cap-config-writer/src/cap-writer/package-json.ts b/packages/cap-config-writer/src/cap-writer/package-json.ts index 96305942794..21a8ddd1fc4 100644 --- a/packages/cap-config-writer/src/cap-writer/package-json.ts +++ b/packages/cap-config-writer/src/cap-writer/package-json.ts @@ -107,7 +107,7 @@ async function updateScripts( addCdsUi5Plugin?: boolean ): Promise { let cdsScripts: { [x: string]: string } = {}; - // eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing + if (addCdsUi5Plugin) { // If the project has the cds-plugin-ui5 then the project is served using the appId // Update existing watch scripts if they exist diff --git a/packages/cards-editor-config-writer/eslint.config.js b/packages/cards-editor-config-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/cards-editor-config-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/cards-editor-middleware/eslint.config.js b/packages/cards-editor-middleware/eslint.config.js new file mode 100644 index 00000000000..f68dce77baf --- /dev/null +++ b/packages/cards-editor-middleware/eslint.config.js @@ -0,0 +1,17 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + globals: { + sap: true, + fetch: true + } + } + }, +]; \ No newline at end of file diff --git a/packages/cds-annotation-parser/.eslintignore b/packages/cds-annotation-parser/.eslintignore deleted file mode 100644 index 241d967d8bb..00000000000 --- a/packages/cds-annotation-parser/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -reports diff --git a/packages/cds-annotation-parser/.eslintrc b/packages/cds-annotation-parser/.eslintrc deleted file mode 100644 index e9ab6ed3a96..00000000000 --- a/packages/cds-annotation-parser/.eslintrc +++ /dev/null @@ -1,37 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "parserOptions": { - "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true, - "project": "./tsconfig.eslint.json" - }, - "rules": { - "@typescript-eslint/naming-convention": [ - "off", - { "selector": "variable", "format": [ "UPPER_CASE", "snake_case"] } - ] - }, - "overrides": [ - { - "files": ["src/parser/parser.ts"], - "rules": { - "new-cap": [ - "warn", - { - "capIsNew": false - } - ] - } - }, - { - "files": ["src/parser/tokens.ts"], - "rules": { - "camelcase": [ - "warn", - { - "properties": "never" - } - ] - } - } - ] -} diff --git a/packages/cds-annotation-parser/eslint.config.js b/packages/cds-annotation-parser/eslint.config.js new file mode 100644 index 00000000000..a782ca53eeb --- /dev/null +++ b/packages/cds-annotation-parser/eslint.config.js @@ -0,0 +1,43 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + } + } + }, + { + 'rules': { + '@typescript-eslint/naming-convention': [ + 'off', + { 'selector': 'variable', 'format': ['UPPER_CASE', 'snake_case'] } + ] + } + }, + { + 'files': ['src/parser/parser.ts'], + 'rules': { + 'new-cap': [ + 'warn', + { + 'capIsNew': false + } + ] + } + }, + { + 'files': ['src/parser/tokens.ts'], + 'rules': { + 'camelcase': [ + 'warn', + { + 'properties': 'never' + } + ] + } + } +]; diff --git a/packages/cds-annotation-parser/src/transformer/ast.ts b/packages/cds-annotation-parser/src/transformer/ast.ts index 69c013e3cd5..0b841c39873 100644 --- a/packages/cds-annotation-parser/src/transformer/ast.ts +++ b/packages/cds-annotation-parser/src/transformer/ast.ts @@ -177,7 +177,7 @@ class CstToAstVisitor extends Visitor { const line = hasNaNOrUndefined(token.endLine) ? (token.startLine ?? 0) - 1 : (token.endLine ?? 0) - 1; const char = hasNaNOrUndefined(token.endColumn) ? (token.startColumn ?? 0) - 1 + token.image.length - : token.endColumn ?? 0; + : (token.endColumn ?? 0); const end = Position.create(line, char); if (this.startPosition) { return Range.create(adjustPosition(start, this.startPosition), adjustPosition(end, this.startPosition)); diff --git a/packages/cds-annotation-parser/test/utils/setup.ts b/packages/cds-annotation-parser/test/utils/setup.ts index bea6088dc98..3f2b6eec966 100644 --- a/packages/cds-annotation-parser/test/utils/setup.ts +++ b/packages/cds-annotation-parser/test/utils/setup.ts @@ -69,7 +69,7 @@ const reduceTokenInfo = (token: IToken): void => { if (hasNaNOrUndefined(token.endOffset)) { token.endOffset = -1; } - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + (token as any).tokenTypeName = token.tokenType.name; deleteObjProp(token, 'startLine'); deleteObjProp(token, 'endLine'); diff --git a/packages/cds-odata-annotation-converter/.eslintignore b/packages/cds-odata-annotation-converter/.eslintignore deleted file mode 100644 index 781ebfaa480..00000000000 --- a/packages/cds-odata-annotation-converter/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -out -reports diff --git a/packages/cds-odata-annotation-converter/.eslintrc b/packages/cds-odata-annotation-converter/.eslintrc deleted file mode 100644 index 23fa26f340e..00000000000 --- a/packages/cds-odata-annotation-converter/.eslintrc +++ /dev/null @@ -1,10 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "parserOptions": { - "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true, - "project": "./tsconfig.eslint.json" - }, - "rules": { - "@typescript-eslint/no-use-before-define": ["off"] - } -} diff --git a/packages/cds-odata-annotation-converter/eslint.config.js b/packages/cds-odata-annotation-converter/eslint.config.js new file mode 100644 index 00000000000..14091ecbe29 --- /dev/null +++ b/packages/cds-odata-annotation-converter/eslint.config.js @@ -0,0 +1,17 @@ +const { ignores } = require('eslint-plugin-prettier/recommended'); +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json' + } + }, + 'rules': { + '@typescript-eslint/no-use-before-define': ['off'] + } + } +]; diff --git a/packages/cds-odata-annotation-converter/src/transforms/annotation/handlers/expression.ts b/packages/cds-odata-annotation-converter/src/transforms/annotation/handlers/expression.ts index 9dd19338c5d..f864c1d6576 100644 --- a/packages/cds-odata-annotation-converter/src/transforms/annotation/handlers/expression.ts +++ b/packages/cds-odata-annotation-converter/src/transforms/annotation/handlers/expression.ts @@ -21,14 +21,14 @@ import type { VisitorState } from '../visitor-state'; export const correctExpressionHandler: NodeHandler = { type: CORRECT_EXPRESSION_TYPE, - // eslint-disable-next-line @typescript-eslint/no-unused-vars + getChildren(state: VisitorState, expression: CorrectExpression): AnnotationValue[] { if (containsIncorrectExpressions(expression)) { return []; } return expression.operands; }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars + convert(state: VisitorState, expression: CorrectExpression): ConvertResult { if (containsIncorrectExpressions(expression)) { return; @@ -55,7 +55,7 @@ export const unknownOperatorExpressionHandler: NodeHandler { const fsLib = jest.requireActual('fs'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const Union = require('unionfs').Union; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const vol = require('memfs').vol; const _fs = new Union().use(fsLib); _fs.constants = fsLib.constants; diff --git a/packages/cf-deploy-config-sub-generator/test/app.test.ts b/packages/cf-deploy-config-sub-generator/test/app.test.ts index db4cafa0e44..a50c0737737 100644 --- a/packages/cf-deploy-config-sub-generator/test/app.test.ts +++ b/packages/cf-deploy-config-sub-generator/test/app.test.ts @@ -38,9 +38,9 @@ jest.mock('@sap-ux/project-access', () => { jest.mock('fs', () => { const fsLib = jest.requireActual('fs'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const Union = require('unionfs').Union; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const vol = require('memfs').vol; const _fs = new Union().use(fsLib); _fs.constants = fsLib.constants; @@ -64,7 +64,6 @@ jest.mock('@sap/mta-lib', () => { const mockGetHostEnvironment = jest.fn(); const mockSendTelemetry = jest.fn(); jest.mock('@sap-ux/fiori-generator-shared', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/fiori-generator-shared') as {}), sendTelemetry: () => mockSendTelemetry(), isExtensionInstalled: jest.fn().mockReturnValue(true), diff --git a/packages/cf-deploy-config-sub-generator/test/cap-app.test.ts b/packages/cf-deploy-config-sub-generator/test/cap-app.test.ts index 4ff7f18d109..a8d1aca1cdf 100644 --- a/packages/cf-deploy-config-sub-generator/test/cap-app.test.ts +++ b/packages/cf-deploy-config-sub-generator/test/cap-app.test.ts @@ -30,9 +30,9 @@ jest.mock('@sap-ux/project-access', () => { jest.mock('fs', () => { const fsLib = jest.requireActual('fs'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const Union = require('unionfs').Union; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const vol = require('memfs').vol; const _fs = new Union().use(fsLib); _fs.constants = fsLib.constants; @@ -56,7 +56,6 @@ jest.mock('@sap/mta-lib', () => { const mockGetHostEnvironment = jest.fn(); const mockSendTelemetry = jest.fn(); jest.mock('@sap-ux/fiori-generator-shared', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/fiori-generator-shared') as {}), sendTelemetry: () => mockSendTelemetry(), isExtensionInstalled: jest.fn().mockReturnValue(true), diff --git a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/Component.js b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/Component.js index 2cc94dd09f5..95d5b03fc53 100644 --- a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/Component.js +++ b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/Component.js @@ -1,15 +1,10 @@ -sap.ui.define([ - "sap/ui/core/UIComponent", - "project1/model/models" -], (UIComponent, models) => { - "use strict"; +sap.ui.define(['sap/ui/core/UIComponent', 'project1/model/models'], (UIComponent, models) => { + 'use strict'; - return UIComponent.extend("project1.Component", { + return UIComponent.extend('project1.Component', { metadata: { - manifest: "json", - interfaces: [ - "sap.ui.core.IAsyncContentCreation" - ] + manifest: 'json', + interfaces: ['sap.ui.core.IAsyncContentCreation'] }, init() { @@ -17,10 +12,10 @@ sap.ui.define([ UIComponent.prototype.init.apply(this, arguments); // set the device model - this.setModel(models.createDeviceModel(), "device"); + this.setModel(models.createDeviceModel(), 'device'); // enable routing this.getRouter().initialize(); } }); -}); \ No newline at end of file +}); diff --git a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/controller/App.controller.js b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/controller/App.controller.js index 3b9355dda60..eaab0af9f86 100644 --- a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/controller/App.controller.js +++ b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/controller/App.controller.js @@ -1,10 +1,7 @@ -sap.ui.define([ - "sap/ui/core/mvc/Controller" -], (BaseController) => { - "use strict"; +sap.ui.define(['sap/ui/core/mvc/Controller'], (BaseController) => { + 'use strict'; - return BaseController.extend("project1.controller.App", { - onInit() { - } - }); -}); \ No newline at end of file + return BaseController.extend('project1.controller.App', { + onInit() {} + }); +}); diff --git a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/controller/View1.controller.js b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/controller/View1.controller.js index 491f3309bba..02912249474 100644 --- a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/controller/View1.controller.js +++ b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/controller/View1.controller.js @@ -1,10 +1,7 @@ -sap.ui.define([ - "sap/ui/core/mvc/Controller" -], (Controller) => { - "use strict"; +sap.ui.define(['sap/ui/core/mvc/Controller'], (Controller) => { + 'use strict'; - return Controller.extend("project1.controller.View1", { - onInit() { - } + return Controller.extend('project1.controller.View1', { + onInit() {} }); -}); \ No newline at end of file +}); diff --git a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/model/models.js b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/model/models.js index 47b027fbc08..0149171ad39 100644 --- a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/model/models.js +++ b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/app/testui5app/webapp/model/models.js @@ -1,9 +1,5 @@ -sap.ui.define([ - "sap/ui/model/json/JSONModel", - "sap/ui/Device" -], -function (JSONModel, Device) { - "use strict"; +sap.ui.define(['sap/ui/model/json/JSONModel', 'sap/ui/Device'], function (JSONModel, Device) { + 'use strict'; return { /** @@ -12,9 +8,8 @@ function (JSONModel, Device) { */ createDeviceModel: function () { var oModel = new JSONModel(Device); - oModel.setDefaultBindingMode("OneWay"); + oModel.setDefaultBindingMode('OneWay'); return oModel; } }; - -}); \ No newline at end of file +}); diff --git a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/eslint.config.mjs b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/eslint.config.mjs index 2fdb4320ca3..d762606fb8a 100644 --- a/packages/cf-deploy-config-sub-generator/test/fixtures/cap/eslint.config.mjs +++ b/packages/cf-deploy-config-sub-generator/test/fixtures/cap/eslint.config.mjs @@ -1,2 +1,2 @@ -import cds from '@sap/cds/eslint.config.mjs' -export default [ ...cds.recommended ] +import cds from '@sap/cds/eslint.config.mjs'; +export default [...cds.recommended]; diff --git a/packages/cf-deploy-config-writer/.eslintignore b/packages/cf-deploy-config-writer/.eslintignore deleted file mode 100644 index 5d34d8f445f..00000000000 --- a/packages/cf-deploy-config-writer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -test/sample -dist \ No newline at end of file diff --git a/packages/cf-deploy-config-writer/.eslintrc.js b/packages/cf-deploy-config-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/cf-deploy-config-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/cf-deploy-config-writer/eslint.config.js b/packages/cf-deploy-config-writer/eslint.config.js new file mode 100644 index 00000000000..2279ca260b1 --- /dev/null +++ b/packages/cf-deploy-config-writer/eslint.config.js @@ -0,0 +1,16 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json' + } + }, + rules: { + '@typescript-eslint/no-use-before-define': ['off'] + } + } +]; diff --git a/packages/cf-deploy-config-writer/test/unit/cap-appfrontend.test.ts b/packages/cf-deploy-config-writer/test/unit/cap-appfrontend.test.ts index 0af34d93476..9e6ac119c5c 100644 --- a/packages/cf-deploy-config-writer/test/unit/cap-appfrontend.test.ts +++ b/packages/cf-deploy-config-writer/test/unit/cap-appfrontend.test.ts @@ -14,7 +14,7 @@ import fs from 'node:fs'; jest.mock('@sap/mta-lib', () => { return { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports Mta: require('./mockMta').MockMta }; }); @@ -40,7 +40,7 @@ describe('CF Writer with CAP App Frontend', () => { jest.resetAllMocks(); jest.restoreAllMocks(); unitTestFs = create(createStorage()); - commandRunnerMock = jest.spyOn(CommandRunner.prototype, 'run').mockImplementation(() => ({ status: 0 } as any)); + commandRunnerMock = jest.spyOn(CommandRunner.prototype, 'run').mockImplementation(() => ({ status: 0 }) as any); isAppStudioMock.mockReturnValue(false); hasSyncMock = jest.spyOn(hasbin, 'sync').mockImplementation(() => true); }); diff --git a/packages/cf-deploy-config-writer/test/unit/cap.test.ts b/packages/cf-deploy-config-writer/test/unit/cap.test.ts index 31d1623c6f9..519a79a8dcf 100644 --- a/packages/cf-deploy-config-writer/test/unit/cap.test.ts +++ b/packages/cf-deploy-config-writer/test/unit/cap.test.ts @@ -12,7 +12,7 @@ import { CommandRunner } from '@sap-ux/nodejs-utils'; jest.mock('@sap/mta-lib', () => { return { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports Mta: require('./mockMta').MockMta }; }); @@ -34,7 +34,7 @@ describe('CF Writer', () => { jest.resetAllMocks(); jest.restoreAllMocks(); unitTestFs = create(createStorage()); - commandRunnerMock = jest.spyOn(CommandRunner.prototype, 'run').mockImplementation(() => ({ status: 0 } as any)); + commandRunnerMock = jest.spyOn(CommandRunner.prototype, 'run').mockImplementation(() => ({ status: 0 }) as any); isAppStudioMock.mockReturnValue(false); hasSyncMock = jest.spyOn(hasbin, 'sync').mockImplementation(() => true); }); diff --git a/packages/cf-deploy-config-writer/test/unit/index-app.test.ts b/packages/cf-deploy-config-writer/test/unit/index-app.test.ts index ffdae5bc25d..3ce7baa1077 100644 --- a/packages/cf-deploy-config-writer/test/unit/index-app.test.ts +++ b/packages/cf-deploy-config-writer/test/unit/index-app.test.ts @@ -24,7 +24,7 @@ jest.mock('hasbin', () => ({ jest.mock('@sap/mta-lib', () => { return { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports Mta: require('./mockMta').MockMta }; }); @@ -60,7 +60,7 @@ describe('CF Writer App', () => { isAppStudioMock = jest.spyOn(btp, 'isAppStudio'); listDestinationsMock = jest.spyOn(btp, 'listDestinations'); hasSyncMock = jest.spyOn(hasbin, 'sync').mockImplementation(() => true); - commandRunnerMock = jest.spyOn(CommandRunner.prototype, 'run').mockImplementation(() => ({ status: 0 } as any)); + commandRunnerMock = jest.spyOn(CommandRunner.prototype, 'run').mockImplementation(() => ({ status: 0 }) as any); }); beforeAll(() => { diff --git a/packages/cf-deploy-config-writer/test/unit/index-appfront.test.ts b/packages/cf-deploy-config-writer/test/unit/index-appfront.test.ts index 1d529ecb23b..df3ca21a043 100644 --- a/packages/cf-deploy-config-writer/test/unit/index-appfront.test.ts +++ b/packages/cf-deploy-config-writer/test/unit/index-appfront.test.ts @@ -19,7 +19,7 @@ jest.mock('hasbin', () => ({ jest.mock('@sap/mta-lib', () => { return { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports Mta: require('./mockMta').MockMta }; }); @@ -37,7 +37,7 @@ describe('CF Writer App - Application Frontend', () => { jest.resetAllMocks(); jest.restoreAllMocks(); hasSyncMock = jest.spyOn(hasbin, 'sync').mockImplementation(() => true); - commandRunnerMock = jest.spyOn(CommandRunner.prototype, 'run').mockImplementation(() => ({ status: 0 } as any)); + commandRunnerMock = jest.spyOn(CommandRunner.prototype, 'run').mockImplementation(() => ({ status: 0 }) as any); unitTestFs = create(createStorage()); }); diff --git a/packages/cf-deploy-config-writer/test/unit/index-cap.test.ts b/packages/cf-deploy-config-writer/test/unit/index-cap.test.ts index c3b761c0ecc..b3bfde80cb7 100644 --- a/packages/cf-deploy-config-writer/test/unit/index-cap.test.ts +++ b/packages/cf-deploy-config-writer/test/unit/index-cap.test.ts @@ -18,7 +18,7 @@ jest.mock('hasbin', () => ({ jest.mock('@sap/mta-lib', () => { return { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports Mta: require('./mockMta').MockMta }; }); diff --git a/packages/cf-deploy-config-writer/test/unit/mta.test.ts b/packages/cf-deploy-config-writer/test/unit/mta.test.ts index 103c5afc5b2..ed238e4c4d2 100644 --- a/packages/cf-deploy-config-writer/test/unit/mta.test.ts +++ b/packages/cf-deploy-config-writer/test/unit/mta.test.ts @@ -8,9 +8,9 @@ import type { mta } from '@sap/mta-lib'; jest.mock('fs', () => { const fs1 = jest.requireActual('fs'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const Union = require('unionfs').Union; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const vol = require('memfs').vol; const memfs = new Union().use(fs1).use(vol as unknown as typeof fs); memfs.realpath = fs1.realpath; @@ -20,7 +20,7 @@ jest.mock('fs', () => { jest.mock('@sap/mta-lib', () => { return { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports Mta: require('./mockMta').MockMta }; }); diff --git a/packages/cf-deploy-config-writer/test/unit/mtaext.test.ts b/packages/cf-deploy-config-writer/test/unit/mtaext.test.ts index 03025332fdc..22f2149a2a1 100644 --- a/packages/cf-deploy-config-writer/test/unit/mtaext.test.ts +++ b/packages/cf-deploy-config-writer/test/unit/mtaext.test.ts @@ -6,9 +6,9 @@ import { FileName } from '@sap-ux/project-access'; jest.mock('fs', () => { const fs1 = jest.requireActual('fs'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const Union = require('unionfs').Union; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const vol = require('memfs').vol; const memfs = new Union().use(fs1).use(vol as unknown as typeof fs); memfs.realpath = fs1.realpath; @@ -18,7 +18,7 @@ jest.mock('fs', () => { jest.mock('@sap/mta-lib', () => { return { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports Mta: require('./mockMta').MockMta }; }); diff --git a/packages/control-property-editor-common/.eslintignore b/packages/control-property-editor-common/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/control-property-editor-common/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/control-property-editor-common/.eslintrc.js b/packages/control-property-editor-common/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/control-property-editor-common/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/control-property-editor-common/eslint.config.js b/packages/control-property-editor-common/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/control-property-editor-common/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/control-property-editor/.eslintignore b/packages/control-property-editor/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/control-property-editor/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/control-property-editor/.eslintrc.js b/packages/control-property-editor/.eslintrc.js deleted file mode 100644 index fc55b1d63bc..00000000000 --- a/packages/control-property-editor/.eslintrc.js +++ /dev/null @@ -1,16 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc', 'plugin:react/recommended'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - // switched off temporarily until logger for webapps - 'no-console': 'off' - }, - settings: { - 'react': { - 'version': 'detect' - } - } -}; diff --git a/packages/control-property-editor/eslint.config.js b/packages/control-property-editor/eslint.config.js new file mode 100644 index 00000000000..990f97034ea --- /dev/null +++ b/packages/control-property-editor/eslint.config.js @@ -0,0 +1,22 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + rules: { + // switched off temporarily until logger for webapps + 'no-console': 'off' + }, + settings: { + 'react': { + 'version': 'detect' + } + } + }, +]; \ No newline at end of file diff --git a/packages/control-property-editor/package.json b/packages/control-property-editor/package.json index d73830df455..09052cfd5e6 100644 --- a/packages/control-property-editor/package.json +++ b/packages/control-property-editor/package.json @@ -20,8 +20,8 @@ "watch:webapp": "node esbuild.js --watch --minify=false", "test": "jest --maxWorkers=1 --ci --forceExit --detectOpenHandles", "test:debug": "node --inspect-brk node_modules/.bin/jest --runInBand --colors", - "lint": "eslint . --ext .ts,.tsx", - "lint:fix": "eslint . --ext .ts,.tsx --fix" + "lint": "eslint . ", + "lint:fix": "eslint . --fix" }, "devDependencies": { "@fluentui/react": "8.120.5", @@ -38,7 +38,7 @@ "@types/source-map-support": "0.5.0", "@types/react": "16.14.55", "body-parser": "1.20.3", - "eslint-plugin-react": "7.33.2", + "eslint-plugin-react": "7.37.4", "http-proxy-middleware": "2.0.9", "i18next": "25.3.0", "jest-scss-transform": "1.0.4", diff --git a/packages/control-property-editor/src/panels/outline/Tree.tsx b/packages/control-property-editor/src/panels/outline/Tree.tsx index d05ef2d3002..f61cc1c662d 100644 --- a/packages/control-property-editor/src/panels/outline/Tree.tsx +++ b/packages/control-property-editor/src/panels/outline/Tree.tsx @@ -281,7 +281,7 @@ export const Tree = (): ReactElement => { disabled: isNavigationMode ? true : !child.enabled, title: isNavigationMode ? t('CONTEXT_MENU_ACTION_DISABLED_IN_NAVIGATION_MODE') - : child?.tooltip ?? child?.title, + : (child?.tooltip ?? child?.title), onClick(): void { if (isExtensionPoint) { dispatch(addExtensionPoint(showActionContextualMenu)); diff --git a/packages/control-property-editor/src/panels/properties/PropertyDocumentation.tsx b/packages/control-property-editor/src/panels/properties/PropertyDocumentation.tsx index fa0fade55b1..5fe6acd7da5 100644 --- a/packages/control-property-editor/src/panels/properties/PropertyDocumentation.tsx +++ b/packages/control-property-editor/src/panels/properties/PropertyDocumentation.tsx @@ -23,7 +23,7 @@ export interface PropertyDocumentationProps { * * @param controlId - The ID of the control. * @param propertyName - The name of the property. - * @param propertyName - The filename of the saved property. + * @param fileName - The filename of the saved property. */ onDelete?(controlId: string, propertyName: string, fileName?: string): void; } diff --git a/packages/control-property-editor/src/use-local-storage.ts b/packages/control-property-editor/src/use-local-storage.ts index ed0530c7f27..45610d310ab 100644 --- a/packages/control-property-editor/src/use-local-storage.ts +++ b/packages/control-property-editor/src/use-local-storage.ts @@ -27,7 +27,7 @@ export function useLocalStorage(key: string, defaultValue: T): [T, React.Disp try { return JSON.parse(savedValue); - } catch (e) { + } catch { return defaultValue; } }); diff --git a/packages/control-property-editor/test/unit/utils.tsx b/packages/control-property-editor/test/unit/utils.tsx index 4195a1771d3..a2ebca6762a 100644 --- a/packages/control-property-editor/test/unit/utils.tsx +++ b/packages/control-property-editor/test/unit/utils.tsx @@ -7,8 +7,7 @@ import type { RenderOptions, RenderResult } from '@testing-library/react'; import { render as rtlRender } from '@testing-library/react'; import { Provider } from 'react-redux'; -import { initialState } from '../../src/slice'; -import reducer from '../../src/slice'; +import reducer, { initialState } from '../../src/slice'; export type State = ReturnType; @@ -25,6 +24,7 @@ export function render( ...renderOptions }: Options> = {} ): RenderResult & { store: Store; dispatch: jest.SpyInstance } { + // eslint-disable-next-line @typescript-eslint/no-empty-object-type function Wrapper({ children }: PropsWithChildren<{}>): ReactElement { return {children}; } @@ -37,16 +37,19 @@ export function render( export interface DOMEventListenerMock { simulateEvent: (name: string, value: object) => void; cleanDomEventListeners: () => void; + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type domEventListeners: { [k: string]: Array }; } export const mockDomEventListener = (handler: Document | Window | Element = document): DOMEventListenerMock => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type const domEventListeners: { [k: string]: Array } = {}; // Mock for add event listener handler.addEventListener = jest.fn((event, cb) => { if (!domEventListeners[event]) { domEventListeners[event] = []; } + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type domEventListeners[event].push(cb as Function); }); handler.removeEventListener = jest.fn((event, cb) => { diff --git a/packages/create/.eslintignore b/packages/create/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/packages/create/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/packages/create/.eslintrc.js b/packages/create/.eslintrc.js deleted file mode 100644 index 4c3643f305a..00000000000 --- a/packages/create/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - 'no-console': 'off' - } -}; diff --git a/packages/create/eslint.config.js b/packages/create/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/create/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/create/src/common/prompts.ts b/packages/create/src/common/prompts.ts index 0853c0a58ea..fbc4e8febb2 100644 --- a/packages/create/src/common/prompts.ts +++ b/packages/create/src/common/prompts.ts @@ -118,7 +118,7 @@ export async function convertQuestion( name: question.name, message: await extractMessage(question, answers), validate: async (value: unknown) => - isFunction(question.validate) ? await question.validate(value, answers) : question.validate ?? true, + isFunction(question.validate) ? await question.validate(value, answers) : (question.validate ?? true), initial: () => (isFunction(question.default) ? question.default(answers) : question.default) }; if (question.choices || question.source) { diff --git a/packages/deploy-config-generator-shared/.eslintignore b/packages/deploy-config-generator-shared/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/packages/deploy-config-generator-shared/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/packages/deploy-config-generator-shared/.eslintrc.js b/packages/deploy-config-generator-shared/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/deploy-config-generator-shared/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/deploy-config-generator-shared/eslint.config.js b/packages/deploy-config-generator-shared/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/deploy-config-generator-shared/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/deploy-config-sub-generator/.eslintignore b/packages/deploy-config-sub-generator/.eslintignore deleted file mode 100644 index 2705234da53..00000000000 --- a/packages/deploy-config-sub-generator/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -generators diff --git a/packages/deploy-config-sub-generator/.eslintrc.js b/packages/deploy-config-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/deploy-config-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/deploy-config-sub-generator/eslint.config.js b/packages/deploy-config-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/deploy-config-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/deploy-config-sub-generator/test/app/app.test.ts b/packages/deploy-config-sub-generator/test/app/app.test.ts index e018550f8ca..0fd73d092c6 100644 --- a/packages/deploy-config-sub-generator/test/app/app.test.ts +++ b/packages/deploy-config-sub-generator/test/app/app.test.ts @@ -20,9 +20,9 @@ jest.mock('fs', () => ({ jest.mock('fs', () => { const fsLib = jest.requireActual('fs'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const Union = require('unionfs').Union; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports, @typescript-eslint/no-unsafe-assignment const vol = require('memfs').vol; const _fs = new Union().use(fsLib); _fs.constants = fsLib.constants; diff --git a/packages/deploy-config-sub-generator/test/headless/abap-headless.test.ts b/packages/deploy-config-sub-generator/test/headless/abap-headless.test.ts index 5ea776748dc..f8315ffb9ea 100644 --- a/packages/deploy-config-sub-generator/test/headless/abap-headless.test.ts +++ b/packages/deploy-config-sub-generator/test/headless/abap-headless.test.ts @@ -64,7 +64,7 @@ describe('Test ABAP headless generator', () => { beforeEach(() => { jest.resetAllMocks(); - spawnMock = jest.spyOn(childProcess, 'spawnSync').mockImplementation(() => ({ status: 0 } as any)); + spawnMock = jest.spyOn(childProcess, 'spawnSync').mockImplementation(() => ({ status: 0 }) as any); }); afterEach(() => { process.chdir(ORIGINAL_CWD); diff --git a/packages/deploy-config-sub-generator/test/headless/cf-headless.test.ts b/packages/deploy-config-sub-generator/test/headless/cf-headless.test.ts index 13ed43e7832..6db0b199cc6 100644 --- a/packages/deploy-config-sub-generator/test/headless/cf-headless.test.ts +++ b/packages/deploy-config-sub-generator/test/headless/cf-headless.test.ts @@ -7,7 +7,8 @@ import { readFile, rename } from 'fs/promises'; import { rimraf } from 'rimraf'; import { basename, join } from 'node:path'; import CFGen from '@sap-ux/cf-deploy-config-sub-generator'; -import { DeployTarget, type TelemetryHelper, hostEnvironment } from '@sap-ux/fiori-generator-shared'; +import { hostEnvironment, DeployTarget } from '@sap-ux/fiori-generator-shared'; +import type { AppConfig, TelemetryHelper } from '@sap-ux/fiori-generator-shared'; import { INPUT_APP_DIR_CF, INPUT_APP_NAME_BASE, @@ -23,7 +24,6 @@ import { import { runHeadlessGen } from './utils'; import Generator from 'yeoman-generator'; import { generatorNamespace, initI18n } from '../../src/utils'; -import type { AppConfig } from '@sap-ux/fiori-generator-shared'; expect.extend({ toMatchFolder }); @@ -43,7 +43,7 @@ jest.mock('@sap-ux/fiori-generator-shared', () => { jest.mock('@sap/mta-lib', () => { return { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports Mta: require('./mockMta').MockMta }; }); @@ -73,7 +73,7 @@ describe('Test headless generator', () => { }); beforeEach(() => { - spawnMock = jest.spyOn(childProcess, 'spawnSync').mockImplementation(() => ({ status: 0 } as any)); + spawnMock = jest.spyOn(childProcess, 'spawnSync').mockImplementation(() => ({ status: 0 }) as any); }); afterEach(() => { diff --git a/packages/deploy-tooling/.eslintignore b/packages/deploy-tooling/.eslintignore deleted file mode 100644 index cc1f8e004cc..00000000000 --- a/packages/deploy-tooling/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test/fixtures -dist diff --git a/packages/deploy-tooling/.eslintrc.js b/packages/deploy-tooling/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/deploy-tooling/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/deploy-tooling/eslint.config.js b/packages/deploy-tooling/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/deploy-tooling/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/deploy-tooling/src/ui5/archive.ts b/packages/deploy-tooling/src/ui5/archive.ts index bcc1232cf72..ab257c8bcf8 100644 --- a/packages/deploy-tooling/src/ui5/archive.ts +++ b/packages/deploy-tooling/src/ui5/archive.ts @@ -1,5 +1,6 @@ import ZipFile from 'adm-zip'; import type { ToolsLogger } from '@sap-ux/logger'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { DuplexCollection } from '@ui5/fs'; /** diff --git a/packages/deploy-tooling/src/ui5/index.ts b/packages/deploy-tooling/src/ui5/index.ts index ba02a9b90eb..3e1154fb5e7 100644 --- a/packages/deploy-tooling/src/ui5/index.ts +++ b/packages/deploy-tooling/src/ui5/index.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { TaskParameters } from '@ui5/builder'; import { LogLevel, ToolsLogger, UI5ToolingTransport } from '@sap-ux/logger'; import type { AbapDeployConfig } from '../types'; diff --git a/packages/deploy-tooling/test/fixtures/adp/webapp/changes/coding/share.js b/packages/deploy-tooling/test/fixtures/adp/webapp/changes/coding/share.js index 9aff5e2b135..fefe068d3f3 100644 --- a/packages/deploy-tooling/test/fixtures/adp/webapp/changes/coding/share.js +++ b/packages/deploy-tooling/test/fixtures/adp/webapp/changes/coding/share.js @@ -1,15 +1,8 @@ -sap.ui.define( - [ - "sap/ui/core/mvc/ControllerExtension", - ], - function ( - ControllerExtension - ) { - "use strict"; - return ControllerExtension.extend("adp.example.share", { - onBtnPress: function () { - sap.m.MessageToast.show("Button pressed!"); - } +sap.ui.define(['sap/ui/core/mvc/ControllerExtension'], function (ControllerExtension) { + 'use strict'; + return ControllerExtension.extend('adp.example.share', { + onBtnPress: function () { + sap.m.MessageToast.show('Button pressed!'); + } }); - } -); +}); diff --git a/packages/deploy-tooling/test/fixtures/simple-app/webapp/ext/MyCustomPage.controller.ts b/packages/deploy-tooling/test/fixtures/simple-app/webapp/ext/MyCustomPage.controller.ts index 30135593cda..5593e28c729 100644 --- a/packages/deploy-tooling/test/fixtures/simple-app/webapp/ext/MyCustomPage.controller.ts +++ b/packages/deploy-tooling/test/fixtures/simple-app/webapp/ext/MyCustomPage.controller.ts @@ -4,39 +4,39 @@ import Controller from 'sap/fe/core/PageController'; * @namespace v4travel.ext.myCustomPage.MyCustomPage.controller */ export default class MyCustomPage extends Controller { - /** * Called when a controller is instantiated and its View controls (if available) are already created. * Can be used to modify the View before it is displayed, to bind event handlers and do other one-time initialization. + * * @memberOf v4travel.ext.myCustomPage.MyCustomPage */ // public onInit(): void { // //} - /** * Similar to onAfterRendering, but this hook is invoked before the controller's View is re-rendered * (NOT before the first rendering! onInit() is used for that one!). + * * @memberOf v4travel.ext.myCustomPage.MyCustomPage */ // public onBeforeRendering(): void { // // }, - /** * Called when the View has been rendered (so its HTML is part of the document). Post-rendering manipulations of the HTML could be done here. * This hook is the same one that SAPUI5 controls get after being rendered. + * * @memberOf v4travel.ext.myCustomPage.MyCustomPage */ // public onAfterRendering(): void { // // }, - /** * Called when the Controller is destroyed. Use this one to free resources and finalize activities. + * * @memberOf v4travel.ext.myCustomPage.MyCustomPage */ // public onExit(): void { // // } -} \ No newline at end of file +} diff --git a/packages/deploy-tooling/test/unit/cli/archive.test.ts b/packages/deploy-tooling/test/unit/cli/archive.test.ts index 09a47aa22ac..787c4563ca1 100644 --- a/packages/deploy-tooling/test/unit/cli/archive.test.ts +++ b/packages/deploy-tooling/test/unit/cli/archive.test.ts @@ -3,6 +3,7 @@ import { join, relative } from 'node:path'; import { getArchive } from '../../../src/cli/archive'; import { createUi5Archive } from '../../../src/ui5/archive'; import axios from 'axios'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { Resource } from '@ui5/fs'; import AdmZip from 'adm-zip'; import { existsSync } from 'node:fs'; diff --git a/packages/environment-check/.eslintignore b/packages/environment-check/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/packages/environment-check/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/packages/environment-check/.eslintrc.js b/packages/environment-check/.eslintrc.js deleted file mode 100644 index 4c3643f305a..00000000000 --- a/packages/environment-check/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - 'no-console': 'off' - } -}; diff --git a/packages/environment-check/eslint.config.js b/packages/environment-check/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/environment-check/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/environment-check/src/checks/stored-system.ts b/packages/environment-check/src/checks/stored-system.ts index 60cc2303bbc..03f86566307 100644 --- a/packages/environment-check/src/checks/stored-system.ts +++ b/packages/environment-check/src/checks/stored-system.ts @@ -56,15 +56,13 @@ export async function checkStoredSystem(storedSystem: Endpoint): Promise<{ logger.push(...atoMsgs); // sap ui5 repo request - const { messages: sapUI5RepoMsgs, isSapUi5Repo: isSapUi5RepoResult } = await checkUi5AbapRepository( - abapServiceProvider - ); + const { messages: sapUI5RepoMsgs, isSapUi5Repo: isSapUi5RepoResult } = + await checkUi5AbapRepository(abapServiceProvider); logger.push(...sapUI5RepoMsgs); // check for transport requests - const { messages: transportReqMsgs, isTransportRequests: isTransportRequestsResult } = await checkTransportRequests( - abapServiceProvider - ); + const { messages: transportReqMsgs, isTransportRequests: isTransportRequestsResult } = + await checkTransportRequests(abapServiceProvider); logger.push(...transportReqMsgs); const storedSystemResults: EndpointResults = { diff --git a/packages/environment-check/test/output/zip.test.ts b/packages/environment-check/test/output/zip.test.ts index 69964295bbd..b2e05315e1c 100644 --- a/packages/environment-check/test/output/zip.test.ts +++ b/packages/environment-check/test/output/zip.test.ts @@ -99,7 +99,7 @@ describe('Test to check zip save, storeResultsZip()', () => { () => ({ on: jest.fn() - } as unknown as mockFs.WriteStream & { on: jest.Mock }) + }) as unknown as mockFs.WriteStream & { on: jest.Mock } ); // Test execution @@ -130,7 +130,7 @@ describe('Test to check zip save, storeResultsZip()', () => { () => ({ on: jest.fn() - } as unknown as mockFs.WriteStream & { on: jest.Mock }) + }) as unknown as mockFs.WriteStream & { on: jest.Mock } ); // Test execution diff --git a/packages/eslint-plugin-fiori-tools/.eslintignore b/packages/eslint-plugin-fiori-tools/.eslintignore deleted file mode 100644 index b48642e83df..00000000000 --- a/packages/eslint-plugin-fiori-tools/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -dist -lib - -.eslintrc*.js \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/.eslintrc.js b/packages/eslint-plugin-fiori-tools/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/eslint-plugin-fiori-tools/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-common.js b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-common.js new file mode 100644 index 00000000000..f2817d33fe2 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-common.js @@ -0,0 +1,14 @@ +const { defineConfig } = require('eslint/config'); + +const globals = require('globals'); + +module.exports = defineConfig([ + { + languageOptions: { + globals: { + ...globals.browser, + ...globals.node + } + } + } +]); diff --git a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js new file mode 100644 index 00000000000..2bfd158e89a --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js @@ -0,0 +1,38 @@ +const { defineConfig } = require('eslint/config'); + +const fioriCustom = require('eslint-plugin-fiori-custom'); +const js = require('@eslint/js'); + +const { FlatCompat } = require('@eslint/eslintrc'); + +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +module.exports = defineConfig([ + { + files: ['./webapp/**/*.js', './webapp/**/*.ts'], + + ignores: [ + 'target/**', + 'webapp/test/**', + 'webapp/localservice/**', + 'backup/**', + '**/Gruntfile.js', + '**/changes_preview.js', + '**/changes_preview.ts', + '**/gulpfile.js', + '**/*.d.ts', + '**/*.d.ts', + 'test/**' + ], + + extends: compat.extends('eslint:recommended', 'plugin:fiori-custom/fioriToolsDefault'), + + plugins: { + 'fiori-custom': fioriCustom + } + } +]); diff --git a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js new file mode 100644 index 00000000000..d2a97087932 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js @@ -0,0 +1,26 @@ +const { + defineConfig, +} = require("eslint/config"); + +const fioriCustom = require("eslint-plugin-fiori-custom"); +const js = require("@eslint/js"); + +const { + FlatCompat, +} = require("@eslint/eslintrc"); + +const compat = new FlatCompat({ + baseDirectory: __dirname, + recommendedConfig: js.configs.recommended, + allConfig: js.configs.all +}); + +module.exports = defineConfig([{ + files: ["webapp/test/**/*.js", "webapp/test/**/*.ts"], + ignores: ["**/*.d.ts", "**/*.d.ts"], + extends: compat.extends("plugin:fiori-custom/fioriToolsTestcode"), + + plugins: { + "fiori-custom": fioriCustom, + }, +}]); \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-typescript.js b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-typescript.js new file mode 100644 index 00000000000..de75cfa6366 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-typescript.js @@ -0,0 +1,51 @@ +const { + defineConfig, +} = require("eslint/config"); + +const typescriptEslint = require("@typescript-eslint/eslint-plugin"); +const tsParser = require("@typescript-eslint/parser"); +const js = require("@eslint/js"); +const tseslint = require('typescript-eslint'); + + + +module.exports = defineConfig([ + ...tseslint.configs.recommended, + ...tseslint.configs.recommended_requiring_type_checking, + { + files: ["./webapp/*.ts", "./webapp/**/*.ts"], + + ignores: [ + "target/**", + "webapp/test/changes_loader.ts", + "webapp/test/changes_preview.ts", + "webapp/localservice/**", + "webapp/localService/**", + "undefined/**/Example.qunit.ts", + "backup/**", + "**/*.d.ts", + "**/*.d.ts", + ], + + plugins: { + "@typescript-eslint": typescriptEslint, + }, + + languageOptions: { + parser: tsParser, + ecmaVersion: 5, + sourceType: "script", + + parserOptions: { + project: true, + }, + }, + + rules: { + "@typescript-eslint/no-unsafe-call": "warn", + "@typescript-eslint/no-unsafe-member-access": "warn", + "@typescript-eslint/no-unsafe-return": "warn", + "@typescript-eslint/no-unsafe-argument": "warn", + "@typescript-eslint/no-unsafe-assignment": "warn", + }, +}]); \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/eslintrc-common.js b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-common.js similarity index 100% rename from packages/eslint-plugin-fiori-tools/eslintrc-common.js rename to packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-common.js diff --git a/packages/eslint-plugin-fiori-tools/eslintrc-prod.js b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-prod.js similarity index 93% rename from packages/eslint-plugin-fiori-tools/eslintrc-prod.js rename to packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-prod.js index 4b3a0260351..5a6df767435 100644 --- a/packages/eslint-plugin-fiori-tools/eslintrc-prod.js +++ b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-prod.js @@ -1,5 +1,5 @@ 'use strict'; -const { getResourcePaths } = require('./lib/utils'); +const { getResourcePaths } = require('../../lib/utils'); const { sourceCodePath, testCodePath } = getResourcePaths(); const overrides = [ { diff --git a/packages/eslint-plugin-fiori-tools/eslintrc-test.js b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-test.js similarity index 90% rename from packages/eslint-plugin-fiori-tools/eslintrc-test.js rename to packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-test.js index d38a4eb5f8a..cfbf9bc41bd 100644 --- a/packages/eslint-plugin-fiori-tools/eslintrc-test.js +++ b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-test.js @@ -1,5 +1,5 @@ 'use strict'; -const { getResourcePaths } = require('./lib/utils'); +const { getResourcePaths } = require('../../lib/utils'); const { sourceCodePath, testCodePath } = getResourcePaths(); module.exports = { overrides: [ diff --git a/packages/eslint-plugin-fiori-tools/eslintrc-typescript.js b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-typescript.js similarity index 95% rename from packages/eslint-plugin-fiori-tools/eslintrc-typescript.js rename to packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-typescript.js index ae0aef0574f..a4289d77a33 100644 --- a/packages/eslint-plugin-fiori-tools/eslintrc-typescript.js +++ b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-typescript.js @@ -1,5 +1,5 @@ 'use strict'; -const { getResourcePaths } = require('./lib/utils'); +const { getResourcePaths } = require('../../lib/utils'); const { sourceCodePath, testCodePath } = getResourcePaths(); const overrides = [ { @@ -14,6 +14,7 @@ const overrides = [ `${testCodePath}/**/Example.qunit.ts`, 'backup/**', '*.d.ts', + '**/*.d.ts' ], 'parser': '@typescript-eslint/parser', diff --git a/packages/eslint-plugin-fiori-tools/eslint.config.js b/packages/eslint-plugin-fiori-tools/eslint.config.js new file mode 100644 index 00000000000..029e264af06 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/eslint.config.js @@ -0,0 +1,21 @@ +const { rules } = require('eslint-plugin-fiori-custom'); +const base = require('../../eslint.config.js'); + +module.exports = [ + { + ignores: ['config/**/eslintrc*.js'] + }, + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json' + } + }, + rules: { + '@typescript-eslint/no-require-imports': 'warn' + } + } +]; diff --git a/packages/eslint-plugin-fiori-tools/package.json b/packages/eslint-plugin-fiori-tools/package.json index c7a1282e773..f93a2c3fb32 100644 --- a/packages/eslint-plugin-fiori-tools/package.json +++ b/packages/eslint-plugin-fiori-tools/package.json @@ -17,16 +17,17 @@ "test": "jest --ci --forceExit --detectOpenHandles --colors" }, "devDependencies": { - "eslint": "8.57.0" + "eslint": "^9" }, "dependencies": { + "@eslint/eslintrc": "^3.3.1", + "@eslint/js": "^9", "eslint-plugin-fiori-custom": "^2.6.7", "yaml": "2.2.2" }, "peerDependencies": { - "eslint": ">=8", - "@typescript-eslint/eslint-plugin": ">=7.1.1", - "@typescript-eslint/parser": ">=5.62.0" + "eslint": "^9", + "typescript-eslint": "^8.46.2" }, "engines": { "node": ">=20.x" diff --git a/packages/eslint-plugin-fiori-tools/src/index.ts b/packages/eslint-plugin-fiori-tools/src/index.ts index ecbd563f425..edf553e949b 100644 --- a/packages/eslint-plugin-fiori-tools/src/index.ts +++ b/packages/eslint-plugin-fiori-tools/src/index.ts @@ -2,18 +2,67 @@ // Plugin Definition //------------------------------------------------------------------------------ -module.exports.configs = { +export const config = { defaultTS: { - extends: ['../eslintrc-common.js', '../eslintrc-typescript.js', '../eslintrc-prod.js', '../eslintrc-test.js'], + extends: [ + '../config/legacy/eslintrc-common.js', + '../config/legacy/eslintrc-typescript.js', + '../config/legacy/eslintrc-prod.js', + '../config/legacy/eslintrc-test.js' + ], parser: '@typescript-eslint/parser' // override parser used in eslint-plugin-fiori-custom to support TS }, defaultJS: { - extends: ['../eslintrc-common.js', '../eslintrc-prod.js', '../eslintrc-test.js'] + extends: [ + '../config/legacy/eslintrc-common.js', + '../config/legacy/eslintrc-prod.js', + '../config/legacy/eslintrc-test.js' + ] }, testCode: { - extends: ['../eslintrc-common.js', '../eslintrc-typescript.js', '../eslintrc-test.js'] + extends: [ + '../config/legacy/eslintrc-common.js', + '../config/legacy/eslintrc-typescript.js', + '../config/legacy/eslintrc-test.js' + ] }, prodCode: { - extends: ['../eslintrc-common.js', '../eslintrc-typescript.js', '../eslintrc-prod.js'] + extends: [ + '../config/legacy/eslintrc-common.js', + '../config/legacy/eslintrc-typescript.js', + '../config/legacy/eslintrc-prod.js' + ] + }, + flat: { + defaultTS: { + extends: [ + '../config/flat/eslintrc-common.js', + '../config/flat/eslintrc-typescript.js', + '../config/flat/eslintrc-prod.js', + '../config/flat/eslintrc-test.js' + ], + parser: '@typescript-eslint/parser' // override parser used in eslint-plugin-fiori-custom to support TS + }, + defaultJS: { + extends: [ + '../config/flat/eslintrc-common.js', + '../config/flat/eslintrc-prod.js', + '../config/flat/eslintrc-test.js' + ] + }, + testCode: { + extends: [ + '../config/flat/eslintrc-common.js', + '../config/flat/eslintrc-typescript.js', + '../config/flat/eslintrc-test.js' + ] + }, + prodCode: { + extends: [ + '../config/flat/eslintrc-common.js', + '../config/flat/eslintrc-typescript.js', + '../config/flat/eslintrc-prod.js' + ] + } } }; diff --git a/packages/eslint-plugin-fiori-tools/test/index.test.ts b/packages/eslint-plugin-fiori-tools/test/index.test.ts index 69b29de743b..9836e409ecd 100644 --- a/packages/eslint-plugin-fiori-tools/test/index.test.ts +++ b/packages/eslint-plugin-fiori-tools/test/index.test.ts @@ -36,7 +36,7 @@ describe('Tests for utils.ts', () => { }); test('configs', async () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const configs = require('../src/index'); expect(configs).toBeDefined(); }); diff --git a/packages/eslint-plugin-fiori-tools/tsconfig.json b/packages/eslint-plugin-fiori-tools/tsconfig.json index ae9565a30dd..1c5e24649de 100644 --- a/packages/eslint-plugin-fiori-tools/tsconfig.json +++ b/packages/eslint-plugin-fiori-tools/tsconfig.json @@ -2,7 +2,7 @@ "extends": "../../tsconfig.json", "include": [ "src" - ], +, "config/flat", "config/legacy" ], "compilerOptions": { "rootDir": "src", "outDir": "lib" diff --git a/packages/fe-fpm-writer/.eslintignore b/packages/fe-fpm-writer/.eslintignore deleted file mode 100644 index 2b81aee6d5c..00000000000 --- a/packages/fe-fpm-writer/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -test/test-output -test/test-input -dist -templates \ No newline at end of file diff --git a/packages/fe-fpm-writer/.eslintrc.js b/packages/fe-fpm-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/fe-fpm-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/fe-fpm-writer/eslint.config.js b/packages/fe-fpm-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/fe-fpm-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/fe-fpm-writer/src/building-block/prompts/utils/service.ts b/packages/fe-fpm-writer/src/building-block/prompts/utils/service.ts index 0e8a847c531..ab6497566b6 100644 --- a/packages/fe-fpm-writer/src/building-block/prompts/utils/service.ts +++ b/packages/fe-fpm-writer/src/building-block/prompts/utils/service.ts @@ -190,11 +190,7 @@ function getAnnotationPathQualifiersForEntityType( addAnnotationPathQualifierToResult(entityType, '', annotationTerms, result, useNamespace); } else if (bindingContext.type === 'relative') { entityType.navigationProperties.forEach((navigationProperty) => { - if ( - navigationProperty.targetType && - navigationProperty.targetType._type === 'EntityType' && - navigationProperty.name !== 'SiblingEntity' - ) { + if (navigationProperty.targetType?._type === 'EntityType' && navigationProperty.name !== 'SiblingEntity') { if (!bindingContext.isCollection || (bindingContext.isCollection && navigationProperty.isCollection)) { addAnnotationPathQualifierToResult( navigationProperty.targetType, diff --git a/packages/fe-fpm-writer/src/building-block/prompts/utils/xml.ts b/packages/fe-fpm-writer/src/building-block/prompts/utils/xml.ts index d6887e96cd9..f4546284467 100644 --- a/packages/fe-fpm-writer/src/building-block/prompts/utils/xml.ts +++ b/packages/fe-fpm-writer/src/building-block/prompts/utils/xml.ts @@ -117,6 +117,8 @@ export async function getFilterBarIdsInFile(viewOrFragmentPath: string, fs: Edit const elements = Array.from(xmlDocument.getElementsByTagName(buildingBlockSelector)); for (const element of elements) { const id = element.getAttributeNode('id')?.value; + // Todo check this logic below. + // eslint-disable-next-line @typescript-eslint/no-unused-expressions id && ids.push(id); } return ids; diff --git a/packages/fe-fpm-writer/src/prompts/api.ts b/packages/fe-fpm-writer/src/prompts/api.ts index 7309587fb35..297cebc1a7e 100644 --- a/packages/fe-fpm-writer/src/prompts/api.ts +++ b/packages/fe-fpm-writer/src/prompts/api.ts @@ -107,7 +107,7 @@ export class PromptsAPI { try { const prompt = this.cache[type] ?? (await this.getPrompts(type)); const question = prompt.questions.find((question) => question.name === fieldName); - if (question && question.type === 'list') { + if (question?.type === 'list') { const choices = typeof question.choices === 'function' ? await question.choices(answers) : question.choices; return choices ?? []; diff --git a/packages/fe-fpm-writer/src/prompts/types.ts b/packages/fe-fpm-writer/src/prompts/types.ts index d23d0d0227d..5588f3ac962 100644 --- a/packages/fe-fpm-writer/src/prompts/types.ts +++ b/packages/fe-fpm-writer/src/prompts/types.ts @@ -47,10 +47,10 @@ export type Subset = { [attr in keyof K]?: K[attr] extends object ? Subset : K[attr] extends object | null - ? Subset | null - : K[attr] extends object | null | undefined - ? Subset | null | undefined - : K[attr]; + ? Subset | null + : K[attr] extends object | null | undefined + ? Subset | null | undefined + : K[attr]; }; export type WithRequired = T & { [P in K]-?: T[P] }; diff --git a/packages/fe-fpm-writer/test/test-input/integration/basic-lrop-app/ts/package.json b/packages/fe-fpm-writer/test/test-input/integration/basic-lrop-app/ts/package.json index 62f9449ed0b..3c0ad2bc393 100644 --- a/packages/fe-fpm-writer/test/test-input/integration/basic-lrop-app/ts/package.json +++ b/packages/fe-fpm-writer/test/test-input/integration/basic-lrop-app/ts/package.json @@ -18,8 +18,8 @@ "@sapui5/ts-types-esm": "1.106.0", "ui5-tooling-transpile": "^0.7.10", "typescript": "^4.6.3", - "@typescript-eslint/eslint-plugin": "^5.59.0", - "@typescript-eslint/parser": "^5.59.0" + "@typescript-eslint/eslint-plugin": "^8.27.0", + "@typescript-eslint/parser": "^8.27.0" }, "scripts": { "start": "ui5 serve --config=ui5.yaml --open index.html", diff --git a/packages/fe-fpm-writer/test/test-input/integration/custom-page-app/ts/package.json b/packages/fe-fpm-writer/test/test-input/integration/custom-page-app/ts/package.json index 80a3b883f90..d7e388457d9 100644 --- a/packages/fe-fpm-writer/test/test-input/integration/custom-page-app/ts/package.json +++ b/packages/fe-fpm-writer/test/test-input/integration/custom-page-app/ts/package.json @@ -17,8 +17,8 @@ "@sapui5/ts-types-esm": "~1.108.0", "ui5-tooling-transpile": "^0.7.8", "typescript": "^4.6.3", - "@typescript-eslint/eslint-plugin": "^5.59.0", - "@typescript-eslint/parser": "^5.59.0", + "@typescript-eslint/eslint-plugin": "^8.27.0", + "@typescript-eslint/parser": "^8.27.0", "@sap-ux/eslint-plugin-fiori-tools": "^0.1.0", "@sap-ux/ui5-middleware-fe-mockserver": "2" }, diff --git a/packages/fe-fpm-writer/test/unit/building-block/prompts/utils/questions.test.ts b/packages/fe-fpm-writer/test/unit/building-block/prompts/utils/questions.test.ts index 5a843730138..5d7ae1c7bda 100644 --- a/packages/fe-fpm-writer/test/unit/building-block/prompts/utils/questions.test.ts +++ b/packages/fe-fpm-writer/test/unit/building-block/prompts/utils/questions.test.ts @@ -33,7 +33,7 @@ type Choices = (answers?: Answers) => Promise ({ __esModule: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ...(jest.requireActual('@sap-ux/project-access') as object), getCapModelAndServices: jest.fn().mockResolvedValue({ model: {}, diff --git a/packages/fe-fpm-writer/test/unit/building-block/prompts/utils/service.test.ts b/packages/fe-fpm-writer/test/unit/building-block/prompts/utils/service.test.ts index 39c7ac3116e..fc2157c5239 100644 --- a/packages/fe-fpm-writer/test/unit/building-block/prompts/utils/service.test.ts +++ b/packages/fe-fpm-writer/test/unit/building-block/prompts/utils/service.test.ts @@ -18,7 +18,7 @@ const ENTITY_SET = 'C_CustomerOP'; jest.mock('@sap-ux/project-access', () => ({ __esModule: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ...(jest.requireActual('@sap-ux/project-access') as object), getCapModelAndServices: jest.fn().mockResolvedValue({ model: {}, diff --git a/packages/fe-fpm-writer/test/unit/header-section.test.ts b/packages/fe-fpm-writer/test/unit/header-section.test.ts index 2d6e8f71f0a..3bb8796bc6f 100644 --- a/packages/fe-fpm-writer/test/unit/header-section.test.ts +++ b/packages/fe-fpm-writer/test/unit/header-section.test.ts @@ -3,8 +3,8 @@ import { create } from 'mem-fs-editor'; import { create as createStorage } from 'mem-fs'; import { join } from 'node:path'; import { generateCustomHeaderSection } from '../../src/section'; -import type { HeaderSectionEditProperty } from '../../src/section/types'; -import { RequestGroupId, type CustomHeaderSection, DesignTime } from '../../src/section/types'; +import { RequestGroupId, DesignTime } from '../../src/section/types'; +import type { HeaderSectionEditProperty, CustomHeaderSection } from '../../src/section/types'; import type { Manifest } from '../../src/common/types'; import { Placement } from '../../src/common/types'; import * as manifestSections from './sample/section/webapp/manifest.json'; diff --git a/packages/feature-toggle/.eslintignore b/packages/feature-toggle/.eslintignore deleted file mode 100644 index be3f0c7e2b0..00000000000 --- a/packages/feature-toggle/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -test \ No newline at end of file diff --git a/packages/feature-toggle/.eslintrc.js b/packages/feature-toggle/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/feature-toggle/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/feature-toggle/eslint.config.js b/packages/feature-toggle/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/feature-toggle/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/feature-toggle/src/featureToggle.ts b/packages/feature-toggle/src/featureToggle.ts index 97dd0ec0191..a5202b9ccc2 100644 --- a/packages/feature-toggle/src/featureToggle.ts +++ b/packages/feature-toggle/src/featureToggle.ts @@ -103,6 +103,7 @@ export class FeatureToggleAccess { function getVSCodeInstance(): any { let vscode; try { + // eslint-disable-next-line @typescript-eslint/no-require-imports vscode = require('vscode'); } catch { // Vscode not available. Normally in CLI diff --git a/packages/feature-toggle/tsconfig.eslint.json b/packages/feature-toggle/tsconfig.eslint.json index 95a2c92d082..d5f1aa34747 100644 --- a/packages/feature-toggle/tsconfig.eslint.json +++ b/packages/feature-toggle/tsconfig.eslint.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", - "include": ["src", ".eslintrc.js"] + "include": ["src", "test", ".eslintrc.js"] } diff --git a/packages/fiori-annotation-api/.eslintignore b/packages/fiori-annotation-api/.eslintignore deleted file mode 100644 index d07bf28d4aa..00000000000 --- a/packages/fiori-annotation-api/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -dist -out -reports -jest.setup.js \ No newline at end of file diff --git a/packages/fiori-annotation-api/.eslintrc.js b/packages/fiori-annotation-api/.eslintrc.js deleted file mode 100644 index 4e6154b16f1..00000000000 --- a/packages/fiori-annotation-api/.eslintrc.js +++ /dev/null @@ -1,29 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - overrides: [ - { - parser: '@typescript-eslint/parser', - files: ['src/**/*.ts'], - rules: { - 'jsdoc/require-jsdoc': [ - 'error', - { - 'publicOnly': true, - 'require': { - 'FunctionDeclaration': true, - 'MethodDefinition': true, - 'ClassDeclaration': true, - 'ArrowFunctionExpression': true, - 'FunctionExpression': true - }, - 'exemptEmptyFunctions': true - } - ] - } - } - ] -}; diff --git a/packages/fiori-annotation-api/eslint.config.js b/packages/fiori-annotation-api/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/fiori-annotation-api/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/fiori-annotation-api/src/avt/annotations.ts b/packages/fiori-annotation-api/src/avt/annotations.ts index 49aea960b4e..2ba2467ad04 100644 --- a/packages/fiori-annotation-api/src/avt/annotations.ts +++ b/packages/fiori-annotation-api/src/avt/annotations.ts @@ -95,7 +95,7 @@ export function convertAnnotationFile( const annotations: AnnotationListWithOrigins[] = []; const namespaceMap = getNamespaceMap(file.references); const namespace = - file.uri.startsWith(GHOST_FILENAME_PREFIX) || !file.namespace ? serviceName : file.namespace?.name ?? ''; + file.uri.startsWith(GHOST_FILENAME_PREFIX) || !file.namespace ? serviceName : (file.namespace?.name ?? ''); const alias = file.namespace?.alias ?? ''; Object.freeze(namespaceMap); @@ -147,6 +147,14 @@ export function convertAnnotationFile( // all of these values are flattened // There should not be duplicate values (last encountered will be used) +/** + * + * @param mergeMap + * @param targetPath + * @param sourcePath + * @param target + * @param source + */ function mergeAnnotation( mergeMap: Record, targetPath: string, @@ -172,6 +180,15 @@ function mergeAnnotation( } } +/** + * + * @param mergeMap + * @param targetPath + * @param sourcePath + * @param target + * @param source + * @param directTermValue + */ function mergeRecord( mergeMap: Record, targetPath: string, @@ -207,6 +224,17 @@ function mergeRecord( } } +/** + * + * @param mergeMap + * @param targetPath + * @param sourcePath + * @param target + * @param source + * @param mergedPaths + * @param propertyName + * @param offset + */ function mergeProperties( mergeMap: Record, targetPath: string, @@ -247,6 +275,14 @@ function mergeProperties( } } +/** + * + * @param mergeMap + * @param targetPath + * @param sourcePath + * @param target + * @param source + */ function mergeAnnotationAnnotations( mergeMap: Record, targetPath: string, @@ -284,6 +320,15 @@ function mergeAnnotationAnnotations( } } } +/** + * + * @param mergeMap + * @param targetPath + * @param sourcePath + * @param target + * @param source + * @param directTermValue + */ function mergeRecordAnnotations( mergeMap: Record, targetPath: string, @@ -324,6 +369,10 @@ function mergeRecordAnnotations( } } +/** + * + * @param references + */ function getNamespaceMap(references: Reference[]): NamespaceMap { const namespaceMap: NamespaceMap = {}; for (const reference of references) { @@ -341,6 +390,13 @@ type ConversionOptions = { mergeSplitAnnotations: boolean; mergeMap: Record; }; +/** + * + * @param namespaceMap + * @param currentNamespace + * @param annotationElement + * @param options + */ function convertAnnotation( namespaceMap: NamespaceMap, currentNamespace: string, @@ -393,6 +449,13 @@ function convertAnnotation( return annotation; } +/** + * + * @param namespaceMap + * @param currentNamespace + * @param element + * @param options + */ function convertEmbeddedAnnotations( namespaceMap: NamespaceMap, currentNamespace: string, @@ -421,6 +484,13 @@ const EXPRESSION_TYPES = new Set([ Edm.Null ]); +/** + * + * @param namespaceMap + * @param currentNamespace + * @param element + * @param options + */ function convertExpression( namespaceMap: NamespaceMap, currentNamespace: string, @@ -458,6 +528,13 @@ function convertExpression( return expressionValues[0]; } +/** + * + * @param namespaceMap + * @param currentNamespace + * @param name + * @param value + */ function createExpression( namespaceMap: NamespaceMap, currentNamespace: string, @@ -575,6 +652,13 @@ function convertExpressionValue( } } +/** + * + * @param namespaceMap + * @param currentNamespace + * @param recordElement + * @param options + */ function convertRecord( namespaceMap: NamespaceMap, currentNamespace: string, @@ -626,6 +710,13 @@ function convertRecord( return record; } +/** + * + * @param namespaceMap + * @param currentNamespace + * @param collectionElement + * @param options + */ function convertCollection( namespaceMap: NamespaceMap, currentNamespace: string, @@ -638,7 +729,7 @@ function convertCollection( .filter((child): child is Element => child.type === ELEMENT_TYPE) .forEach((collectionEntryElement: Element) => { const value = convertExpression(namespaceMap, currentNamespace, collectionEntryElement, options); - // eslint-disable-next-line @typescript-eslint/no-explicit-any + let entry = value as any; if (value && value.type) { // record and string can be used directly as collection entries @@ -656,6 +747,12 @@ function convertCollection( return { collection, collectionOrigins }; } +/** + * + * @param namespaceMap + * @param currentNamespace + * @param element + */ function convertApply(namespaceMap: NamespaceMap, currentNamespace: string, element: Element): ApplyExpression { // use internal representation (without alias) to represent Apply value const clone = structuredClone(element); @@ -668,6 +765,12 @@ function convertApply(namespaceMap: NamespaceMap, currentNamespace: string, elem }; } +/** + * + * @param namespaceMap + * @param currentNamespace + * @param element + */ function replaceAliasInElement(namespaceMap: NamespaceMap, currentNamespace: string, element: Element): Element { const result = element; // replace aliased in all attributes/sub nodes with full namespaces (reverse = true ? vice versa): @@ -696,6 +799,12 @@ function replaceAliasInElement(namespaceMap: NamespaceMap, currentNamespace: str return result; } +/** + * + * @param namespaceMap + * @param currentNamespace + * @param element + */ function replaceAliasInElementContent(namespaceMap: NamespaceMap, currentNamespace: string, element: Element) { for (const subNode of element.content || []) { if (subNode.type === ELEMENT_TYPE) { diff --git a/packages/fiori-annotation-api/src/avt/find.ts b/packages/fiori-annotation-api/src/avt/find.ts index 0987dfeb45c..b0f66ae7604 100644 --- a/packages/fiori-annotation-api/src/avt/find.ts +++ b/packages/fiori-annotation-api/src/avt/find.ts @@ -120,6 +120,14 @@ export function findAnnotationByReference( throw new ApiError(`Term '${path}' does not exist`, ApiErrorCode.General); } +/** + * + * @param file + * @param mergeMap + * @param id + * @param pointer + * @param valueType + */ function searchInMergedAnnotations( file: AnnotationFile, mergeMap: Record, @@ -153,6 +161,12 @@ function searchInMergedAnnotations( return undefined; } +/** + * + * @param namespaceMap + * @param currentNamespace + * @param path + */ function resolvePath(namespaceMap: NamespaceMap, currentNamespace: string, path: string): string { const parsedPath = parsePath(path); parsedPath.segments = parsedPath.segments.map((segment, i) => { diff --git a/packages/fiori-annotation-api/src/avt/metadata.ts b/packages/fiori-annotation-api/src/avt/metadata.ts index 3968a8080e2..e6aa7ad596d 100644 --- a/packages/fiori-annotation-api/src/avt/metadata.ts +++ b/packages/fiori-annotation-api/src/avt/metadata.ts @@ -76,6 +76,11 @@ class MetadataConverter { typeDefinitions: [] }; } + /** + * + * @param targetKinds + * @param element + */ private convertAction(targetKinds: string[], element: MetadataElement): void { if (!['Action', 'Function'].some((item) => targetKinds.includes(item))) { return; @@ -116,6 +121,12 @@ class MetadataConverter { this.actions.push(action); } + /** + * + * @param targetKinds + * @param element + * @param elementKey + */ private convertEntityContainer(targetKinds: string[], element: MetadataElement, elementKey: string): void { if (targetKinds.includes('EntityContainer')) { this.entityContainer = { @@ -133,6 +144,11 @@ class MetadataConverter { } } + /** + * + * @param targetKinds + * @param element + */ private convertFunctionImport(targetKinds: string[], element: MetadataElement): void { const oDataVersion = this.metadataService.ODataVersion; if (targetKinds.includes('FunctionImport') || targetKinds.includes('ActionImport')) { @@ -152,6 +168,11 @@ class MetadataConverter { } } + /** + * + * @param targetKinds + * @param element + */ private convertEntitySet(targetKinds: string[], element: MetadataElement): void { if (targetKinds.includes('EntitySet') && !targetKinds.includes('ComplexType')) { // for CDS no entity container is present: target kind EntitySet can appear at root level @@ -171,6 +192,11 @@ class MetadataConverter { } // XML specific conversion, in CDS singletons are specially annotated entity sets (processed in convertEntitySet) + /** + * + * @param targetKinds + * @param element + */ private convertSingleton(targetKinds: string[], element: MetadataElement): void { if (targetKinds.includes('Singleton')) { const singleton: RawSingleton = { @@ -185,6 +211,12 @@ class MetadataConverter { } } + /** + * + * @param targetKinds + * @param element + * @param elementKey + */ private convertComplexType(targetKinds: string[], element: MetadataElement, elementKey: string): void { if (targetKinds.includes('ComplexType')) { const complexTypeProperties: RawProperty[] = []; @@ -225,6 +257,12 @@ class MetadataConverter { } } + /** + * + * @param targetKinds + * @param element + * @param elementKey + */ private convertEntityType(targetKinds: string[], element: MetadataElement, elementKey: string): void { if (targetKinds.includes('EntityType') && !targetKinds.includes('ComplexType')) { const entityProperties: RawProperty[] = []; @@ -248,6 +286,14 @@ class MetadataConverter { } } + /** + * + * @param entityProperties + * @param keys + * @param parent + * @param targetKinds + * @param element + */ private convertProperty( entityProperties: RawProperty[], keys: RawProperty[], @@ -268,6 +314,12 @@ class MetadataConverter { } } } + /** + * + * @param navigationProperties + * @param targetKinds + * @param element + */ private convertNavigationProperty( navigationProperties: RawV4NavigationProperty[], targetKinds: string[], @@ -289,6 +341,12 @@ class MetadataConverter { } } +/** + * + * @param element + * @param targetKinds + * @param metadataService + */ function convertFunctionImportV2( element: MetadataElement, targetKinds: string[], @@ -329,6 +387,11 @@ function convertFunctionImportV2( return action; } +/** + * + * @param elementTargetKinds + * @param element + */ function isReturnParameter(elementTargetKinds: string[], element: MetadataElement): boolean { return ( (elementTargetKinds.includes('Parameter') && element.name === '$Return') || @@ -342,6 +405,10 @@ const separators = new Set(['@', '/', '(']); function unalias(aliasedValue: string): string; // TODO: check what is this actually doing, aliases are not filled at all. +/** + * + * @param aliasedValue + */ function unalias(aliasedValue: string | undefined): string | undefined { if (!aliasedValue) { return aliasedValue; diff --git a/packages/fiori-annotation-api/src/avt/pointer.ts b/packages/fiori-annotation-api/src/avt/pointer.ts index f3ee632e25d..624fec189e5 100644 --- a/packages/fiori-annotation-api/src/avt/pointer.ts +++ b/packages/fiori-annotation-api/src/avt/pointer.ts @@ -104,6 +104,11 @@ export function convertPointerInAnnotationToInternal( return path.join('/'); } +/** + * + * @param currentElement + * @param valueType + */ function handleExpressionValueSegment(currentElement: Element, valueType?: string): string[] { if (valueType === undefined) { return []; @@ -120,6 +125,11 @@ function handleExpressionValueSegment(currentElement: Element, valueType?: strin return []; } +/** + * + * @param segment + * @param currentElement + */ function handleStringSegment( segment: string, currentElement: Element @@ -138,6 +148,11 @@ function handleStringSegment( } } +/** + * + * @param currentElement + * @param segment + */ function handleExpressionNameSegment( currentElement: Element, segment: string @@ -170,10 +185,20 @@ function handleExpressionNameSegment( return { subElement, pathSegments }; } +/** + * + * @param element + */ function getFirstTextNodeIndex(element: Element): number { return element.content.findIndex((subNode) => subNode.type === TEXT_TYPE); } +/** + * + * @param element + * @param subElementName + * @param occurrence + */ function findSubElement( element: Element, subElementName: ElementName | undefined, @@ -196,6 +221,10 @@ function findSubElement( return result; } +/** + * + * @param source + */ function firstCharToUpper(source: string): string { let out: string = source; if (source) { diff --git a/packages/fiori-annotation-api/src/avt/to-internal.ts b/packages/fiori-annotation-api/src/avt/to-internal.ts index 93c5c5446f4..dce02ca8b0a 100644 --- a/packages/fiori-annotation-api/src/avt/to-internal.ts +++ b/packages/fiori-annotation-api/src/avt/to-internal.ts @@ -281,6 +281,12 @@ export function convertPrimitiveValueToInternal( } } +/** + * + * @param element + * @param collectionElement + * @param hostElement + */ function consumeElement(element: Element, collectionElement: Element, hostElement?: Element): Element { if (hostElement) { element.content = element.content || []; @@ -291,6 +297,12 @@ function consumeElement(element: Element, collectionElement: Element, hostElemen return element; } +/** + * + * @param element + * @param aliasInfo + * @param reverse + */ function replaceAliasInElement(element: Element, aliasInfo: AliasInformation, reverse?: boolean): Element { // replace aliases in all attributes/sub nodes with full namespaces (reverse = true ? vice versa): const result = element; @@ -300,6 +312,12 @@ function replaceAliasInElement(element: Element, aliasInfo: AliasInformation, re return result; } +/** + * + * @param result + * @param aliasInfo + * @param reverse + */ function replaceAliasInAttributes(result: Element, aliasInfo: AliasInformation, reverse?: boolean): void { // in attributes: term or type attributes, enumValue and any path values provided as attributes Object.keys(result.attributes || {}).forEach((attributeName) => { @@ -327,6 +345,12 @@ function replaceAliasInAttributes(result: Element, aliasInfo: AliasInformation, }); } +/** + * + * @param result + * @param aliasInfo + * @param reverse + */ function replaceAliasInSubNodes(result: Element, aliasInfo: AliasInformation, reverse?: boolean): void { for (const subNode of result.content ?? []) { if (subNode.type === ELEMENT_TYPE) { @@ -343,6 +367,10 @@ function replaceAliasInSubNodes(result: Element, aliasInfo: AliasInformation, re } } +/** + * + * @param result + */ function removeEmptyTextNodes(result: Element): void { if ((result.content ?? []).some((entry) => entry.type === ELEMENT_TYPE)) { // sub elements present: filter out empty text nodes @@ -350,6 +378,11 @@ function removeEmptyTextNodes(result: Element): void { } } +/** + * + * @param aliasInfo + * @param segment + */ function getAliasedSegment(aliasInfo: AliasInformation, segment: string): string { const [path, term] = segment.split('@'); if (term) { @@ -361,6 +394,11 @@ function getAliasedSegment(aliasInfo: AliasInformation, segment: string): string } } +/** + * + * @param aliasInfo + * @param path + */ function getAliasedPath(aliasInfo: AliasInformation, path: PathValue): PathValue { return path .split('/') diff --git a/packages/fiori-annotation-api/src/cds/adapter.ts b/packages/fiori-annotation-api/src/cds/adapter.ts index 53ee7949d83..11c86f8295f 100644 --- a/packages/fiori-annotation-api/src/cds/adapter.ts +++ b/packages/fiori-annotation-api/src/cds/adapter.ts @@ -155,10 +155,18 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch this._fileSequence = service.serviceFiles; } private facade: CdsCompilerFacade | undefined; + /** + * + * @param fileCache + */ private setFileCache(fileCache: Map): void { this.fileCache = fileCache; } + /** + * + * @param facade + */ private setFacade(facade: CdsCompilerFacade): void { this.facade = facade; } @@ -174,6 +182,9 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch return this._compiledService; } + /** + * + */ private set compiledService(v: CompiledService) { this._compiledService = v; } @@ -325,6 +336,11 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch }; } + /** + * + * @param writers + * @param changes + */ private handleSapAnnotations(writers: Map, changes: AnnotationFileChange[]): void { if (changes.length === 0) { return; @@ -369,6 +385,11 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch writer.addChange(createInsertTargetChange('target', target)); } } + /** + * + * @param writers + * @param change + */ private getWriterForChange(writers: Map, change: AnnotationFileChange): CDSWriter { const cachedWriter = writers.get(change.uri); if (cachedWriter) { @@ -379,6 +400,10 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch return writer; } + /** + * + * @param change + */ private createEmptyAnnotationFile(change: AnnotationFileChange): AnnotationFile { return { type: ANNOTATION_FILE_TYPE, @@ -388,6 +413,10 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch }; } + /** + * + * @param change + */ private createWriter(change: AnnotationFileChange): CDSWriter { const document = this.documents.get(change.uri); if (!document && this.ignoreChangedFileInitialContent) { @@ -455,6 +484,9 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch return printTarget(target); } + /** + * + */ private _getCompiledService(): CompiledService { const annotationFiles: AnnotationFile[] = []; for (const file of this._fileSequence ?? []) { @@ -486,6 +518,10 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch this._fileSequence = undefined; } + /** + * + * @param facade + */ private updateFileSequence(facade: CdsCompilerFacade): void { this._fileSequence = facade.getFileSequence().map((uri) => ({ uri: pathToFileURL(uri).toString(), @@ -494,6 +530,11 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch this.service.serviceFiles = [...this._fileSequence]; } + /** + * + * @param uri + * @param writer + */ private processMissingReferences(uri: string, writer: CDSWriter): void { const missingReferences = this.missingReferences[uri]; if (missingReferences?.size) { @@ -511,6 +552,11 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch } } + /** + * + * @param uri + * @param references + */ private addMissingReferences(uri: string, references: Set): void { const missingReferences = (this.missingReferences[uri] ??= new Set()); for (const reference of references) { @@ -686,6 +732,13 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch this.addMissingReferences(document.uri, missingReferences); }; + /** + * + * @param writer + * @param document + * @param change + * @param pointer + */ private insertInFlattenedStructure( writer: CDSWriter, document: Document, @@ -708,6 +761,12 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch } } + /** + * + * @param writer + * @param change + * @param pointer + */ private insertAnnotation(writer: CDSWriter, change: InsertElement, pointer: string): void { // insert annotation value if (change.element.name === Edm.Annotation) { @@ -721,6 +780,13 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch } } + /** + * + * @param writer + * @param change + * @param pointer + * @param record + */ private insertRecord(writer: CDSWriter, change: InsertElement, pointer: string, record: Record): void { if (change.element.name === Edm.PropertyValue) { const index = adaptRecordPropertyIndex(record, change.index); @@ -939,6 +1005,12 @@ export class CDSAnnotationServiceAdapter implements AnnotationServiceAdapter, Ch }; } +/** + * + * @param annotationFileInternal + * @param metadataService + * @param vocabularyAPI + */ function getAliasInfo( annotationFileInternal: AnnotationFile, metadataService: MetadataService, @@ -952,8 +1024,12 @@ function getAliasInfo( return addAllVocabulariesToAliasInformation(aliasInfo, vocabularyAPI.getVocabularies()); } +/** + * + * @param element + */ function elementHasFlags(element: AnyNode | undefined): boolean { - if (!element || element.type !== 'element') { + if (element?.type !== 'element') { return false; } const content = element.content[0]; @@ -963,6 +1039,12 @@ function elementHasFlags(element: AnyNode | undefined): boolean { return false; } +/** + * + * @param root + * @param pointer + * @param lastContent + */ function buildAnnotation(root: AnyNode, pointer: string, lastContent: Element): Element | undefined { const segments = pointer.split('/'); @@ -991,6 +1073,10 @@ function buildAnnotation(root: AnyNode, pointer: string, lastContent: Element): return result; } +/** + * + * @param node + */ function buildElement(node: Element): Element { const result = createElementNode({ name: node.name }); if (node.name === Edm.Annotation) { @@ -1005,6 +1091,11 @@ function buildElement(node: Element): Element { return result; } +/** + * + * @param record + * @param currentIndex + */ function adaptRecordPropertyIndex(record: Record, currentIndex?: number): number | undefined { if (currentIndex === undefined) { return currentIndex; @@ -1020,6 +1111,14 @@ function adaptRecordPropertyIndex(record: Record, currentIndex?: number): number } return adaptedIdx; } +/** + * + * @param writer + * @param document + * @param change + * @param parentAstNode + * @param greatGrandParentAstNode + */ function checkAndDeleteFlattenedStructures( writer: CDSWriter, document: Document, @@ -1046,7 +1145,15 @@ function checkAndDeleteFlattenedStructures( } // Splitting the logic into multiple functions would make the code more difficult to follow than it currently is. -// eslint-disable-next-line sonarjs/cognitive-complexity + +/** + * + * @param targetName + * @param term + * @param qualifier + * @param ast + * @param writer + */ function deleteChildFlattenedStructures( targetName: string | undefined, term: string, @@ -1084,6 +1191,13 @@ function deleteChildFlattenedStructures( } } +/** + * + * @param node + * @param prefix + * @param term + * @param qualifier + */ function isMatchingAnnotation(node: AstNode, prefix: string, term: string | undefined, qualifier?: string): boolean { if (node.type !== ANNOTATION_TYPE) { return false; diff --git a/packages/fiori-annotation-api/src/cds/change.ts b/packages/fiori-annotation-api/src/cds/change.ts index 5af74c608c9..aa2aa050467 100644 --- a/packages/fiori-annotation-api/src/cds/change.ts +++ b/packages/fiori-annotation-api/src/cds/change.ts @@ -50,6 +50,10 @@ export type Inserts = ElementInserts | InsertCollection; type InsertByType = Union extends { type: Type } ? Union : never; +/** + * + * @param type + */ function insertElementChangeFactory(type: T) { return function (pointer: JsonPointer, element: Element, index?: number): InsertByType { return { @@ -204,6 +208,10 @@ export type Deletes = | DeletePrimitiveValue | DeleteQualifier; +/** + * + * @param type + */ function deleteChangeFactory(type: T) { return function (pointer: JsonPointer): InsertByType { return { diff --git a/packages/fiori-annotation-api/src/cds/comments.ts b/packages/fiori-annotation-api/src/cds/comments.ts index fdfc7c42846..b16628d1736 100644 --- a/packages/fiori-annotation-api/src/cds/comments.ts +++ b/packages/fiori-annotation-api/src/cds/comments.ts @@ -38,6 +38,10 @@ export function collectComments(tokens: CompilerToken[]): Comment[] { return comments; } +/** + * + * @param token + */ function getCommentRangeAndValue(token: CompilerToken): { value: string; range?: Range } { if (isOldToken(token)) { // 32 line comment // 31 block comment // 30 doc comment diff --git a/packages/fiori-annotation-api/src/cds/deletion.ts b/packages/fiori-annotation-api/src/cds/deletion.ts index c2454eacd93..4ce906d787c 100644 --- a/packages/fiori-annotation-api/src/cds/deletion.ts +++ b/packages/fiori-annotation-api/src/cds/deletion.ts @@ -163,6 +163,13 @@ export function getDeletionRangeForNode( return undefined; } +/** + * + * @param vocabularyAliases + * @param tokens + * @param tokenRange + * @param nativeCdsTermName + */ function findTermKind( vocabularyAliases: Set, tokens: CompilerToken[], @@ -185,6 +192,14 @@ function findTermKind( return deletionRangeKind ?? DeletionRangeKind.UNDEFINED; } +/** + * + * @param vocabularyAliases + * @param tokens + * @param deletionRanges + * @param annotationFile + * @param includeTarget + */ function expandDeletionRanges( vocabularyAliases: Set, tokens: CompilerToken[], @@ -250,6 +265,11 @@ function expandDeletionRanges( }); } +/** + * + * @param tokens + * @param deletionRanges + */ function mergeDeletionRanges(tokens: CompilerToken[], deletionRanges: DeletionRange[]): boolean { let changed = false; for (let rangeIndex = 0; rangeIndex < deletionRanges.length; rangeIndex++) { @@ -258,7 +278,7 @@ function mergeDeletionRanges(tokens: CompilerToken[], deletionRanges: DeletionRa do { doMerge = false; const next = rangeIndex + 1 < deletionRanges.length ? deletionRanges[rangeIndex + 1] : null; - if (next && current.termRange.end + 1 === next.termRange.start) { + if (current.termRange.end + 1 === next?.termRange.start) { // merge possible if at most a single separator token is between deletion ranges const nonCommentTokenIndexes: number[] = []; let nextIndex = current.tokenRange.end; @@ -289,6 +309,12 @@ function mergeDeletionRanges(tokens: CompilerToken[], deletionRanges: DeletionRa return changed; } +/** + * + * @param tokens + * @param index + * @param next + */ function getNeighborIndex(tokens: CompilerToken[], index: number, next = false): number { let neighboringIndex = index + (next ? +1 : -1); if (!tokens[neighboringIndex]) { @@ -781,6 +807,10 @@ function isEmbedded(tokens: CompilerToken[], startIndex: number): boolean { return actionFunctionFound ? true : !annotateFound; } +/** + * + * @param token + */ function isComment(token: CompilerToken): boolean { return token?.text?.startsWith('//') || token?.text?.startsWith('/*'); } @@ -884,6 +914,11 @@ function hasParameterList(tokens: CompilerToken[], startIndex: number): boolean return bracketPresent; } +/** + * + * @param token + * @param endPosition + */ function getPositionFromToken(token: CompilerToken | undefined, endPosition = false): Position | undefined { if (!token) { return undefined; @@ -892,6 +927,13 @@ function getPositionFromToken(token: CompilerToken | undefined, endPosition = fa return Position.create(tokenLine(token), tokenColumn(token) + offset); } +/** + * + * @param tokens + * @param tokenRange + * @param previousSeparatorIncluded + * @param siblingSeparatorFound + */ function getRangeFromTokenRange( tokens: CompilerToken[], tokenRange: IndexRange, @@ -909,6 +951,11 @@ function getRangeFromTokenRange( return undefined; } +/** + * + * @param tokens + * @param deletionRange + */ function includeSiblingSeparator( tokens: CompilerToken[], deletionRange: DeletionRange @@ -922,7 +969,7 @@ function includeSiblingSeparator( const nextToken = tokens[nextTokenIndex]; let siblingSeparatorFound = false; let previousSeparatorIncluded = false; - if (nextToken && nextToken.text === separator) { + if (nextToken?.text === separator) { // extend deletion range to include separator deletionRange.tokenRange.end = nextTokenIndex; siblingSeparatorFound = true; diff --git a/packages/fiori-annotation-api/src/cds/document.ts b/packages/fiori-annotation-api/src/cds/document.ts index 09f0aa02758..90e045ff1b7 100644 --- a/packages/fiori-annotation-api/src/cds/document.ts +++ b/packages/fiori-annotation-api/src/cds/document.ts @@ -88,6 +88,13 @@ export function getDocument( }; } +/** + * + * @param fileCache + * @param file + * @param facade + * @param ignoreComments + */ function getComments( fileCache: Map, file: TextFile, @@ -154,6 +161,11 @@ export function getGhostFileDocument( }; } +/** + * + * @param serviceName + * @param annotationFile + */ function filterTargets(serviceName: string, annotationFile: AnnotationFile): void { // only allow targets pointing to current service const serviceNamespace = annotationFile.namespace?.name === serviceName ? annotationFile.namespace : undefined; diff --git a/packages/fiori-annotation-api/src/cds/indent.ts b/packages/fiori-annotation-api/src/cds/indent.ts index abdbd5c562b..fae4f9ad050 100644 --- a/packages/fiori-annotation-api/src/cds/indent.ts +++ b/packages/fiori-annotation-api/src/cds/indent.ts @@ -41,6 +41,11 @@ export function getIndentLevelFromNode(tokens: CompilerToken[], node: AstNode): return Math.floor(indentLevel); } +/** + * + * @param node + * @param tokens + */ function getLineStartCharacter(node: AstNode, tokens: CompilerToken[]): number { if (!node?.range) { return 0; @@ -63,6 +68,11 @@ function getLineStartCharacter(node: AstNode, tokens: CompilerToken[]): number { return token ? tokenColumn(token) : 0; } +/** + * + * @param tokens + * @param nodeLine + */ function findFirstTokenOfLine(tokens: CompilerToken[], nodeLine: number): CompilerToken | undefined { // use binary search to find a token at the same line let left = 0; diff --git a/packages/fiori-annotation-api/src/cds/pointer.ts b/packages/fiori-annotation-api/src/cds/pointer.ts index 80d5da2b2e7..d0c134f6939 100644 --- a/packages/fiori-annotation-api/src/cds/pointer.ts +++ b/packages/fiori-annotation-api/src/cds/pointer.ts @@ -69,6 +69,12 @@ class Visitor { }; } + /** + * + * @param astNode + * @param node + * @param pointer + */ private target(astNode: Target, node: AnnotationFileTarget, pointer: string[]): ReturnValue | undefined { if (astNode.type === TARGET_TYPE) { const [segment, indexSegment, ...segments] = pointer; @@ -97,6 +103,12 @@ class Visitor { return undefined; } + /** + * + * @param astNode + * @param node + * @param pointer + */ private assignment(astNode: Assignment, node: Element, pointer: string[]): ReturnValue | undefined { if (astNode.type === ANNOTATION_TYPE) { const result = this.annotation(astNode, node, pointer); @@ -123,6 +135,13 @@ class Visitor { return undefined; } + /** + * + * @param astNode + * @param node + * @param pointer + * @param embedded + */ private annotation( astNode: Annotation, node: Element, @@ -178,6 +197,12 @@ class Visitor { return undefined; } + /** + * + * @param astNode + * @param node + * @param pointer + */ private value( astNode: AnnotationValue, node: ElementChild | Attribute, @@ -294,6 +319,12 @@ class Visitor { return undefined; } + /** + * + * @param astNode + * @param node + * @param pointer + */ private recordProperty(astNode: RecordProperty, node: ElementChild, pointer: string[]): ReturnValue | undefined { if (node.type !== ELEMENT_TYPE || node.name !== Edm.PropertyValue) { return undefined; @@ -345,6 +376,12 @@ class Visitor { return undefined; } + /** + * + * @param astNode + * @param node + * @param pointer + */ private flattenedProperty(astNode: RecordProperty, node: ElementChild, pointer: string[]): ReturnValue | undefined { if (node.type !== ELEMENT_TYPE || node.name !== Edm.Record) { return undefined; @@ -378,6 +415,12 @@ class Visitor { return undefined; } + /** + * + * @param astNode + * @param node + * @param pointer + */ private flattenedAnnotation(astNode: Annotation, node: ElementChild, pointer: string[]): ReturnValue | undefined { if (node.type !== ELEMENT_TYPE || (node.name !== Edm.Record && node.name !== Edm.Annotation)) { return undefined; @@ -402,6 +445,12 @@ class Visitor { return undefined; } + /** + * + * @param astNode + * @param node + * @param pointer + */ private flattenedAnnotationPropertyValue( astNode: Annotation, node: ElementChild, @@ -434,6 +483,12 @@ class Visitor { } return undefined; } + /** + * + * @param astNode + * @param node + * @param pointer + */ private flattenedAnnotationValue( astNode: Annotation, node: ElementChild, @@ -463,6 +518,11 @@ class Visitor { } } +/** + * + * @param nodes + * @param range + */ function findNodeIndexByRange(nodes: T[], range: Range): number { for (let index = 0; index < nodes.length; index++) { const node = nodes[index]; diff --git a/packages/fiori-annotation-api/src/cds/preprocessor.ts b/packages/fiori-annotation-api/src/cds/preprocessor.ts index b30f8a14622..ff8e31caa70 100644 --- a/packages/fiori-annotation-api/src/cds/preprocessor.ts +++ b/packages/fiori-annotation-api/src/cds/preprocessor.ts @@ -168,6 +168,12 @@ class ChangePreprocessor { } } + /** + * + * @param deletionMap + * @param insertionMap + * @param index + */ private processChangesInputEntry( deletionMap: Record, insertionMap: Record, @@ -227,6 +233,11 @@ class ChangePreprocessor { this.processDeletionMap(deletionMap, insertionMap); } + /** + * + * @param deletionMap + * @param insertionMap + */ private processDeletionMap( deletionMap: Record, insertionMap: Record @@ -266,6 +277,15 @@ class ChangePreprocessor { } } + /** + * + * @param parent + * @param grandParent + * @param greatGrandParent + * @param parentPointer + * @param deletionMap + * @param insertionMap + */ private processRecordDeletion( parent: RecordNode, grandParent: AstNode | undefined, @@ -286,6 +306,13 @@ class ChangePreprocessor { } } + /** + * + * @param parent + * @param parentPointer + * @param deletionMap + * @param insertionMap + */ private processTargetDeletion( parent: Target, parentPointer: string, @@ -301,6 +328,14 @@ class ChangePreprocessor { } } + /** + * + * @param parent + * @param grandParent + * @param parentPointer + * @param deletionMap + * @param insertionMap + */ private processAnnotationGroupDeletion( parent: AnnotationGroup, grandParent: Target, @@ -314,6 +349,14 @@ class ChangePreprocessor { } } + /** + * + * @param parent + * @param grandParent + * @param parentPointer + * @param deletionMap + * @param insertionMap + */ private processAnnotationGroupItemsDeletion( parent: AnnotationGroupItems, grandParent: AnnotationGroup, @@ -335,6 +378,13 @@ class ChangePreprocessor { } } + /** + * + * @param deletionMap + * @param grandParent + * @param greatGrandParent + * @param parentPointer + */ private bubbleUpDeleteChange( deletionMap: Record, grandParent: AstNode | undefined, @@ -367,6 +417,12 @@ class ChangePreprocessor { }); } + /** + * + * @param grandParent + * @param greatGrandParent + * @param parentPointer + */ private getBubbleUpParentPointer( grandParent: AstNode | undefined, greatGrandParent: AstNode | undefined, @@ -391,6 +447,12 @@ class ChangePreprocessor { return undefined; } + /** + * + * @param grandParent + * @param parentPointer + * @param greatGrandParent + */ private getMergedChange( grandParent: AstNode, parentPointer: string, @@ -478,6 +540,13 @@ class ChangePreprocessor { } } + /** + * + * @param pointer + * @param change + * @param deletionChangeIndex + * @param changeIndex + */ private createReplaceCommand( pointer: string, change: InsertEmbeddedAnnotation | InsertAnnotation, @@ -493,6 +562,11 @@ class ChangePreprocessor { }); } + /** + * + * @param change + * @param parent + */ private flattenAnnotationTerm(change: InsertEmbeddedAnnotation, parent: AstNode): void { const element = createReferenceElement(parent); const last = structuredClone(change.element); @@ -564,6 +638,10 @@ class ChangePreprocessor { } } + /** + * + * @param index + */ private dropMergedDeletionChanges(index: DeletionIndex[]): number { let lastChange = -1; for (const indexedValue of index) { diff --git a/packages/fiori-annotation-api/src/cds/references.ts b/packages/fiori-annotation-api/src/cds/references.ts index 718fc37730b..ff9952a1c00 100644 --- a/packages/fiori-annotation-api/src/cds/references.ts +++ b/packages/fiori-annotation-api/src/cds/references.ts @@ -25,6 +25,11 @@ import type { Document } from './document'; import type { ProjectInfo } from '../types'; import { toUnifiedUri } from './utils'; +/** + * + * @param metadataService + * @param files + */ function buildDefinitionIndex( metadataService: MetadataService, files: AnnotationFile[] @@ -47,6 +52,14 @@ function buildDefinitionIndex( return { definitionIndex, virtualProperties }; } +/** + * + * @param definitionIndex + * @param virtualProperties + * @param metadataElement + * @param target + * @param fileUri + */ function buildDefinitionIndexForTarget( definitionIndex: Map, virtualProperties: Map, @@ -76,6 +89,13 @@ function buildDefinitionIndexForTarget( } } +/** + * + * @param virtualProperties + * @param fileUri + * @param metadataElement + * @param collection + */ function collectVirtualProperties( virtualProperties: Map, fileUri: string, @@ -105,6 +125,13 @@ function collectVirtualProperties( } } +/** + * + * @param definitionIndex + * @param fileUri + * @param prefix + * @param element + */ function collectAnnotations( definitionIndex: Map, fileUri: string, @@ -125,6 +152,13 @@ function collectAnnotations( } } +/** + * + * @param definitionIndex + * @param fileUri + * @param prefix + * @param collection + */ function traverseCollection( definitionIndex: Map, fileUri: string, @@ -147,6 +181,13 @@ function traverseCollection( } } +/** + * + * @param definitionIndex + * @param fileUri + * @param prefix + * @param element + */ function traverseRecord( definitionIndex: Map, fileUri: string, @@ -172,6 +213,13 @@ function traverseRecord( } } +/** + * + * @param definitionIndex + * @param fileUri + * @param prefix + * @param element + */ function traverseAnnotation( definitionIndex: Map, fileUri: string, @@ -188,6 +236,12 @@ function traverseAnnotation( } } +/** + * + * @param definitionIndex + * @param fileUri + * @param path + */ function registerReference(definitionIndex: Map, fileUri: string, path: string): void { const entry = definitionIndex.get(path); // We can't point to ghost files, we need to use the real url @@ -199,6 +253,11 @@ function registerReference(definitionIndex: Map, fileUri: stri } } +/** + * + * @param element + * @param basePath + */ function getPathsInElement(element: Element, basePath: string): { path: string }[] { const paths: { path: string }[] = []; // add all paths in attributes @@ -226,6 +285,12 @@ function getPathsInElement(element: Element, basePath: string): { path: string } return paths; } +/** + * + * @param target + * @param metadata + * @param aliasInfo + */ function getPathsInTarget( target: AnnotationFileTarget, metadata: MetadataService, @@ -243,6 +308,13 @@ function getPathsInTarget( return paths; } +/** + * + * @param element + * @param paths + * @param targetName + * @param pathBase + */ function getPathsInAnnotation( element: Element, paths: { path: string; forOverriding?: boolean }[], @@ -261,6 +333,14 @@ function getPathsInAnnotation( paths.push(...getPathsInElement(element, pathBase)); } +/** + * + * @param fileUri + * @param namespaceMap + * @param projectRoot + * @param documents + * @param fileUrisDone + */ function addAvailableNamespaces( fileUri: string, namespaceMap: Map, @@ -346,6 +426,15 @@ export function resolvePath(path: PathValue, aliasInfo: AliasInformation): PathV return segmentsNoAlias.join('/'); } +/** + * + * @param fileUri + * @param references + * @param missingReferences + * @param segments + * @param metadataService + * @param projectRoot + */ function checkSegments( fileUri: string, references: Reference[], @@ -380,6 +469,19 @@ function checkSegments( return currentMdElementPath; } +/** + * + * @param fileUri + * @param aliasInfo + * @param references + * @param missingReferences + * @param virtualProperties + * @param entry + * @param entry.path + * @param entry.forOverriding + * @param metadataService + * @param projectRoot + */ function checkMetadataDefinitions( fileUri: string, aliasInfo: AliasInformation, @@ -508,6 +610,12 @@ export function getMissingRefs( return missingReferences; } +/** + * + * @param projectRoot + * @param definitionIndex + * @param annotationPath + */ function findDefinitionForEntry( projectRoot: string, definitionIndex: Map, @@ -524,6 +632,12 @@ function findDefinitionForEntry( return uris; } +/** + * + * @param uri + * @param appName + * @param apps + */ function getCrossAppFolder(uri: string, appName: string, apps: string[]): string { let crossAppFolder = ''; if (!isSubDirectory(toUnifiedUri(`${appName}/`), uri)) { @@ -536,11 +650,23 @@ function getCrossAppFolder(uri: string, appName: string, apps: string[]): string return crossAppFolder; } +/** + * + * @param parent + * @param child + */ function isSubDirectory(parent: string, child: string): boolean { const relativePath = relative(parent, child); return !!(relativePath && !relativePath.startsWith('..') && !isAbsolute(relativePath)); } +/** + * + * @param uris + * @param fileUri + * @param references + * @param projectRoot + */ function hasMissingUri(uris: string[], fileUri: string, references: Reference[], projectRoot: string) { if (uris.length === 0) { return false; diff --git a/packages/fiori-annotation-api/src/cds/utils.ts b/packages/fiori-annotation-api/src/cds/utils.ts index 7d1590dd62c..2bc4e8f204a 100644 --- a/packages/fiori-annotation-api/src/cds/utils.ts +++ b/packages/fiori-annotation-api/src/cds/utils.ts @@ -73,6 +73,12 @@ export function getAnnotationFromAssignment( return [annotation, edmxPath]; } +/** + * + * @param node + * @param parent + * @param greatGrandParent + */ function findAnnotation(node: AstNode, parent?: AstNode, greatGrandParent?: AstNode): [Annotation, Target] { if (node.type === TARGET_TYPE) { // if no assignment is specified we default to the first one diff --git a/packages/fiori-annotation-api/src/cds/writer.ts b/packages/fiori-annotation-api/src/cds/writer.ts index 4957383995d..15867752cd9 100644 --- a/packages/fiori-annotation-api/src/cds/writer.ts +++ b/packages/fiori-annotation-api/src/cds/writer.ts @@ -225,6 +225,10 @@ export class CDSWriter implements ChangeHandler { this.uniqueInserts = new Set(); } + /** + * + * @param pointer + */ private getIndentLevel(pointer: string): number { const cachedValue = this.indentLevelCache[pointer]; if (cachedValue !== undefined) { @@ -237,6 +241,12 @@ export class CDSWriter implements ChangeHandler { //#region Inserts + /** + * + * @param pointer + * @param node + * @param index + */ private isFirstInsert(pointer: string, node: ContainerNode, index: number = -1): boolean { const childCount = getChildCount(node); const i = index > -1 ? Math.min(index, childCount) : childCount; @@ -414,6 +424,11 @@ export class CDSWriter implements ChangeHandler { //#region Deletes + /** + * + * @param pointer + * @param reversePath + */ private deleteNode(pointer: string, reversePath: AstNode[]): void { const [astNode, parent] = reversePath; const segments = pointer.split('/'); @@ -486,6 +501,12 @@ export class CDSWriter implements ChangeHandler { // preprocessor converts these changes to DeleteAnnotationGroup }; + /** + * + * @param annotation + * @param target + * @param index + */ private getDeletionRange(annotation: Annotation, target: Target, index: number): DeletionRange | undefined { const { edmxPath } = this.facade.collectMetadataForAbsolutePath( target.name, @@ -724,6 +745,15 @@ export class CDSWriter implements ChangeHandler { } }; + /** + * + * @param content + * @param parent + * @param change + * @param indentLevel + * @param firstInsert + * @param referenceNode + */ private insertIntoNodeWithContent( content: ContainerContentBlock[], parent: ContainerNode, @@ -779,6 +809,13 @@ export class CDSWriter implements ChangeHandler { } } + /** + * + * @param range + * @param text + * @param indentLevel + * @param firstInsert + */ private insertText(range: Range, text: string, indentLevel: number, firstInsert: boolean): void { if (firstInsert) { this.edits.push(TextEdit.replace(range, text + indent('\n', { level: indentLevel, skipFirstLine: true }))); @@ -794,6 +831,14 @@ export class CDSWriter implements ChangeHandler { } } + /** + * + * @param content + * @param parent + * @param change + * @param childIndentLevel + * @param firstInsert + */ private convertInsertNodeToTextEdits( content: ContainerContentBlock[], parent: ContainerNode | CDSDocument, @@ -809,6 +854,13 @@ export class CDSWriter implements ChangeHandler { } } + /** + * + * @param content + * @param parent + * @param insertionPointer + * @param index + */ private findInsertPosition( content: ContainerContentBlock[], parent: ContainerNode, @@ -847,6 +899,11 @@ export class CDSWriter implements ChangeHandler { } } +/** + * + * @param changes + * @param pointer + */ function willTargetAnnotationIncreaseIndent(changes: CDSDocumentChange[], pointer: string): boolean { const targetPointer = pointer.split('/').slice(0, 3).join('/'); const conversionChange = changes.find( @@ -856,6 +913,13 @@ function willTargetAnnotationIncreaseIndent(changes: CDSDocumentChange[], pointe return !!conversionChange; } +/** + * + * @param tokens + * @param node + * @param indentLevel + * @param indentContent + */ function convertToCompoundAnnotation( tokens: CompilerToken[], node: Target, @@ -922,6 +986,12 @@ function convertToCompoundAnnotation( ]; } +/** + * + * @param edits + * @param content + * @param blockIndex + */ function deleteBlock(edits: TextEdit[], content: ContainerContentBlock[], blockIndex: number): void { const block = content[blockIndex]; if (block?.type !== 'element') { @@ -941,6 +1011,12 @@ function deleteBlock(edits: TextEdit[], content: ContainerContentBlock[], blockI } } +/** + * + * @param edits + * @param content + * @param blockIndex + */ function enhanceDeletionRange(edits: TextEdit[], content: ContainerContentBlock[], blockIndex: number) { for (let i = blockIndex - 1; i > -1; i--) { const prev = content[i]; @@ -959,6 +1035,12 @@ function enhanceDeletionRange(edits: TextEdit[], content: ContainerContentBlock[ } } +/** + * + * @param previousElement + * @param currentBlock + * @param edits + */ function deletePreviousElementWhiteSpaces( previousElement: ContainerContentBlock, currentBlock: ContainerContentBlock, @@ -971,6 +1053,16 @@ function deletePreviousElementWhiteSpaces( } } +/** + * + * @param edits + * @param pointer + * @param astNode + * @param parent + * @param comments + * @param tokens + * @param lastIndex + */ function deleteValue( edits: TextEdit[], pointer: string, @@ -1010,6 +1102,11 @@ function deleteValue( } } +/** + * + * @param parent + * @param referenceNode + */ function printChange(parent: ContainerNode | undefined, referenceNode?: Annotation) { return function (change: ElementInserts): string { if (change.type === INSERT_EMBEDDED_ANNOTATION_CHANGE_TYPE) { @@ -1034,12 +1131,22 @@ function printChange(parent: ContainerNode | undefined, referenceNode?: Annotati }; } +/** + * + * @param containerSize + * @param insertionIndex + */ function getIndexForInsertion(containerSize: number, insertionIndex?: number): number { return insertionIndex !== undefined && insertionIndex > -1 ? Math.min(insertionIndex, containerSize) : containerSize; } +/** + * + * @param container + * @param tokens + */ function getCommas(container: ContainerNode, tokens: CompilerToken[]): Token[] { if (container.type === TARGET_TYPE) { if (!container.range) { @@ -1051,6 +1158,12 @@ function getCommas(container: ContainerNode, tokens: CompilerToken[]): Token[] { } } +/** + * + * @param range + * @param items + * @param tokens + */ function extractCommasFromCompilerTokens( range: Range, items: T[], @@ -1084,6 +1197,13 @@ function extractCommasFromCompilerTokens( return result; } +/** + * + * @param content + * @param parent + * @param previous + * @param index + */ function getStartAnchor( content: ContainerContentBlock[], parent: ContainerNode, @@ -1116,6 +1236,10 @@ function getStartAnchor( return startPosition; } +/** + * + * @param data + */ function serializeReference(data: NoUndefinedNamespaceData): string { if (data.namespace) { if (data.alias) { @@ -1128,6 +1252,12 @@ function serializeReference(data: NoUndefinedNamespaceData): string { } } +/** + * + * @param missingReferences + * @param fileUri + * @param projectRoot + */ async function getTextEditForMissingRefs( missingReferences: string[], fileUri: string, @@ -1142,6 +1272,11 @@ async function getTextEditForMissingRefs( return missingReferencesTexts.join('\n') + '\n'; } +/** + * + * @param range1 + * @param range2 + */ function isRangesEqual(range1: Range | undefined, range2: Range | undefined): boolean { if (!range1 || !range2) { return false; @@ -1155,6 +1290,10 @@ function isRangesEqual(range1: Range | undefined, range2: Range | undefined): bo ); } +/** + * + * @param kind + */ function convertCDSAstToEdmType(kind: string): Edm | undefined { switch (kind) { case 'time': @@ -1180,6 +1319,10 @@ function convertCDSAstToEdmType(kind: string): Edm | undefined { } } +/** + * + * @param text + */ function deIndent(text: string): string { return text .split('\n') @@ -1187,6 +1330,10 @@ function deIndent(text: string): string { .join('\n'); } +/** + * + * @param references + */ function getInsertReferencePosition(references: Reference[]): { position: Position; prependNewLine: boolean } { const range = references[references.length - 1]?.uriRange; if (!range) { @@ -1205,6 +1352,12 @@ interface CutRange { end: number; } +/** + * + * @param document + * @param tokens + * @param pointers + */ function createElementRanges(document: CDSDocument, tokens: CompilerToken[], pointers: string[]): CutRange[] { const ranges: CutRange[] = []; const groups = pointers.reduce((acc, pointer) => { @@ -1245,6 +1398,15 @@ function createElementRanges(document: CDSDocument, tokens: CompilerToken[], poi return ranges; } +/** + * + * @param document + * @param comments + * @param tokens + * @param position + * @param ranges + * @param indentLevel + */ function getTextEditsForMove( document: TextDocument, comments: Comment[], @@ -1263,6 +1425,13 @@ function getTextEditsForMove( return edits; } +/** + * + * @param content + * @param start + * @param end + * @param nodeType + */ function findContentIndices( content: ContainerContentBlock[], start: number, @@ -1300,10 +1469,23 @@ function findContentIndices( }; } +/** + * + * @param token + */ function isComma(token: AstNode | Comment | ContainerContentBlock | undefined): token is Token { return token?.type === 'token' && token.value === ','; } +/** + * + * @param textDocument + * @param content + * @param cutRange + * @param indentLevel + * @param text + * @param edits + */ function cutRange( textDocument: TextDocument, content: ContainerContentBlock[], @@ -1352,6 +1534,13 @@ function cutRange( edits.push(TextEdit.del(range)); } +/** + * + * @param originalText + * @param suffix + * @param cutRange + * @param indentLevel + */ function makeCut(originalText: string, suffix: string | undefined, cutRange: CutRange, indentLevel: number): string { let cut = originalText; const difference = indentLevel - cutRange.indentLevel; @@ -1369,6 +1558,11 @@ function makeCut(originalText: string, suffix: string | undefined, cutRange: Cut } } +/** + * + * @param a + * @param b + */ function updatePosition(a: Position, b: Position): void { a.line = b.line; a.character = b.character; @@ -1386,6 +1580,12 @@ interface ElementWithComments { range: Range; } +/** + * + * @param collection + * @param comments + * @param tokens + */ function getContainerContent( collection: ContainerNode, comments: Comment[], @@ -1409,6 +1609,11 @@ function getContainerContent( return content; } +/** + * + * @param content + * @param item + */ function processNode(content: ContainerContentBlock[], item: Comment | AstNode): void { const previousItem = content[content.length - 1]; @@ -1448,6 +1653,13 @@ function processNode(content: ContainerContentBlock[], item: Comment | AstNode): content.push(element); } } +/** + * + * @param changes + * @param content + * @param document + * @param insertAfterIndex + */ function skipCommaInsertion( changes: CDSDocumentChange[], content: ContainerContentBlock[], diff --git a/packages/fiori-annotation-api/src/change-converter.ts b/packages/fiori-annotation-api/src/change-converter.ts index 3f3e5fea1dc..e801891ecc5 100644 --- a/packages/fiori-annotation-api/src/change-converter.ts +++ b/packages/fiori-annotation-api/src/change-converter.ts @@ -147,6 +147,11 @@ export class ChangeConverter { return this.annotationFileChanges; } + /** + * + * @param compiledService + * @param uri + */ private getFile(compiledService: CompiledService, uri: string): AnnotationFile { const file = compiledService.annotationFiles.find((file) => file.uri === uri); if (!file) { @@ -163,6 +168,12 @@ export class ChangeConverter { return file; } + /** + * + * @param compiledService + * @param aliasInfo + * @param change + */ private insertAnnotation( compiledService: CompiledService, aliasInfo: AliasInformation, @@ -202,6 +213,13 @@ export class ChangeConverter { } } + /** + * + * @param file + * @param fileMergeMaps + * @param aliasInfo + * @param change + */ private insertEmbeddedAnnotation( file: AnnotationFile, fileMergeMaps: Record>, @@ -229,6 +247,13 @@ export class ChangeConverter { this.annotationFileChanges.push(internal); } + /** + * + * @param file + * @param fileMergeMaps + * @param aliasInfo + * @param change + */ private convertInsert( file: AnnotationFile, fileMergeMaps: Record>, @@ -286,6 +311,15 @@ export class ChangeConverter { } } + /** + * + * @param file + * @param aliasInfoMod + * @param pointer + * @param change + * @param content + * @param index + */ private convertInsertExpression( file: AnnotationFile, aliasInfoMod: AliasInformation, @@ -343,6 +377,16 @@ export class ChangeConverter { } } + /** + * + * @param element + * @param aliasInfoMod + * @param pointer + * @param internalPointer + * @param change + * @param content + * @param index + */ private convertInsertPrimitive( element: Element, aliasInfoMod: AliasInformation, @@ -392,6 +436,13 @@ export class ChangeConverter { } } + /** + * + * @param file + * @param fileMergeMaps + * @param aliasInfo + * @param change + */ private convertDelete( file: AnnotationFile, fileMergeMaps: Record>, @@ -443,6 +494,14 @@ export class ChangeConverter { } } + /** + * + * @param file + * @param fileMergeMaps + * @param aliasInfo + * @param schemaProvider + * @param change + */ private convertUpdate( file: AnnotationFile, fileMergeMaps: Record>, @@ -519,6 +578,15 @@ export class ChangeConverter { } } + /** + * + * @param aliasInfo + * @param attributeName + * @param property + * @param pointer + * @param internalPointer + * @param change + */ private convertUpdateAttribute( aliasInfo: AliasInformation, attributeName: string, @@ -542,6 +610,10 @@ export class ChangeConverter { } } + /** + * + * @param content + */ private getPrimitiveValueType(content: UpdateContent): string | undefined { if (content.type === 'primitive') { if (content.expressionType === ExpressionType.Unknown) { @@ -558,6 +630,10 @@ export class ChangeConverter { return undefined; } + /** + * + * @param content + */ private getAttributeValue(content: UpdateContent): string | number | boolean | undefined { if (content.type === 'primitive') { return content.value; @@ -568,10 +644,23 @@ export class ChangeConverter { return undefined; } + /** + * + * @param content + */ private getExpressionValue(content: ExpressionUpdateContent): string | number | boolean { return (content.value as any)[content.value.type]; // There is always a property with on the object as type name, Typescript does not infer this case as expected } + /** + * + * @param file + * @param aliasInfo + * @param content + * @param pointer + * @param valueType + * @param targetName + */ private convertUpdateExpression( file: AnnotationFile, aliasInfo: AliasInformation, @@ -635,6 +724,15 @@ export class ChangeConverter { } } + /** + * + * @param fileUri + * @param targetName + * @param valueType + * @param content + * @param pointer + * @param newValue + */ private convertUpdateExpressionForAttrributeType( fileUri: string, targetName: string, @@ -678,6 +776,14 @@ export class ChangeConverter { } } + /** + * + * @param file + * @param aliasInfo + * @param content + * @param pointer + * @param replaceTextPointer + */ private convertUpdatePrimitiveValue( file: AnnotationFile, aliasInfo: AliasInformation, @@ -743,6 +849,13 @@ export class ChangeConverter { this.annotationFileChanges.push(internal); } + /** + * + * @param file + * @param fileMergeMaps + * @param aliasInfo + * @param change + */ private convertMove( file: AnnotationFile, fileMergeMaps: Record>, @@ -784,6 +897,10 @@ export class ChangeConverter { this.annotationFileChanges.push(internal); } + /** + * + * @param compiledService + */ private addTargetChanges(compiledService: CompiledService): void { const insertTargetChanges: InsertTarget[] = []; for (const [uri, changesForUri] of this.newTargetChanges) { @@ -803,6 +920,11 @@ export class ChangeConverter { this.annotationFileChanges.unshift(...insertTargetChanges); } + /** + * + * @param schemaProvider + * @param change + */ private getValueType(schemaProvider: SchemaProvider, change: UpdateChange): string | undefined { const { content } = change; if (content.type === 'expression') { @@ -820,6 +942,11 @@ export class ChangeConverter { return undefined; } + /** + * + * @param schemaProvider + * @param change + */ private getValueTypeFromSchema(schemaProvider: SchemaProvider, change: UpdateChange): string | undefined { const { reference, uri, pointer } = change; const annotationLists = schemaProvider().schema.annotations[uri] ?? []; @@ -843,10 +970,18 @@ export class ChangeConverter { return undefined; } + /** + * + * @param node + */ private isExpression(node: AVTNode): node is Expression { return typeof (node as any).type !== 'undefined' && typeof (node as any).propertyValues === 'undefined'; } + /** + * + * @param file + */ private getAliasInformation(file: AnnotationFile): AliasInformation { const cachedValue = this.aliasInfoCache[file.uri]; if (cachedValue) { @@ -873,6 +1008,10 @@ export class ChangeConverter { } } +/** + * + * @param changes + */ function mergeChanges(changes: Change[]): Change[] { const result: Change[] = []; @@ -910,6 +1049,11 @@ function mergeChanges(changes: Change[]): Change[] { return result; } +/** + * + * @param target + * @param source + */ function mergeChange(target: InsertAnnotationChange, source: Exclude): void { const reference = annotationReferenceToString(source.reference, source.uri); switch (source.kind) { @@ -951,6 +1095,12 @@ function mergeChange(target: InsertAnnotationChange, source: Exclude): FioriAnnotationServiceOptions { return { commitOnSave: options.commitOnSave ?? true, @@ -401,6 +405,11 @@ export class FioriAnnotationService { return this.changeConverter.convert(compiledService, this.fileMergeMaps, schemaProvider, changes); } + /** + * + * @param path + * @param content + */ private saveFile(path: string, content: string): void { this.fs.write(path, content); } @@ -429,6 +438,13 @@ export interface SaveOptions { resyncAfterSave?: boolean; } +/** + * + * @param fileUri + * @param languageId + * @param workspaceEdits + * @param content + */ function applyWorkspaceEdits( fileUri: string, languageId: string, @@ -436,10 +452,19 @@ function applyWorkspaceEdits( content: string ): string { const document = TextDocument.create(fileUri, languageId, 0, content); - const fileChanges = workspaceEdits.changes ? workspaceEdits.changes[fileUri] ?? [] : []; + const fileChanges = workspaceEdits.changes ? (workspaceEdits.changes[fileUri] ?? []) : []; return TextDocument.applyEdits(document, fileChanges); } +/** + * + * @param compiledService + * @param rawMetadata + * @param serviceName + * @param options + * @param options.vocabulary + * @param mergeSplitAnnotations + */ function mergeAnnotations( compiledService: CompiledService, rawMetadata: RawMetadata, @@ -462,6 +487,14 @@ function mergeAnnotations( return fileMergeMaps; } +/** + * + * @param project + * @param serviceName + * @param appName + * @param fsEditor + * @param clearCache + */ async function getService( project: Project, serviceName: string, @@ -485,6 +518,15 @@ async function getService( } } +/** + * + * @param project + * @param service + * @param vocabularyService + * @param appName + * @param writeSapAnnotations + * @param ignoreChangedFileInitialContent + */ function createAdapter( project: Project, service: Service, @@ -509,6 +551,10 @@ function createAdapter( } } +/** + * + * @param compileMessages + */ function compilerMessagesToErrors(compileMessages: Map): Map { const result: Map = new Map(); [...compileMessages.entries()].forEach((entry) => { diff --git a/packages/fiori-annotation-api/src/sap/builders.ts b/packages/fiori-annotation-api/src/sap/builders.ts index bd09d56ebf8..b2d7821dfd2 100644 --- a/packages/fiori-annotation-api/src/sap/builders.ts +++ b/packages/fiori-annotation-api/src/sap/builders.ts @@ -3,6 +3,13 @@ import { Edm, createElementNode, createAttributeNode, Location } from '@sap-ux/o import type { ValueWithOrigin } from './types'; +/** + * + * @param elementName + * @param nameAttribute + * @param name + * @param content + */ function createComplexElement(elementName: Edm, nameAttribute: Edm, name: string, content: ElementChild[]): Element { return createElementNode({ name: elementName, @@ -13,6 +20,14 @@ function createComplexElement(elementName: Edm, nameAttribute: Edm, name: string }); } +/** + * + * @param elementName + * @param nameAttribute + * @param name + * @param valueType + * @param value + */ function createPrimitiveElement( elementName: Edm, nameAttribute: Edm, diff --git a/packages/fiori-annotation-api/src/sap/collector.ts b/packages/fiori-annotation-api/src/sap/collector.ts index 6ba4561842c..5005174b9ae 100644 --- a/packages/fiori-annotation-api/src/sap/collector.ts +++ b/packages/fiori-annotation-api/src/sap/collector.ts @@ -35,8 +35,17 @@ function findProperty(name: string, properties: Element[]): Element | undefined */ class ODataAnnotationCollector implements CollectorDefinition { readonly annotations: ODataAnnotations[] = []; + /** + * + * @param uri + */ constructor(private readonly uri: string) {} + /** + * + * @param target + * @param term + */ [UI_LINE_ITEM](target: Target, term: Element): void { const collection = elementsWithName(Edm.Collection, term)[0]; if (!collection) { @@ -67,6 +76,11 @@ class ODataAnnotationCollector implements CollectorDefinition { this.annotations.push(lineItems); } + /** + * + * @param target + * @param term + */ [UI_FIELD_GROUP](target: Target, term: Element): void { const qualifier = term.attributes[Edm.Qualifier]?.value; const record = elementsWithName(Edm.Record, term)?.[0]; @@ -109,6 +123,11 @@ class ODataAnnotationCollector implements CollectorDefinition { this.annotations.push(annotation); } + /** + * + * @param target + * @param term + */ [UI_FACETS](target: Target, term: Element): void { const collection = elementsWithName(Edm.Collection, term)[0]; if (!collection) { @@ -166,10 +185,21 @@ class ODataAnnotationCollector implements CollectorDefinition { this.annotations.push(annotation); } + /** + * + * @param value + * @param range + */ private createValue(value: T, range?: Range): ValueWithOrigin { return createValue(value, this.uri, range); } + /** + * + * @param propertyName + * @param valueType + * @param properties + */ private createValueFromPrimitiveRecordProperty( propertyName: string, valueType: Edm, @@ -179,6 +209,12 @@ class ODataAnnotationCollector implements CollectorDefinition { return this.createValueFromAttribute(element, valueType); } + /** + * + * @param propertyName + * @param valueTypes + * @param properties + */ private createValueFromPrimitiveRecordPropertyWithFirstMatchingType( propertyName: string, valueTypes: Edm[], @@ -195,6 +231,11 @@ class ODataAnnotationCollector implements CollectorDefinition { return undefined; } + /** + * + * @param element + * @param attributeName + */ private createValueFromAttribute( element: Element | undefined, attributeName: Edm @@ -208,6 +249,10 @@ class ODataAnnotationCollector implements CollectorDefinition { return undefined; } + /** + * + * @param dataField + */ private processDataField(dataField: Element): UIDataFieldDefinition | undefined { const properties = elementsWithName(Edm.PropertyValue, dataField); const value = this.createValueFromPrimitiveRecordPropertyWithFirstMatchingType( diff --git a/packages/fiori-annotation-api/src/sap/converter.ts b/packages/fiori-annotation-api/src/sap/converter.ts index f1b320d8246..99c3cab8d8e 100644 --- a/packages/fiori-annotation-api/src/sap/converter.ts +++ b/packages/fiori-annotation-api/src/sap/converter.ts @@ -46,6 +46,10 @@ export class SAPAnnotationConverter { return [...this.targets.values()]; } + /** + * + * @param name + */ private getTarget(name: string): Target { let target = this.targets.get(name); if (!target) { @@ -55,6 +59,12 @@ export class SAPAnnotationConverter { return target; } + /** + * + * @param target + * @param term + * @param value + */ private addLabel(target: string, term: ODataAnnotations['term'], value: ValueWithOrigin): void { let labels = this.labels.get(target); if (!labels) { @@ -86,6 +96,10 @@ export class SAPAnnotationConverter { return target; } + /** + * + * @param annotations + */ private processLineItems(annotations: ODataAnnotations[]): void { const definitions = annotations.filter( (annotation): annotation is UILineItemDefinition => annotation.term === UI_LINE_ITEM @@ -117,6 +131,10 @@ export class SAPAnnotationConverter { } } + /** + * + * @param annotations + */ private processFieldGroups(annotations: ODataAnnotations[]): void { const definitions = annotations.filter( (annotation): annotation is UIFieldGroupDefinition => annotation.term === UI_FIELD_GROUP diff --git a/packages/fiori-annotation-api/src/xml/adapter.ts b/packages/fiori-annotation-api/src/xml/adapter.ts index 92d4514a247..83b6060492e 100644 --- a/packages/fiori-annotation-api/src/xml/adapter.ts +++ b/packages/fiori-annotation-api/src/xml/adapter.ts @@ -75,6 +75,10 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { private documents = new Map(); private metadata: MetadataElement[] = []; + /** + * + * @param fileCache + */ private setFileCache(fileCache: Map) { this.fileCache = fileCache; } @@ -90,6 +94,9 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { } return this._compiledService; } + /** + * + */ private set compiledService(v: CompiledService) { this._compiledService = v; } @@ -258,6 +265,10 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { return serializeTarget(target); } + /** + * + * @param metadataNamespace + */ private getUniqueNamespace(metadataNamespace: string): string { const namespaces = new Set(); this.documents.forEach((document) => { @@ -278,6 +289,9 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { return newNamespace; } + /** + * + */ private _getCompiledService(): CompiledService { const files = [this.service.metadataFile, ...this.service.annotationFiles]; const annotationFiles: AnnotationFile[] = []; @@ -296,6 +310,13 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { }); } + /** + * + * @param document + * @param writer + * @param targetChildReferences + * @param change + */ private processChange( document: Document, writer: XMLWriter, @@ -460,6 +481,12 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { } } + /** + * + * @param targetChildReferences + * @param parentPointer + * @param element + */ private getTargetChildReferences( targetChildReferences: Map>, parentPointer: string, @@ -482,6 +509,12 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { return pointerSet; } + /** + * + * @param targetChildReferences + * @param fullPointer + * @param element + */ private markElementDeletion( targetChildReferences: Map>, fullPointer: string, @@ -492,6 +525,12 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { annotationReferences.delete(fullPointer); } + /** + * + * @param targetChildReferences + * @param fullPointer + * @param element + */ private markElementInsertion( targetChildReferences: Map>, fullPointer: string, @@ -501,6 +540,12 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { annotationReferences.add(`${fullPointer}/subElements/-1`); } + /** + * + * @param uri + * @param writer + * @param edits + */ private postprocessEdits(uri: string, writer: XMLWriter, edits: TextEdit[]): TextEdit[] { const file = this.fileCache.get(uri); const document = this.documents.get(uri); @@ -518,6 +563,12 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { return []; } + /** + * + * @param uri + * @param writer + * @param ast + */ private updateReferences(uri: string, writer: XMLWriter, ast: XMLDocument): boolean { const document = this.documents.get(uri); if (!document) { @@ -536,6 +587,14 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { return deletions || inserts; } + /** + * + * @param writer + * @param document + * @param aliasInfo + * @param usedNames + * @param pointer + */ private removeReferences( writer: XMLWriter, document: Document, @@ -571,6 +630,14 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { return toRemove.size > 0; } + /** + * + * @param writer + * @param document + * @param aliasInfo + * @param usedNames + * @param pointer + */ private addReferences( writer: XMLWriter, document: Document, @@ -642,12 +709,21 @@ export class XMLAnnotationServiceAdapter implements AnnotationServiceAdapter { } } +/** + * + * @param condition + * @param message + */ function throwIf(condition: boolean, message: string): void { if (condition) { throw new ApiError(message, ApiErrorCode.General); } } +/** + * + * @param reference + */ function createReferenceElement(reference: Reference): Element { const include = createElementNode({ name: Edmx.Include, @@ -669,6 +745,10 @@ function createReferenceElement(reference: Reference): Element { }); } +/** + * + * @param document + */ function getEdmxPointer(document: XMLDocument): string | undefined { if (!document.rootElement) { return undefined; @@ -677,6 +757,10 @@ function getEdmxPointer(document: XMLDocument): string | undefined { return `/rootElement`; } +/** + * + * @param document + */ function getSchemaPointer(document: XMLDocument): string | undefined { if (!document.rootElement) { return undefined; @@ -697,6 +781,12 @@ function getSchemaPointer(document: XMLDocument): string | undefined { return `/rootElement/subElements/${dataServicesIndex}/subElements/${schemaIndex}`; } +/** + * + * @param fileCache + * @param file + * @param ignoreComments + */ function parseFile( fileCache: Map, file: TextFile, @@ -713,6 +803,11 @@ function parseFile( } type Node = AnyNode | ElementChild[]; +/** + * + * @param annotationFile + * @param pointer + */ function convertPointer(annotationFile: AnnotationFile, pointer: string): string { let currentNode: Node | undefined = annotationFile; return pointer @@ -738,6 +833,11 @@ function convertPointer(annotationFile: AnnotationFile, pointer: string): string .join('/'); } +/** + * + * @param segment + * @param currentNode + */ function convertPointerSegment( segment: string, currentNode: Node @@ -763,6 +863,11 @@ function convertPointerSegment( return { mappedSegment, nextNode }; } +/** + * + * @param annotationFileInternal + * @param metadataService + */ function getAliasInfo(annotationFileInternal: AnnotationFile, metadataService: MetadataService): AliasInformation { const namespaces = getAllNamespacesAndReferences( annotationFileInternal.namespace, diff --git a/packages/fiori-annotation-api/src/xml/references.ts b/packages/fiori-annotation-api/src/xml/references.ts index e5e9a78ac73..37358dbc32a 100644 --- a/packages/fiori-annotation-api/src/xml/references.ts +++ b/packages/fiori-annotation-api/src/xml/references.ts @@ -37,6 +37,11 @@ export function collectUsedNamespaces(element: AnyNode, namespacesOrAliases: Set const PATH_LIKE_VALUES: string[] = [Edm.Path, Edm.PropertyPath, Edm.NavigationPropertyPath, Edm.AnnotationPath]; +/** + * + * @param element + * @param namespacesOrAliases + */ function processElement(element: Element, namespacesOrAliases: Set): void { if (element.name === Edm.Annotation) { const term = element.attributes[Edm.Term]; @@ -59,6 +64,11 @@ function processElement(element: Element, namespacesOrAliases: Set): voi processPathLikeElement(element, namespacesOrAliases); } +/** + * + * @param element + * @param namespacesOrAliases + */ function processPathLikeElement(element: Element, namespacesOrAliases: Set): void { if (PATH_LIKE_VALUES.includes(element.name)) { const textNode = element.content.find((node): node is TextNode => node.type === TEXT_TYPE); @@ -78,6 +88,11 @@ function processPathLikeElement(element: Element, namespacesOrAliases: Set): void { const path = parsePath(rawPath); for (const segment of path.segments) { diff --git a/packages/fiori-annotation-api/src/xml/service.ts b/packages/fiori-annotation-api/src/xml/service.ts index 803a68f3abc..0c889d6cfcf 100644 --- a/packages/fiori-annotation-api/src/xml/service.ts +++ b/packages/fiori-annotation-api/src/xml/service.ts @@ -48,6 +48,11 @@ export function getLocalEDMXService(project: Project, serviceName: string, appNa }; } +/** + * + * @param requestedAppName + * @param project + */ function adjustAppNameByProjectData(requestedAppName: string | undefined, project: Project): string { if (requestedAppName && project.apps[requestedAppName]) { return requestedAppName; diff --git a/packages/fiori-annotation-api/src/xml/writer.ts b/packages/fiori-annotation-api/src/xml/writer.ts index 40cf09d2505..05485a0f3cb 100644 --- a/packages/fiori-annotation-api/src/xml/writer.ts +++ b/packages/fiori-annotation-api/src/xml/writer.ts @@ -55,7 +55,11 @@ export class XMLWriter { * @param comments - Array of all the comments in the document. * @param textDocument - TextDocument instance. */ - constructor(private document: XMLDocument, private comments: Comment[], private textDocument: TextDocument) {} + constructor( + private document: XMLDocument, + private comments: Comment[], + private textDocument: TextDocument + ) {} /** * Adds a new change to the change stack. * @@ -81,6 +85,10 @@ export class XMLWriter { return edits; } + /** + * + * @param element + */ private getContent(element: XMLElement): ElementContent[] { let content = this.elementContentCache.get(element); if (!content) { @@ -90,6 +98,11 @@ export class XMLWriter { return content; } + /** + * + * @param pointer + * @param byType + */ private getTextEditsForPointer( pointer: string, byType: Map @@ -137,6 +150,18 @@ export class XMLWriter { return edits; } + /** + * + * @param elementChanges + * @param elementChanges.replacements + * @param elementChanges.contentReplacements + * @param elementChanges.elementDeletions + * @param elementChanges.attributeInserts + * @param elementChanges.moveInCollection + * @param element + * @param pointer + * @param childIndentLevel + */ private handleXmlElementChanges( elementChanges: { replacements: ReplaceElement[]; @@ -176,6 +201,10 @@ export class XMLWriter { return edits; } + /** + * + * @param moveChange + */ private prepareXmlElementMoveChange(moveChange: MoveCollectionValue): { textEdits: TextEdit[]; text: string[]; @@ -196,6 +225,14 @@ export class XMLWriter { } } +/** + * + * @param attributeChanges + * @param attributeChanges.attributeDeletions + * @param attributeChanges.attributeNameUpdates + * @param attributeChanges.attributeValueUpdates + * @param element + */ function handleXmlAttributeChanges( attributeChanges: { attributeDeletions: DeleteAttribute[]; @@ -234,6 +271,11 @@ function handleXmlAttributeChanges( return edits; } +/** + * + * @param element + * @param attributeInserts + */ function handleXmlElementAttributeInserts(element: XMLElement, attributeInserts: InsertAttribute[]): TextEdit[] { const openTagRange = transformRange(element.syntax.openBody); if (!openTagRange) { @@ -268,6 +310,10 @@ function handleXmlElementAttributeInserts(element: XMLElement, attributeInserts: return edits; } +/** + * + * @param text + */ function getTextFragmentOffset(text: string): number { const lines = text.split('\n'); const linesWithTextIndices = lines.map((line, idx) => (line.length > 0 ? idx : -1)); @@ -279,6 +325,11 @@ function getTextFragmentOffset(text: string): number { return indentLineText.length - indentLineText.trimStart().length; } +/** + * + * @param text + * @param requiredIndent + */ function adjustFragmentIndentation(text: string, requiredIndent: number): string { const requiredOffset = requiredIndent * 4; const actual = getTextFragmentOffset(text); @@ -302,6 +353,13 @@ function adjustFragmentIndentation(text: string, requiredIndent: number): string return lines.join('\n'); } +/** + * + * @param element + * @param childIndentLevel + * @param text + * @param insertPosition + */ function handleXmlElementMoveChange( element: XMLElement, childIndentLevel: number, @@ -330,6 +388,12 @@ function handleXmlElementMoveChange( return edits; } +/** + * + * @param element + * @param contentReplacements + * @param childIndentLevel + */ function handleXmlElementContentReplacements( element: XMLElement, contentReplacements: ReplaceElementContent[], @@ -359,6 +423,12 @@ function handleXmlElementContentReplacements( return edits; } +/** + * + * @param element + * @param replacements + * @param childIndentLevel + */ function handleXmlElementReplacements( element: XMLElement, replacements: ReplaceElement[], @@ -378,6 +448,13 @@ function handleXmlElementReplacements( return edits; } +/** + * + * @param parent + * @param pointer + * @param content + * @param element + */ function handleXmlElementDeletions( parent: XMLDocument | XMLElement, pointer: string, @@ -414,6 +491,11 @@ function handleXmlElementDeletions( return edits; } +/** + * + * @param elementNameUpdates + * @param element + */ function convertUpdateElementNameToTextEdits( elementNameUpdates: UpdateElementName[], element: XMLAstNode | undefined @@ -438,6 +520,10 @@ function convertUpdateElementNameToTextEdits( return edits; } +/** + * + * @param changes + */ function getBatches(changes: XMLDocumentChange[]): { [pointer: string]: Map; } { @@ -458,6 +544,12 @@ function getBatches(changes: XMLDocumentChange[]): { return batches; } +/** + * + * @param element + * @param openTagRange + * @param index + */ function getAttributeInsertPosition( element: XMLElement, openTagRange: Range, @@ -481,6 +573,13 @@ function getAttributeInsertPosition( return Position.create(range.start.line, range.start.character - 1); } +/** + * + * @param comments + * @param element + * @param changes + * @param childIndentLevel + */ function convertInsertElementToTextEdits( comments: Comment[], element: XMLElement | undefined, @@ -526,6 +625,14 @@ function convertInsertElementToTextEdits( } } +/** + * + * @param comments + * @param element + * @param changes + * @param childIndentLevel + * @param namespaceMap + */ function insertIntoElementWithContent( comments: Comment[], element: XMLElement, @@ -571,6 +678,10 @@ function insertIntoElementWithContent( return edits; } +/** + * + * @param changes + */ function indexInserts(changes: InsertElement[]): [(number | undefined)[], Map] { const changesByIndex = new Map(); const indices: (number | undefined)[] = []; @@ -586,6 +697,12 @@ function indexInserts(changes: InsertElement[]): [(number | undefined)[], Map(a: T, b: T): number { const aRange = a.range ?? transformRange(a.syntax?.closeBody ?? a.syntax?.openBody); const bRange = b.range ?? transformRange(b.syntax?.closeBody ?? b.syntax?.openBody); @@ -841,6 +1005,12 @@ function compareRange(); @@ -1061,6 +1279,10 @@ function combineInsertsWithDeletions(changes: XMLDocumentChange[], document: XML return result; } +/** + * + * @param changes + */ function removeDuplicates(changes: XMLDocumentChange[]): XMLDocumentChange[] { const existingDeletions: string[] = []; const result: XMLDocumentChange[] = []; @@ -1077,6 +1299,10 @@ function removeDuplicates(changes: XMLDocumentChange[]): XMLDocumentChange[] { return result; } +/** + * + * @param changes + */ function removeOverlappingDeletes(changes: XMLDocumentChange[]): XMLDocumentChange[] { const result: XMLDocumentChange[] = []; const deletions = new Set(); diff --git a/packages/fiori-annotation-api/test/unit/fiori-service.test.ts b/packages/fiori-annotation-api/test/unit/fiori-service.test.ts index 55d12d49aed..e7c48f7df4c 100644 --- a/packages/fiori-annotation-api/test/unit/fiori-service.test.ts +++ b/packages/fiori-annotation-api/test/unit/fiori-service.test.ts @@ -146,7 +146,7 @@ const createEditTestCase = (>(): CustomTest } } }; - // eslint-disable-next-line @typescript-eslint/no-explicit-any + const runner: any = (testCase: EditTestCase, timeout?: number): void => { describe(testCase.name, run(testCase, timeout)); }; diff --git a/packages/fiori-app-sub-generator/.eslintignore b/packages/fiori-app-sub-generator/.eslintignore deleted file mode 100644 index 504e542490a..00000000000 --- a/packages/fiori-app-sub-generator/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -generators -/test/int/fiori-elements/expected-output -/test/int/fiori-freestyle/expected-output \ No newline at end of file diff --git a/packages/fiori-app-sub-generator/.eslintrc.js b/packages/fiori-app-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/fiori-app-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/fiori-app-sub-generator/eslint.config.js b/packages/fiori-app-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/fiori-app-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/fiori-app-sub-generator/src/fiori-app-generator/fioriAppGeneratorOptions.ts b/packages/fiori-app-sub-generator/src/fiori-app-generator/fioriAppGeneratorOptions.ts index 183734f6563..a629177dce5 100644 --- a/packages/fiori-app-sub-generator/src/fiori-app-generator/fioriAppGeneratorOptions.ts +++ b/packages/fiori-app-sub-generator/src/fiori-app-generator/fioriAppGeneratorOptions.ts @@ -31,7 +31,7 @@ export interface FioriAppGeneratorOptions extends Generator.GeneratorOptions, Fi * Additional (non-specified option) data may be passed using this property. e.g. Adaptor data * todo: External -> FioriGeneratorOptions */ - data?: Object; // todo: Is this used anywhere? Adaptors set state directly + data?: object; // todo: Is this used anywhere? Adaptors set state directly /** * Customer provided extensions used to customize existing questions * diff --git a/packages/fiori-app-sub-generator/src/fiori-app-generator/prompting.ts b/packages/fiori-app-sub-generator/src/fiori-app-generator/prompting.ts index 13f3cd89cb3..328848a68f2 100644 --- a/packages/fiori-app-sub-generator/src/fiori-app-generator/prompting.ts +++ b/packages/fiori-app-sub-generator/src/fiori-app-generator/prompting.ts @@ -118,9 +118,8 @@ export async function promptUI5ApplicationAnswers( ): Promise<{ ui5AppAnswers: UI5ApplicationAnswers; localUI5Version: string | undefined }> { let inquirerAdapter; // type `any` will be replaced when we can import ESM modules - // eslint-disable-next-line @typescript-eslint/no-explicit-any + if ((adapter as any)?.actualAdapter) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any inquirerAdapter = (adapter as any).actualAdapter; } else { inquirerAdapter = adapter; @@ -171,9 +170,8 @@ export async function promptOdataServiceAnswers( ): Promise { let inquirerAdapter; // type `any` will be replaced when we can import ESM modules - // eslint-disable-next-line @typescript-eslint/no-explicit-any + if ((adapter as any)?.actualAdapter) { - // eslint-disable-next-line @typescript-eslint/no-explicit-any inquirerAdapter = (adapter as any).actualAdapter; } else { inquirerAdapter = adapter; diff --git a/packages/fiori-app-sub-generator/src/fiori-app-generator/writing.ts b/packages/fiori-app-sub-generator/src/fiori-app-generator/writing.ts index 3d2e55c8f85..fd29ea10cdf 100644 --- a/packages/fiori-app-sub-generator/src/fiori-app-generator/writing.ts +++ b/packages/fiori-app-sub-generator/src/fiori-app-generator/writing.ts @@ -48,7 +48,7 @@ export async function writeAppGenInfoFiles( template: templateLabel, serviceType: datasourceLabel, serviceUrl: - `${service.capService ? DEFAULT_CAP_HOST : service.host ?? ''}${service.servicePath ?? ''}` || + `${service.capService ? DEFAULT_CAP_HOST : (service.host ?? '')}${service.servicePath ?? ''}` || t('texts.notApplicable') } as Partial, existingAppGenInfo, diff --git a/packages/fiori-app-sub-generator/src/utils/common.ts b/packages/fiori-app-sub-generator/src/utils/common.ts index f49b6e353d1..1a535ea1317 100644 --- a/packages/fiori-app-sub-generator/src/utils/common.ts +++ b/packages/fiori-app-sub-generator/src/utils/common.ts @@ -258,7 +258,7 @@ export async function generateLaunchConfig( vscode: vscode, addStartCmd, sapClientParam: options.sapClientParam, - flpAppId: options?.enableVirtualEndpoints ? 'app-preview' : options.flpAppId ?? '', + flpAppId: options?.enableVirtualEndpoints ? 'app-preview' : (options.flpAppId ?? ''), flpSandboxAvailable: !options?.enableVirtualEndpoints, isAppStudio: isAppStudio(), writeToAppOnly diff --git a/packages/fiori-app-sub-generator/test/int/fiori-elements/headless.test.ts b/packages/fiori-app-sub-generator/test/int/fiori-elements/headless.test.ts index 97fd408e1db..24cff250b18 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-elements/headless.test.ts +++ b/packages/fiori-app-sub-generator/test/int/fiori-elements/headless.test.ts @@ -77,7 +77,6 @@ async function runHeadlessGen( // Replace CAP project paths in test files with an absolute path to test CAP project if (appConfig.service?.capService?.projectPath && capProjectRoot) { - // eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-expect-error - assigning to a read-only property for testing appConfig.service.capService.projectPath = capProjectRoot; } @@ -123,11 +122,8 @@ describe('Headless generation', () => { cleanTestDir(testDir); } process.chdir(originalCwd); - } catch { - () => { - // Needed for lint - }; - } + // eslint-disable-next-line no-empty + } catch {} }); it('LROP v2', async () => { diff --git a/packages/fiori-app-sub-generator/test/int/fiori-elements/options.test.ts b/packages/fiori-app-sub-generator/test/int/fiori-elements/options.test.ts index 2491d61e55b..e3432b96740 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-elements/options.test.ts +++ b/packages/fiori-app-sub-generator/test/int/fiori-elements/options.test.ts @@ -40,11 +40,8 @@ describe('Optional settings', () => { cleanTestDir(testDir); } process.chdir(originalCwd); - } catch { - () => { - // Needed for lint - }; - } + // eslint-disable-next-line no-empty + } catch {} }); beforeEach(() => { diff --git a/packages/fiori-app-sub-generator/test/int/fiori-elements/writing-v2.test.ts b/packages/fiori-app-sub-generator/test/int/fiori-elements/writing-v2.test.ts index 07edd3faa30..4864a7850a5 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-elements/writing-v2.test.ts +++ b/packages/fiori-app-sub-generator/test/int/fiori-elements/writing-v2.test.ts @@ -46,11 +46,8 @@ describe('Generate v2 apps', () => { } console.log(`Restoring cwd: ${originalCwd}`); process.chdir(originalCwd); - } catch { - () => { - // Needed for lint - }; - } + // eslint-disable-next-line no-empty + } catch {} }); it('LROP v2 - URL', async () => { diff --git a/packages/fiori-app-sub-generator/test/int/fiori-elements/writing-v4.test.ts b/packages/fiori-app-sub-generator/test/int/fiori-elements/writing-v4.test.ts index f9fbcd8d300..cceece4e499 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-elements/writing-v4.test.ts +++ b/packages/fiori-app-sub-generator/test/int/fiori-elements/writing-v4.test.ts @@ -47,11 +47,9 @@ describe('Generate v4 apps', () => { } console.log(`Restoring cwd: ${originalCwd}`); process.chdir(originalCwd); - } catch { - () => { - // Needed for lint - }; - } + + // eslint-disable-next-line no-empty + } catch {} }); jest.setTimeout(400000); diff --git a/packages/fiori-app-sub-generator/test/int/fiori-freestyle/expected-output/simple_eslint/package.json b/packages/fiori-app-sub-generator/test/int/fiori-freestyle/expected-output/simple_eslint/package.json index c82cd8bc671..5aba3b42f0e 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-freestyle/expected-output/simple_eslint/package.json +++ b/packages/fiori-app-sub-generator/test/int/fiori-freestyle/expected-output/simple_eslint/package.json @@ -12,10 +12,10 @@ "devDependencies": { "@ui5/cli": "^4.0.16", "@sap/ux-ui5-tooling": "1", - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0", - "eslint": "8.57.0", + "@sap-ux/eslint-plugin-fiori-tools": "^0.5.0", + "eslint": "^9", "eslint-plugin-fiori-custom": "2.6.7", - "@babel/eslint-parser": "7.14.7" + "@babel/eslint-parser": "^7.27.0" }, "scripts": { "start": "fiori run --open \"test/flp.html#app-preview\"", diff --git a/packages/fiori-app-sub-generator/test/int/fiori-freestyle/expected-output/simple_typescript/package.json b/packages/fiori-app-sub-generator/test/int/fiori-freestyle/expected-output/simple_typescript/package.json index 13b337ed7c6..e53aa0d9f28 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-freestyle/expected-output/simple_typescript/package.json +++ b/packages/fiori-app-sub-generator/test/int/fiori-freestyle/expected-output/simple_typescript/package.json @@ -15,9 +15,9 @@ "@sapui5/ts-types-esm": "~1.102.0", "ui5-tooling-transpile": "^3.3.7", "typescript": "^5.1.6", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0" + "@eslint": "^9.38.0", + "@typescript-eslint": "^8.27.0", + "@sap-ux/eslint-plugin-fiori-tools": "^9.0.0" }, "scripts": { "start": "fiori run --open \"test/flp.html#app-preview\"", diff --git a/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/fioriAppGenerator-lifecycle1.test.ts b/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/fioriAppGenerator-lifecycle1.test.ts index 0e9ec1e7460..53357603c24 100644 --- a/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/fioriAppGenerator-lifecycle1.test.ts +++ b/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/fioriAppGenerator-lifecycle1.test.ts @@ -14,16 +14,15 @@ import yeomanTest from 'yeoman-test'; import { FioriAppGenerator, type FioriAppGeneratorOptions } from '../../../src/fiori-app-generator'; import { promptOdataServiceAnswers, promptUI5ApplicationAnswers } from '../../../src/fiori-app-generator/prompting'; import { addDeployGen, addFlpGen } from '../../../src/fiori-app-generator/subgenHelpers'; -import type { Project } from '../../../src/types'; import { FIORI_STEPS, FloorplanFE, FloorplanFF, - type Service, STEP_DATASOURCE_AND_SERVICE, STEP_FLP_CONFIG, STEP_PROJECT_ATTRIBUTES } from '../../../src/types'; +import type { Project, Service } from '../../../src/types'; import * as commonUtils from '../../../src/utils'; import { type AppWizardCache, diff --git a/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/install.test.ts b/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/install.test.ts index ad991da6a9b..254be87f84e 100644 --- a/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/install.test.ts +++ b/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/install.test.ts @@ -4,7 +4,7 @@ import childProcess from 'child_process'; import os from 'node:os'; import { installDependencies } from '../../../src/fiori-app-generator/install'; import { CommandRunner, initI18nFioriAppSubGenerator, t } from '../../../src/utils'; -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-require-imports const mockSpawn = require('mock-spawn'); jest.mock('@sap-ux/fiori-generator-shared', () => ({ diff --git a/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/prompting.test.ts b/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/prompting.test.ts index 00056766e42..fc4a4bb6c79 100644 --- a/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/prompting.test.ts +++ b/packages/fiori-app-sub-generator/test/unit/fiori-app-generator/prompting.test.ts @@ -451,7 +451,7 @@ describe('prompting.ts', () => { const getUI5VersionSpy = jest.spyOn(ui5Info, 'getUI5Versions').mockResolvedValue([{ version: '1.1.1' }]); const ui5ApplicationInquirerSpy = jest .spyOn(ui5ApplicationInquirer, 'prompt') - .mockImplementation(async () => ({ ui5Version: '9.9.9' } as UI5ApplicationAnswers)); + .mockImplementation(async () => ({ ui5Version: '9.9.9' }) as UI5ApplicationAnswers); expect( await promptUI5ApplicationAnswers( { diff --git a/packages/fiori-app-sub-generator/test/unit/utils/command-runner.test.ts b/packages/fiori-app-sub-generator/test/unit/utils/command-runner.test.ts index b4274ec60c1..a114a0a6203 100644 --- a/packages/fiori-app-sub-generator/test/unit/utils/command-runner.test.ts +++ b/packages/fiori-app-sub-generator/test/unit/utils/command-runner.test.ts @@ -2,7 +2,7 @@ import { CommandRunner } from '../../../src/utils/command-runner'; import { initI18nFioriAppSubGenerator } from '../../../src/utils/i18n'; import { platform } from 'node:os'; import childProcess from 'child_process'; -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-require-imports const mockSpawn = require('mock-spawn'); describe('Test command-runner', () => { diff --git a/packages/fiori-app-sub-generator/test/unit/utils/common.test.ts b/packages/fiori-app-sub-generator/test/unit/utils/common.test.ts index 4543c29e173..2dc1efe6568 100644 --- a/packages/fiori-app-sub-generator/test/unit/utils/common.test.ts +++ b/packages/fiori-app-sub-generator/test/unit/utils/common.test.ts @@ -35,7 +35,6 @@ import type { Logger } from '@sap-ux/logger'; const getProjectTypeMock = jest.fn(); jest.mock('@sap-ux/project-access', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/project-access') as object), getProjectType: () => getProjectTypeMock() })); diff --git a/packages/fiori-docs-embeddings/.eslintignore b/packages/fiori-docs-embeddings/.eslintignore deleted file mode 100644 index b8dd4b439fc..00000000000 --- a/packages/fiori-docs-embeddings/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -data -coverage \ No newline at end of file diff --git a/packages/fiori-docs-embeddings/.eslintrc.js b/packages/fiori-docs-embeddings/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/fiori-docs-embeddings/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/fiori-docs-embeddings/eslint.config.js b/packages/fiori-docs-embeddings/eslint.config.js new file mode 100644 index 00000000000..aa0a1fe7028 --- /dev/null +++ b/packages/fiori-docs-embeddings/eslint.config.js @@ -0,0 +1,16 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + { + ignores: ['dist/**', 'data/**', 'coverage/**', 'index.js'], + }, + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/fiori-docs-embeddings/test/build-fpm-docs.test.ts b/packages/fiori-docs-embeddings/test/build-fpm-docs.test.ts index 8288f5069aa..4c4520b6d06 100644 --- a/packages/fiori-docs-embeddings/test/build-fpm-docs.test.ts +++ b/packages/fiori-docs-embeddings/test/build-fpm-docs.test.ts @@ -1370,7 +1370,7 @@ describe('FpmDocumentationBuilder', () => { process.env.GITHUB_TOKEN = 'test-token'; // Setup XMLParser mock to return valid parsed data - const { XMLParser } = require('fast-xml-parser'); // eslint-disable-line @typescript-eslint/no-var-requires + const { XMLParser } = jest.requireMock('fast-xml-parser') as { XMLParser: jest.Mock }; const mockParse = jest.fn().mockReturnValue({ 'mvc:View': { 'fpmExplorer:Page': { @@ -1497,7 +1497,7 @@ describe('FpmDocumentationBuilder', () => { process.env.GITHUB_TOKEN = 'test-token'; // Setup XMLParser mock to return empty structure (no implementation steps) - const { XMLParser } = require('fast-xml-parser'); // eslint-disable-line @typescript-eslint/no-var-requires + const { XMLParser } = jest.requireMock('fast-xml-parser') as { XMLParser: jest.Mock }; const mockParse = jest.fn().mockReturnValue({ 'mvc:View': { 'fpmExplorer:Page': { diff --git a/packages/fiori-elements-writer/.eslintignore b/packages/fiori-elements-writer/.eslintignore deleted file mode 100644 index 9be6e1b137f..00000000000 --- a/packages/fiori-elements-writer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -dist -templates \ No newline at end of file diff --git a/packages/fiori-elements-writer/.eslintrc.js b/packages/fiori-elements-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/fiori-elements-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/fiori-elements-writer/eslint.config.js b/packages/fiori-elements-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/fiori-elements-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap index 8c4d26ec91d..3c8ba15c3ee 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/feop.test.ts.snap @@ -3720,9 +3720,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { diff --git a/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap index bd8213c24ae..b525ce30e86 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/fpm.test.ts.snap @@ -3738,9 +3738,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.96.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { diff --git a/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap index 52267f746c5..72cc0a28c95 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/lrop.test.ts.snap @@ -7311,9 +7311,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -24188,9 +24188,9 @@ Object { \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\" + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\" }, \\"scripts\\": { \\"deploy-config\\": \\"npx -p @sap/ux-ui5-tooling fiori add deploy-config cf\\" @@ -47841,9 +47841,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.108.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -51343,9 +51343,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.111.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -54845,9 +54845,9 @@ archive.zip \\"@sapui5/types\\": \\"~1.113.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { diff --git a/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap b/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap index 2f330360f76..cb8731078cc 100644 --- a/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap +++ b/packages/fiori-elements-writer/test/__snapshots__/ovp.test.ts.snap @@ -1746,9 +1746,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -9267,9 +9267,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.97.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { diff --git a/packages/fiori-elements-writer/test/common.ts b/packages/fiori-elements-writer/test/common.ts index d7b5f4abafb..486be1a7f8a 100644 --- a/packages/fiori-elements-writer/test/common.ts +++ b/packages/fiori-elements-writer/test/common.ts @@ -1,5 +1,5 @@ import type { OdataService } from '@sap-ux/odata-service-writer'; -import { OdataVersion } from '@sap-ux/odata-service-writer'; +import { OdataVersion, ServiceType } from '@sap-ux/odata-service-writer'; import { readFileSync } from 'node:fs'; import { create as createStore } from 'mem-fs'; import type { Editor } from 'mem-fs-editor'; @@ -16,7 +16,6 @@ import { import { promisify } from 'util'; import { exec as execCP } from 'child_process'; const exec = promisify(execCP); -import { ServiceType } from '@sap-ux/odata-service-writer'; import { type CapServiceCdsInfo } from '@sap-ux/cap-config-writer'; export const testOutputDir = join(__dirname, 'test-output'); diff --git a/packages/fiori-elements-writer/test/lrop.test.ts b/packages/fiori-elements-writer/test/lrop.test.ts index 1bd8946ed63..b2e6366147c 100644 --- a/packages/fiori-elements-writer/test/lrop.test.ts +++ b/packages/fiori-elements-writer/test/lrop.test.ts @@ -2,7 +2,7 @@ import type { FioriElementsApp, LROPSettings } from '../src'; import { generate, TableType, TemplateType } from '../src'; import { join } from 'node:path'; import { removeSync } from 'fs-extra'; -import { OdataVersion } from '@sap-ux/odata-service-writer'; +import { OdataVersion, ServiceType } from '@sap-ux/odata-service-writer'; import { testOutputDir, debug, @@ -18,7 +18,6 @@ import { applyBaseConfigToFEApp, sampleCapService } from './common'; -import { ServiceType } from '@sap-ux/odata-service-writer'; import { type OdataService } from '@sap-ux/odata-service-writer'; import { applyCAPUpdates, type CapServiceCdsInfo } from '@sap-ux/cap-config-writer'; import { create as createStorage } from 'mem-fs'; diff --git a/packages/fiori-freestyle-writer/.eslintignore b/packages/fiori-freestyle-writer/.eslintignore deleted file mode 100644 index db16198b37d..00000000000 --- a/packages/fiori-freestyle-writer/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -test/test-output -test/test-input -dist -templates/ \ No newline at end of file diff --git a/packages/fiori-freestyle-writer/.eslintrc.js b/packages/fiori-freestyle-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/fiori-freestyle-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/fiori-freestyle-writer/eslint.config.js b/packages/fiori-freestyle-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/fiori-freestyle-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap index 7f04eee5708..681dbc29bff 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/basic.test.ts.snap @@ -707,9 +707,9 @@ Object { \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\" + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\" }, \\"scripts\\": { \\"deploy-config\\": \\"npx -p @sap/ux-ui5-tooling fiori add deploy-config cf\\" @@ -2172,9 +2172,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -3059,9 +3059,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.108.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -3935,9 +3935,9 @@ archive.zip \\"@sapui5/types\\": \\"~1.114.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -4579,9 +4579,9 @@ archive.zip \\"@sapui5/types\\": \\"~1.120.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -5765,10 +5765,10 @@ archive.zip \\"devDependencies\\": { \\"@ui5/cli\\": \\"^4.0.16\\", \\"@sap/ux-ui5-tooling\\": \\"1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", - \\"eslint\\": \\"8.57.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.5.0\\", + \\"eslint\\": \\"^9\\", \\"eslint-plugin-fiori-custom\\": \\"2.6.7\\", - \\"@babel/eslint-parser\\": \\"7.14.7\\", + \\"@babel/eslint-parser\\": \\"^7.27.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap index 1da31e8de02..020d8215489 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/listdetail.test.ts.snap @@ -41,9 +41,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -2768,9 +2768,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.108.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -5495,9 +5495,9 @@ archive.zip \\"@sapui5/types\\": \\"~1.113.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -8222,12 +8222,12 @@ archive.zip \\"devDependencies\\": { \\"@ui5/cli\\": \\"^4.0.16\\", \\"@sap/ux-ui5-tooling\\": \\"1\\", - \\"eslint\\": \\"8.57.0\\", + \\"eslint\\": \\"^9\\", \\"@sap/eslint-plugin-ui5-jsdocs\\": \\"2.0.5\\", \\"@sapui5/ts-types\\": \\"~1.76.0\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.5.0\\", \\"eslint-plugin-fiori-custom\\": \\"2.6.7\\", - \\"@babel/eslint-parser\\": \\"7.14.7\\", + \\"@babel/eslint-parser\\": \\"^7.27.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -10807,9 +10807,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { diff --git a/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap b/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap index 40aa5fdbc33..419e40a5d20 100644 --- a/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap +++ b/packages/fiori-freestyle-writer/test/__snapshots__/worklist.test.ts.snap @@ -13148,9 +13148,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { @@ -16555,9 +16555,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.108.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"@sap-ux/ui5-middleware-fe-mockserver\\": \\"2\\" }, \\"scripts\\": { diff --git a/packages/fiori-freestyle-writer/test/basic.test.ts b/packages/fiori-freestyle-writer/test/basic.test.ts index 6a82f0bc342..0447446d8a3 100644 --- a/packages/fiori-freestyle-writer/test/basic.test.ts +++ b/packages/fiori-freestyle-writer/test/basic.test.ts @@ -2,10 +2,9 @@ import type { FreestyleApp } from '../src'; import { generate, TemplateType } from '../src'; import { join } from 'node:path'; import { removeSync } from 'fs-extra'; -import { testOutputDir, debug, updatePackageJSONDependencyToUseLocalPath } from './common'; +import { testOutputDir, debug, updatePackageJSONDependencyToUseLocalPath, projectChecks } from './common'; import { OdataVersion, ServiceType } from '@sap-ux/odata-service-writer'; import type { BasicAppSettings } from '../src/types'; -import { projectChecks } from './common'; import { applyCAPUpdates, type CapServiceCdsInfo } from '@sap-ux/cap-config-writer'; import { create as createStorage } from 'mem-fs'; import { create } from 'mem-fs-editor'; diff --git a/packages/fiori-freestyle-writer/test/common.ts b/packages/fiori-freestyle-writer/test/common.ts index e4ee28969af..076538a80bc 100644 --- a/packages/fiori-freestyle-writer/test/common.ts +++ b/packages/fiori-freestyle-writer/test/common.ts @@ -1,5 +1,5 @@ import type { OdataService } from '@sap-ux/odata-service-writer'; -import { OdataVersion } from '@sap-ux/odata-service-writer'; +import { OdataVersion, ServiceType } from '@sap-ux/odata-service-writer'; import { dirname, join } from 'node:path'; import { readFileSync } from 'node:fs'; import { sample } from './sample/metadata'; @@ -10,7 +10,6 @@ import { TemplateType, type FreestyleApp } from '../src'; import { promisify } from 'util'; import { exec as execCP } from 'child_process'; const exec = promisify(execCP); -import { ServiceType } from '@sap-ux/odata-service-writer'; import { compareUI5VersionGte, ui5LtsVersion_1_120 } from '../src/utils'; export const testOutputDir = join(__dirname, '/test-output'); diff --git a/packages/fiori-generator-shared/.eslintignore b/packages/fiori-generator-shared/.eslintignore deleted file mode 100644 index 59f25a165bb..00000000000 --- a/packages/fiori-generator-shared/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -/test/test-output/ -dist diff --git a/packages/fiori-generator-shared/.eslintrc.js b/packages/fiori-generator-shared/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/fiori-generator-shared/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/fiori-generator-shared/eslint.config.js b/packages/fiori-generator-shared/eslint.config.js new file mode 100644 index 00000000000..5fe59c1a97f --- /dev/null +++ b/packages/fiori-generator-shared/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: 'tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/fiori-generator-shared/src/logging/logWrapper.ts b/packages/fiori-generator-shared/src/logging/logWrapper.ts index 3d1010e7e59..5b1d9b51b2f 100644 --- a/packages/fiori-generator-shared/src/logging/logWrapper.ts +++ b/packages/fiori-generator-shared/src/logging/logWrapper.ts @@ -124,7 +124,7 @@ export class LogWrapper implements ILogWrapper, SapUxLogger { if (extLogger) { LogWrapper._logLevel = vscode ? vscode.workspace.getConfiguration().get(LOGGING_LEVEL_CONFIG_PROP) - : logLevel ?? 'info'; + : (logLevel ?? 'info'); LogWrapper._vscodeLogger = extLogger.getChildLogger({ label: logName }); } else { if (!LogWrapper._yoLogger) { diff --git a/packages/fiori-generator-shared/src/npm-package-scripts/getPackageScripts.ts b/packages/fiori-generator-shared/src/npm-package-scripts/getPackageScripts.ts index 912c60d0c4b..45e65d2d3ed 100644 --- a/packages/fiori-generator-shared/src/npm-package-scripts/getPackageScripts.ts +++ b/packages/fiori-generator-shared/src/npm-package-scripts/getPackageScripts.ts @@ -80,7 +80,7 @@ function getVariantPreviewAppScript(addSearchParams: boolean, flpAppId?: string) } // Please keep the special characters in the below command // as removing them may cause the browser to misinterpret the URI components without the necessary escaping and quotes. - // eslint-disable-next-line no-useless-escape + return `fiori run --open \"/preview.html${urlParam}${previewAppAnchor}\"`; } diff --git a/packages/fiori-generator-shared/test/telemetry/utils.test.ts b/packages/fiori-generator-shared/test/telemetry/utils.test.ts index 7f79c73c4c1..8b1f10b1dd5 100644 --- a/packages/fiori-generator-shared/test/telemetry/utils.test.ts +++ b/packages/fiori-generator-shared/test/telemetry/utils.test.ts @@ -15,7 +15,7 @@ describe('Telemetry utils', () => { () => ({ reportEvent: reportEventSpy - } as any) + }) as any ); TelemetryHelper.createTelemetryData(); await sendTelemetry('TEST_EVENT', TelemetryHelper.telemetryData, 'mock/path'); @@ -30,7 +30,7 @@ describe('Telemetry utils', () => { () => ({ reportEventBlocking: reportEventBlockingSpy - } as any) + }) as any ); TelemetryHelper.createTelemetryData(); await sendTelemetryBlocking('TEST_EVENT', TelemetryHelper.telemetryData, 'mock/path'); diff --git a/packages/fiori-mcp-server/.eslintignore b/packages/fiori-mcp-server/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/fiori-mcp-server/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/fiori-mcp-server/.eslintrc.js b/packages/fiori-mcp-server/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/fiori-mcp-server/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/fiori-mcp-server/eslint.config.js b/packages/fiori-mcp-server/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/fiori-mcp-server/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/fiori-mcp-server/src/page-editor-api/api.ts b/packages/fiori-mcp-server/src/page-editor-api/api.ts index a35cc411dc4..1da16ced620 100644 --- a/packages/fiori-mcp-server/src/page-editor-api/api.ts +++ b/packages/fiori-mcp-server/src/page-editor-api/api.ts @@ -19,7 +19,10 @@ export class PageEditorApi { * @param appAccess - The application access object * @param pageId - Optional page identifier */ - constructor(public appAccess: ApplicationAccess, public pageId?: string) { + constructor( + public appAccess: ApplicationAccess, + public pageId?: string + ) { this.ftfsIO = new SapuxFtfsFileIO(appAccess); } diff --git a/packages/fiori-mcp-server/src/page-editor-api/parser/model/PageEditModel.ts b/packages/fiori-mcp-server/src/page-editor-api/parser/model/PageEditModel.ts index e4a17186c42..7d66597f447 100644 --- a/packages/fiori-mcp-server/src/page-editor-api/parser/model/PageEditModel.ts +++ b/packages/fiori-mcp-server/src/page-editor-api/parser/model/PageEditModel.ts @@ -351,7 +351,7 @@ export class PageEditModel { // Validate schema node (params: SchemaParseParams): boolean => { const { currentNode } = params; - // eslint-disable-next-line sonarjs/prefer-single-boolean-return + if (currentNode.hidden) { return false; } @@ -608,8 +608,7 @@ export class PageEditModel { ); const properties = currentNode.properties; const hasPropertyIndex = propertyNames.some( - (propertyName: string) => - currentNode.properties && currentNode.properties[propertyName]?.['propertyIndex'] !== undefined + (propertyName: string) => currentNode.properties?.[propertyName]?.['propertyIndex'] !== undefined ); if (properties && propertyNames.length && hasPropertyIndex) { // Sort properties - if schema have mark diff --git a/packages/fiori-mcp-server/src/page-editor-api/parser/model/table/ColumnsAggregation.ts b/packages/fiori-mcp-server/src/page-editor-api/parser/model/table/ColumnsAggregation.ts index f294b755fcd..49b37f063b7 100644 --- a/packages/fiori-mcp-server/src/page-editor-api/parser/model/table/ColumnsAggregation.ts +++ b/packages/fiori-mcp-server/src/page-editor-api/parser/model/table/ColumnsAggregation.ts @@ -42,7 +42,7 @@ const PAGE_TYPE_DEFAULT_EXTENSION_MAP: Map = * Represents an aggregation for columns objects. */ export class ColumnsAggregation extends ObjectAggregation { - public declare formSchema?: ObjectAggregation; + declare public formSchema?: ObjectAggregation; // Array of end result ordered columns public customColumns: Array = []; private columnKeys: Array = []; diff --git a/packages/fiori-mcp-server/src/page-editor-api/parser/model/utils/annotations.ts b/packages/fiori-mcp-server/src/page-editor-api/parser/model/utils/annotations.ts index b7e285263bb..07babe322fc 100644 --- a/packages/fiori-mcp-server/src/page-editor-api/parser/model/utils/annotations.ts +++ b/packages/fiori-mcp-server/src/page-editor-api/parser/model/utils/annotations.ts @@ -71,7 +71,7 @@ export function nodeMatcher( const element = nodes[index]; const adjustedAnnotationPath = element.annotationPath .split('/') - .map((segment, i) => (i === 1 ? segment.split('.').slice(-1)[0] ?? segment : segment)) + .map((segment, i) => (i === 1 ? (segment.split('.').slice(-1)[0] ?? segment) : segment)) .join('/'); if (annotationPath === element.annotationPath || annotationPath === adjustedAnnotationPath) { return element; diff --git a/packages/fiori-mcp-server/src/server.ts b/packages/fiori-mcp-server/src/server.ts index 01cc20e710b..42c6a40802b 100644 --- a/packages/fiori-mcp-server/src/server.ts +++ b/packages/fiori-mcp-server/src/server.ts @@ -142,7 +142,7 @@ export class FioriFunctionalityServer { * @param result - The result to be converted. * @returns The converted result in CallToolResult format. */ - private convertResultToCallToolResult(result: T | string): CallToolResult { + private convertResultToCallToolResult(result: T | string): CallToolResult { // Handle string results - return them as plain text content if (typeof result === 'string' || result instanceof String) { return { diff --git a/packages/fiori-mcp-server/src/utils/embeddings-path.ts b/packages/fiori-mcp-server/src/utils/embeddings-path.ts index 539a7cb6c51..02ef4039207 100644 --- a/packages/fiori-mcp-server/src/utils/embeddings-path.ts +++ b/packages/fiori-mcp-server/src/utils/embeddings-path.ts @@ -25,7 +25,7 @@ export async function resolveEmbeddingsPath(): Promise<{ // Try to require the embeddings package dynamically let embeddingsPackage: any; try { - // eslint-disable-next-line import/no-extraneous-dependencies,@typescript-eslint/no-unsafe-assignment + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-require-imports embeddingsPackage = require('@sap-ux/fiori-docs-embeddings'); } catch { // Try dynamic import as fallback with proper error handling diff --git a/packages/fiori-mcp-server/test/unit/telemetry.test.ts b/packages/fiori-mcp-server/test/unit/telemetry.test.ts index 8762b93e169..6a310495c91 100644 --- a/packages/fiori-mcp-server/test/unit/telemetry.test.ts +++ b/packages/fiori-mcp-server/test/unit/telemetry.test.ts @@ -1,8 +1,7 @@ -import { TelemetryHelper } from '../../src/telemetry'; +import { TelemetryHelper, mcpServerName } from '../../src/telemetry'; import * as sapUxTelemetry from '@sap-ux/telemetry'; import { ClientFactory } from '@sap-ux/telemetry'; import type { TelemetryData } from '../../src/telemetry'; -import { mcpServerName } from '../../src/telemetry'; describe('TelemetryHelper', () => { const opts = { diff --git a/packages/fiori-mcp-server/test/unit/tools/execute-functionality.test.ts b/packages/fiori-mcp-server/test/unit/tools/execute-functionality.test.ts index 01b59301292..1b76767fdab 100644 --- a/packages/fiori-mcp-server/test/unit/tools/execute-functionality.test.ts +++ b/packages/fiori-mcp-server/test/unit/tools/execute-functionality.test.ts @@ -11,7 +11,7 @@ import { create } from 'mem-fs-editor'; jest.mock('@sap-ux/project-access', () => ({ __esModule: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ...(jest.requireActual('@sap-ux/project-access') as object) })); diff --git a/packages/fiori-mcp-server/test/unit/tools/functionalities/controller-extension/index.test.ts b/packages/fiori-mcp-server/test/unit/tools/functionalities/controller-extension/index.test.ts index af25b654f3c..ef1f38194ee 100644 --- a/packages/fiori-mcp-server/test/unit/tools/functionalities/controller-extension/index.test.ts +++ b/packages/fiori-mcp-server/test/unit/tools/functionalities/controller-extension/index.test.ts @@ -10,7 +10,7 @@ import { join } from 'node:path'; jest.mock('@sap-ux/project-access', () => ({ __esModule: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ...(jest.requireActual('@sap-ux/project-access') as object) })); diff --git a/packages/fiori-mcp-server/test/unit/tools/get-functionality-details.test.ts b/packages/fiori-mcp-server/test/unit/tools/get-functionality-details.test.ts index 140a0ae0c68..5cd952847e7 100644 --- a/packages/fiori-mcp-server/test/unit/tools/get-functionality-details.test.ts +++ b/packages/fiori-mcp-server/test/unit/tools/get-functionality-details.test.ts @@ -7,7 +7,7 @@ import * as projectUtils from '../../../src/page-editor-api/project'; jest.mock('@sap-ux/project-access', () => ({ __esModule: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ...(jest.requireActual('@sap-ux/project-access') as object) })); diff --git a/packages/fiori-mcp-server/test/unit/tools/list-fiori-apps.test.ts b/packages/fiori-mcp-server/test/unit/tools/list-fiori-apps.test.ts index e27a75b4f82..fb62e4f6706 100644 --- a/packages/fiori-mcp-server/test/unit/tools/list-fiori-apps.test.ts +++ b/packages/fiori-mcp-server/test/unit/tools/list-fiori-apps.test.ts @@ -4,7 +4,7 @@ import { join } from 'node:path'; jest.mock('@sap-ux/project-access', () => ({ __esModule: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ...(jest.requireActual('@sap-ux/project-access') as object) })); diff --git a/packages/fiori-mcp-server/test/unit/tools/list-functionalities.test.ts b/packages/fiori-mcp-server/test/unit/tools/list-functionalities.test.ts index 67a9af12da8..7d7b7b45ba4 100644 --- a/packages/fiori-mcp-server/test/unit/tools/list-functionalities.test.ts +++ b/packages/fiori-mcp-server/test/unit/tools/list-functionalities.test.ts @@ -6,7 +6,7 @@ import * as projectUtils from '../../../src/page-editor-api/project'; jest.mock('@sap-ux/project-access', () => ({ __esModule: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ...(jest.requireActual('@sap-ux/project-access') as object) })); diff --git a/packages/fiori-mcp-server/test/unit/tools/services/text-embedding.test.ts b/packages/fiori-mcp-server/test/unit/tools/services/text-embedding.test.ts index 139228b718e..47a2affb371 100644 --- a/packages/fiori-mcp-server/test/unit/tools/services/text-embedding.test.ts +++ b/packages/fiori-mcp-server/test/unit/tools/services/text-embedding.test.ts @@ -3,8 +3,8 @@ import { TextEmbeddingService } from '../../../../src/tools/services/text-embedd // Mock the transformers module jest.mock('@xenova/transformers'); -// eslint-disable-next-line @typescript-eslint/no-var-requires -const mockTransformers = require('@xenova/transformers'); +import * as transformersModule from '@xenova/transformers'; +const mockTransformers = transformersModule as jest.Mocked; describe('TextEmbeddingService', () => { let service: TextEmbeddingService; @@ -17,8 +17,8 @@ describe('TextEmbeddingService', () => { const createMockPipelineInstance = () => jest.fn().mockResolvedValue({ data: new Float32Array(384).fill(0).map(() => Math.random() - 0.5) - }); - mockTransformers.pipeline.mockImplementation(() => Promise.resolve(createMockPipelineInstance())); + }) as unknown as ReturnType; + mockTransformers.pipeline.mockImplementation(createMockPipelineInstance); }); describe('initialize', () => { diff --git a/packages/fiori-mcp-server/test/unit/tools/utils.test.ts b/packages/fiori-mcp-server/test/unit/tools/utils.test.ts index 8e7c7299465..8b34aa06c68 100644 --- a/packages/fiori-mcp-server/test/unit/tools/utils.test.ts +++ b/packages/fiori-mcp-server/test/unit/tools/utils.test.ts @@ -13,7 +13,7 @@ import type { JSONSchema4 } from 'json-schema'; jest.mock('@sap-ux/project-access', () => ({ __esModule: true, - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion + ...(jest.requireActual('@sap-ux/project-access') as object) })); diff --git a/packages/fiori-mcp-server/test/unit/utils/logger.test.ts b/packages/fiori-mcp-server/test/unit/utils/logger.test.ts index d4f6a4eaf42..b7a6bda2cf8 100644 --- a/packages/fiori-mcp-server/test/unit/utils/logger.test.ts +++ b/packages/fiori-mcp-server/test/unit/utils/logger.test.ts @@ -29,7 +29,7 @@ describe('logger module', () => { describe('getLogLevel function behavior', () => { it('should return Error level as default when no configuration is provided', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); expect(logger.constructor.name).toBe('WinstonLogger'); @@ -37,21 +37,21 @@ describe('logger module', () => { it('should use global LOG_LEVEL when set', () => { (global as Record).LOG_LEVEL = 'INFO'; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); it('should use environment LOG_LEVEL when global is not set', () => { process.env.LOG_LEVEL = 'DEBUG'; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); it('should use command line argument when global and env are not set', () => { process.argv.push('--log-level=WARN'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -59,7 +59,7 @@ describe('logger module', () => { it('should prioritize global over environment variable', () => { (global as Record).LOG_LEVEL = 'ERROR'; process.env.LOG_LEVEL = 'INFO'; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -67,7 +67,7 @@ describe('logger module', () => { it('should prioritize global over command line argument', () => { (global as Record).LOG_LEVEL = 'WARN'; process.argv.push('--log-level=DEBUG'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -75,7 +75,7 @@ describe('logger module', () => { it('should prioritize environment over command line argument', () => { process.env.LOG_LEVEL = 'VERBOSE'; process.argv.push('--log-level=SILLY'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -101,7 +101,7 @@ describe('logger module', () => { testCases.forEach(({ input, expected }) => { it(`should handle ${input} case-insensitively for ${expected}`, () => { process.env.LOG_LEVEL = input; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -109,21 +109,21 @@ describe('logger module', () => { it('should fall back to Error level for invalid log level strings', () => { process.env.LOG_LEVEL = 'INVALID_LEVEL'; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); it('should fall back to Error level for empty string', () => { process.env.LOG_LEVEL = ''; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); it('should fall back to Error level for whitespace-only string', () => { process.env.LOG_LEVEL = ' '; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -132,14 +132,14 @@ describe('logger module', () => { describe('command line argument parsing', () => { it('should parse --log-level=VALUE format correctly', () => { process.argv.push('--log-level=INFO'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); it('should handle command line argument without equals sign gracefully', () => { process.argv.push('--log-level'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -147,14 +147,14 @@ describe('logger module', () => { it('should handle multiple --log-level arguments by using the first one', () => { process.argv.push('--log-level=DEBUG'); process.argv.push('--log-level=ERROR'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); it('should handle malformed command line arguments', () => { process.argv.push('--log-level='); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -162,13 +162,13 @@ describe('logger module', () => { describe('logger instance configuration', () => { it('should create logger with correct prefix', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); it('should create logger with ConsoleTransport', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const { logger } = require('../../../src/utils/logger') as { logger: ToolsLogger }; expect(logger).toBeDefined(); }); @@ -178,7 +178,7 @@ describe('logger module', () => { let logger: ToolsLogger; beforeEach(() => { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const loggerModule = require('../../../src/utils/logger') as { logger: ToolsLogger }; logger = loggerModule.logger; }); diff --git a/packages/fiori-tools-settings/.eslintignore b/packages/fiori-tools-settings/.eslintignore deleted file mode 100644 index 59f25a165bb..00000000000 --- a/packages/fiori-tools-settings/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -/test/test-output/ -dist diff --git a/packages/fiori-tools-settings/.eslintrc.js b/packages/fiori-tools-settings/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/fiori-tools-settings/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/fiori-tools-settings/eslint.config.js b/packages/fiori-tools-settings/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/fiori-tools-settings/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/flp-config-inquirer/.eslintignore b/packages/flp-config-inquirer/.eslintignore deleted file mode 100644 index 9be6e1b137f..00000000000 --- a/packages/flp-config-inquirer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -dist -templates \ No newline at end of file diff --git a/packages/flp-config-inquirer/.eslintrc.js b/packages/flp-config-inquirer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/flp-config-inquirer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/flp-config-inquirer/eslint.config.js b/packages/flp-config-inquirer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/flp-config-inquirer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/flp-config-sub-generator/.eslintignore b/packages/flp-config-sub-generator/.eslintignore deleted file mode 100644 index 89ff2604057..00000000000 --- a/packages/flp-config-sub-generator/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -/test/ -generators diff --git a/packages/flp-config-sub-generator/.eslintrc.js b/packages/flp-config-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/flp-config-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/flp-config-sub-generator/eslint.config.js b/packages/flp-config-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/flp-config-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/flp-config-sub-generator/test/app.test.ts b/packages/flp-config-sub-generator/test/app.test.ts index 4fe509decf4..78dc0cc7b3b 100644 --- a/packages/flp-config-sub-generator/test/app.test.ts +++ b/packages/flp-config-sub-generator/test/app.test.ts @@ -20,7 +20,9 @@ import { join } from 'node:path'; jest.mock('fs', () => { const fsLib = jest.requireActual('fs'); + // eslint-disable-next-line @typescript-eslint/no-require-imports const Union = require('unionfs').Union; + // eslint-disable-next-line @typescript-eslint/no-require-imports const vol = require('memfs').vol; const _fs = new Union().use(fsLib); _fs.constants = fsLib.constants; @@ -36,7 +38,7 @@ jest.mock('process', () => ({ })); const processMock = process as jest.Mocked; -let foundGenExts: Partial[] = []; +const foundGenExts: Partial[] = []; const sapApp = 'sap.app'; const crossNavigation = 'crossNavigation'; @@ -84,7 +86,9 @@ describe('flp-config generator', () => { await initI18n(); cwdBeforeTests = jest.requireActual('process').cwd(); processMock.chdir = jest.fn().mockImplementation((dir): void => { - if (dir && dir.startsWith(OUTPUT_DIR_PREFIX)) cwd = dir; + if (dir?.startsWith(OUTPUT_DIR_PREFIX)) { + cwd = dir; + } }) as any; }); diff --git a/packages/flp-config-sub-generator/test/utils.ts b/packages/flp-config-sub-generator/test/utils.ts index 921739530bd..edcdf67fbf6 100644 --- a/packages/flp-config-sub-generator/test/utils.ts +++ b/packages/flp-config-sub-generator/test/utils.ts @@ -1,4 +1,4 @@ -import { Manifest } from '@sap-ux/project-access'; +import type { Manifest } from '@sap-ux/project-access'; export function assertInboundsHasConfig( crossNavigation: Manifest['sap.app']['crossNavigation'], diff --git a/packages/generator-adp/.eslintignore b/packages/generator-adp/.eslintignore deleted file mode 100644 index 04bb55e9568..00000000000 --- a/packages/generator-adp/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -/test/test-output/ -generators diff --git a/packages/generator-adp/.eslintrc.js b/packages/generator-adp/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/generator-adp/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/generator-adp/eslint.config.js b/packages/generator-adp/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/generator-adp/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/generator-adp/src/app/questions/cf-services.ts b/packages/generator-adp/src/app/questions/cf-services.ts index b905061ad85..fbda8827e89 100644 --- a/packages/generator-adp/src/app/questions/cf-services.ts +++ b/packages/generator-adp/src/app/questions/cf-services.ts @@ -266,7 +266,7 @@ export class CFServicesPrompter { message: t('prompts.businessServiceLabel'), choices: this.businessServices, default: (_: CfServicesAnswers) => - this.businessServices.length === 1 ? this.businessServices[0] ?? '' : '', + this.businessServices.length === 1 ? (this.businessServices[0] ?? '') : '', when: (answers: CfServicesAnswers) => this.isCfLoggedIn && (this.approuter || answers.approuter), validate: async (value: string) => { const validationResult = validateEmptyString(value); diff --git a/packages/generator-adp/src/app/questions/configuration.ts b/packages/generator-adp/src/app/questions/configuration.ts index b64b8d35049..448735ef4a1 100644 --- a/packages/generator-adp/src/app/questions/configuration.ts +++ b/packages/generator-adp/src/app/questions/configuration.ts @@ -218,7 +218,11 @@ export class ConfigPrompter { * @param {FlexLayer} layer - The FlexLayer used to determine the base (customer or otherwise). * @param {ToolsLogger} logger - Instance of the logger. */ - constructor(private readonly systemLookup: SystemLookup, layer: FlexLayer, private readonly logger: ToolsLogger) { + constructor( + private readonly systemLookup: SystemLookup, + layer: FlexLayer, + private readonly logger: ToolsLogger + ) { this.isCustomerBase = layer === FlexLayer.CUSTOMER_BASE; } diff --git a/packages/generator-adp/src/utils/appWizardCache.ts b/packages/generator-adp/src/utils/appWizardCache.ts index 6db7cd12204..b5e4d93f373 100644 --- a/packages/generator-adp/src/utils/appWizardCache.ts +++ b/packages/generator-adp/src/utils/appWizardCache.ts @@ -1,7 +1,7 @@ import type { AppWizard } from '@sap-devx/yeoman-ui-types'; import type { ToolsLogger } from '@sap-ux/logger'; -import { getHostEnvironment, hostEnvironment, type ILogWrapper } from '@sap-ux/fiori-generator-shared'; +import { getHostEnvironment, hostEnvironment } from '@sap-ux/fiori-generator-shared'; import type { ConfigPrompter } from '../app/questions/configuration'; diff --git a/packages/generator-adp/test/unit/questions/configuration.test.ts b/packages/generator-adp/test/unit/questions/configuration.test.ts index 0cf16661db9..212d6fe2340 100644 --- a/packages/generator-adp/test/unit/questions/configuration.test.ts +++ b/packages/generator-adp/test/unit/questions/configuration.test.ts @@ -14,15 +14,14 @@ import { isAppSupported, loadApps } from '@sap-ux/adp-tooling'; -import type { AxiosError } from '@sap-ux/axios-extension'; -import { isAxiosError, type AbapServiceProvider } from '@sap-ux/axios-extension'; +import type { AxiosError, AbapServiceProvider } from '@sap-ux/axios-extension'; +import { isAxiosError } from '@sap-ux/axios-extension'; import { getHostEnvironment, hostEnvironment } from '@sap-ux/fiori-generator-shared'; import type { ListQuestion } from '@sap-ux/inquirer-common'; import type { ToolsLogger } from '@sap-ux/logger'; -import type { Manifest } from '@sap-ux/project-access'; +import type { Manifest, ManifestNamespace } from '@sap-ux/project-access'; import { isAppStudio } from '@sap-ux/btp-utils'; -import type { ManifestNamespace } from '@sap-ux/project-access'; import { ConfigPrompter } from '../../../src/app/questions/configuration'; import { configPromptNames } from '../../../src/app/types'; import { initI18n, t } from '../../../src/utils/i18n'; diff --git a/packages/guided-answers-helper/.eslintignore b/packages/guided-answers-helper/.eslintignore deleted file mode 100644 index 5d34d8f445f..00000000000 --- a/packages/guided-answers-helper/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -test/sample -dist \ No newline at end of file diff --git a/packages/guided-answers-helper/.eslintrc.js b/packages/guided-answers-helper/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/guided-answers-helper/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/guided-answers-helper/eslint.config.js b/packages/guided-answers-helper/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/guided-answers-helper/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/i18n/.eslintignore b/packages/i18n/.eslintignore deleted file mode 100644 index d1402b0e919..00000000000 --- a/packages/i18n/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -dist - -web.js -web.d.ts diff --git a/packages/i18n/.eslintrc.js b/packages/i18n/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/i18n/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/i18n/eslint.config.js b/packages/i18n/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/i18n/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/i18n/src/parser/properties/lexer/index.ts b/packages/i18n/src/parser/properties/lexer/index.ts index 4a86f22e02e..bb608124494 100644 --- a/packages/i18n/src/parser/properties/lexer/index.ts +++ b/packages/i18n/src/parser/properties/lexer/index.ts @@ -192,7 +192,7 @@ class PropertiesTokenizer { this.next(); } let type: TokenType = 'whitespace'; - if (!isSeparator(this.peek()) && token && token.type === 'key') { + if (!isSeparator(this.peek()) && token?.type === 'key') { // whitespace can also serve as separator type = 'separator'; } diff --git a/packages/i18n/test/unit/.eslintrc b/packages/i18n/test/unit/.eslintrc deleted file mode 100644 index 052a072caa1..00000000000 --- a/packages/i18n/test/unit/.eslintrc +++ /dev/null @@ -1,17 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "overrides": [ - { - "files": ["**/*.test.ts"], - "rules": { - "camelcase": [ - "warn", - { - "properties": "never" - } - ], - "max-nested-callbacks": ["warn", 5] - } - } - ] -} diff --git a/packages/i18n/test/unit/scripts/update-csv.ts b/packages/i18n/test/unit/scripts/update-csv.ts index 1bf941f9af3..5fd16315bd9 100644 --- a/packages/i18n/test/unit/scripts/update-csv.ts +++ b/packages/i18n/test/unit/scripts/update-csv.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-console */ // Only intend to run in CLI environment where we don't need more advanced logging +// Only intend to run in CLI environment where we don't need more advanced logging import { update } from '../helper/update-test-data'; import { FileFormat } from '../../../src/parser/types'; diff --git a/packages/i18n/test/unit/scripts/update-properties.ts b/packages/i18n/test/unit/scripts/update-properties.ts index 1a60ae4b956..35e40d5e07f 100644 --- a/packages/i18n/test/unit/scripts/update-properties.ts +++ b/packages/i18n/test/unit/scripts/update-properties.ts @@ -1,4 +1,4 @@ -/* eslint-disable no-console */ // Only intend to run in CLI environment where we don't need more advanced logging +// Only intend to run in CLI environment where we don't need more advanced logging import { update } from '../helper/update-test-data'; import { FileFormat } from '../../../src/parser/types'; diff --git a/packages/inquirer-common/.eslintignore b/packages/inquirer-common/.eslintignore deleted file mode 100644 index 9be6e1b137f..00000000000 --- a/packages/inquirer-common/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -dist -templates \ No newline at end of file diff --git a/packages/inquirer-common/.eslintrc.js b/packages/inquirer-common/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/inquirer-common/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/inquirer-common/eslint.config.js b/packages/inquirer-common/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/inquirer-common/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/inquirer-common/src/prompts/utility.ts b/packages/inquirer-common/src/prompts/utility.ts index 265e8115f69..28ffc243c9b 100644 --- a/packages/inquirer-common/src/prompts/utility.ts +++ b/packages/inquirer-common/src/prompts/utility.ts @@ -69,7 +69,7 @@ export function ui5VersionsGrouped( })})` : mainV.version, value: mainV.version - } as UI5VersionChoice) + }) as UI5VersionChoice ); const notMaintChoices = versions .filter((v) => v.maintained === false) @@ -83,7 +83,7 @@ export function ui5VersionsGrouped( )})` : mainV.version, value: mainV.version - } as UI5VersionChoice) + }) as UI5VersionChoice ); if (includeSeparators) { diff --git a/packages/inquirer-common/test/unit/prompts/helpers.test.ts b/packages/inquirer-common/test/unit/prompts/helpers.test.ts index e923fd755fa..4cc9d554625 100644 --- a/packages/inquirer-common/test/unit/prompts/helpers.test.ts +++ b/packages/inquirer-common/test/unit/prompts/helpers.test.ts @@ -7,10 +7,7 @@ import { extendValidate, extendWithOptions, withCondition, - filterAggregateTransformations -} from '../../../src/prompts/helpers'; -import type { PromptDefaultValue, YUIQuestion } from '../../../src/types'; -import { + filterAggregateTransformations, convertEdmxToConvertedMetadata, hasRecursiveHierarchyForEntity, getRecursiveHierarchyQualifier, @@ -18,6 +15,7 @@ import { transformationsRequiredForAnalyticalTable, findEntitySetByName } from '../../../src/prompts/helpers'; +import type { PromptDefaultValue, YUIQuestion } from '../../../src/types'; import * as fs from 'node:fs'; import * as path from 'node:path'; diff --git a/packages/jest-environment-ui5/.eslintrc.js b/packages/jest-environment-ui5/.eslintrc.js deleted file mode 100644 index 39aa11b78f3..00000000000 --- a/packages/jest-environment-ui5/.eslintrc.js +++ /dev/null @@ -1,20 +0,0 @@ -module.exports = { - env: { - es2024: true, - jest: true, - browser: true - }, - globals: { - sap: 'readonly', - jestUI5: 'readonly' - }, - 'parserOptions': { - 'ecmaVersion': 'latest', - 'sourceType': 'module', - 'ecmaFeatures': { - 'jsx': true - } - }, - extends: ['../../.eslintrc'], - ignorePatterns: 'src/env/ui5loader.js' -}; diff --git a/packages/jest-environment-ui5/eslint.config.js b/packages/jest-environment-ui5/eslint.config.js new file mode 100644 index 00000000000..30f4f480214 --- /dev/null +++ b/packages/jest-environment-ui5/eslint.config.js @@ -0,0 +1,32 @@ +const base = require('../../eslint.config.js').filter( + (config) => + ![ + 'typescript-eslint/base', + 'typescript-eslint-1', + 'typescript-eslint-2', + 'typescript-eslint/recommended' + ].includes(config.name) +); + +module.exports = [ + { ignores: ['src/env/ui5loader.js', 'index.d.ts'] }, + { + languageOptions: { + parserOptions: { + ecmaVersion: 'latest', + sourceType: 'module', + ecmaFeatures: { + jsx: true + } + }, + globals: { + sap: 'readonly', + jestUI5: 'readonly', + es2024: true, + jest: true, + browser: true + } + } + }, + ...base +]; diff --git a/packages/jest-environment-ui5/test/unit/index.test.js b/packages/jest-environment-ui5/test/unit/index.test.js index 232e1400982..b29c0c7deb4 100644 --- a/packages/jest-environment-ui5/test/unit/index.test.js +++ b/packages/jest-environment-ui5/test/unit/index.test.js @@ -1,4 +1,4 @@ -const jestCLI = require('jest'); // eslint-disable-line import/no-extraneous-dependencies +const jestCLI = require('jest'); // eslint-disable-line sonarjs/no-implicit-dependencies const UI5DOMEnvironment = require('../../src'); describe('Custom environment', () => { it('Can be created', async () => { diff --git a/packages/jest-file-matchers/.eslintignore b/packages/jest-file-matchers/.eslintignore deleted file mode 100644 index 0fc18a40e56..00000000000 --- a/packages/jest-file-matchers/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test -dist diff --git a/packages/jest-file-matchers/.eslintrc.js b/packages/jest-file-matchers/.eslintrc.js deleted file mode 100644 index 8637b533f0e..00000000000 --- a/packages/jest-file-matchers/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - 'EXPERIMENTAL_useSourceOfProjectReferenceRedirect': true, - project: './tsconfig.eslint.json' - }, - rules: { - '@typescript-eslint/no-namespace': 'off' - } -}; diff --git a/packages/jest-file-matchers/eslint.config.js b/packages/jest-file-matchers/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/jest-file-matchers/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/jest-file-matchers/src/matchers/index.ts b/packages/jest-file-matchers/src/matchers/index.ts index d875bec89e8..834c557b2f4 100644 --- a/packages/jest-file-matchers/src/matchers/index.ts +++ b/packages/jest-file-matchers/src/matchers/index.ts @@ -1,5 +1,5 @@ +/* eslint-disable @typescript-eslint/no-namespace */ import type { Filter, MatcherIgnore } from './types'; - export { toContainAllFilesIn } from './toContainAllFilesIn'; export { toMatchFilesIn } from './toMatchFilesIn'; export { toMatchFolder } from './toMatchFolder'; diff --git a/packages/jest-file-matchers/src/matchers/toMatchFileSnapshot/types.ts b/packages/jest-file-matchers/src/matchers/toMatchFileSnapshot/types.ts index 6edd2e7441f..c8cfb2b2cbe 100644 --- a/packages/jest-file-matchers/src/matchers/toMatchFileSnapshot/types.ts +++ b/packages/jest-file-matchers/src/matchers/toMatchFileSnapshot/types.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-namespace */ /// import type { DiffOptions } from 'jest-diff'; diff --git a/packages/jest-file-matchers/test/unit/matchers.test.ts b/packages/jest-file-matchers/test/unit/matchers.test.ts index b64bafccc43..db8ab0220a8 100644 --- a/packages/jest-file-matchers/test/unit/matchers.test.ts +++ b/packages/jest-file-matchers/test/unit/matchers.test.ts @@ -1,6 +1,7 @@ import { join } from 'node:path'; import fs from 'node:fs'; -import { MatcherIgnore, README_GENERATION_PLATFORM_REGEX, README_GENERATOR_REGEX } from '../../src/matchers/types'; +import type { MatcherIgnore } from '../../src/matchers/types'; +import { README_GENERATION_PLATFORM_REGEX, README_GENERATOR_REGEX } from '../../src/matchers/types'; import { toMatchFolder, toContainAllFilesIn } from '../../src/index'; import { toMatchFile } from '../../src/matchers/toMatchFileSnapshot'; @@ -17,6 +18,7 @@ export const ignoreMatcherOpts: MatcherIgnore = { describe('Test matchers', () => { beforeAll(() => { + // eslint-disable-next-line @typescript-eslint/no-require-imports require('../../src/setup'); }); diff --git a/packages/jest-runner-puppeteer/.eslintignore b/packages/jest-runner-puppeteer/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/jest-runner-puppeteer/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/jest-runner-puppeteer/.eslintrc.js b/packages/jest-runner-puppeteer/.eslintrc.js deleted file mode 100644 index 1ee47b267d8..00000000000 --- a/packages/jest-runner-puppeteer/.eslintrc.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - 'EXPERIMENTAL_useSourceOfProjectReferenceRedirect': true, - project: './tsconfig.eslint.json' - }, - rules: { - '@typescript-eslint/no-namespace': 'off', - 'space-before-function-paren': [ - 'error', - { - 'anonymous': 'always', - 'named': 'never', - 'asyncArrow': 'always' - } - ] - } -}; diff --git a/packages/jest-runner-puppeteer/eslint.config.js b/packages/jest-runner-puppeteer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/jest-runner-puppeteer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/launch-config/.eslintignore b/packages/launch-config/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/launch-config/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/launch-config/.eslintrc.js b/packages/launch-config/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/launch-config/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/launch-config/eslint.config.js b/packages/launch-config/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/launch-config/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/launch-config/test/debug-config/config.test.ts b/packages/launch-config/test/debug-config/config.test.ts index b4f70118b42..f227e1d4126 100644 --- a/packages/launch-config/test/debug-config/config.test.ts +++ b/packages/launch-config/test/debug-config/config.test.ts @@ -1,8 +1,7 @@ import { configureLaunchJsonFile } from '../../src/debug-config/config'; import type { DebugOptions, LaunchConfig, LaunchJSON, FioriOptions } from '../../src/types'; -import path from 'node:path'; +import path, { join } from 'node:path'; import { FIORI_TOOLS_LAUNCH_CONFIG_HANDLER_ID } from '../../src/types'; -import { join } from 'node:path'; import { create as createStorage } from 'mem-fs'; import { create } from 'mem-fs-editor'; import { FileName } from '@sap-ux/project-access'; diff --git a/packages/logger/.eslintignore b/packages/logger/.eslintignore deleted file mode 100644 index 93a3fe1f457..00000000000 --- a/packages/logger/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -test/test-input -dist diff --git a/packages/logger/.eslintrc.js b/packages/logger/.eslintrc.js deleted file mode 100644 index 65612a02793..00000000000 --- a/packages/logger/.eslintrc.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - 'jsdoc/require-returns': 0, - 'jsdoc/require-param': 0, - 'jsdoc/require-jsdoc': 0, - 'jsdoc/match-description': 0, - 'jsdoc/multiline-blocks': 0, - 'jsdoc/tag-lines': 0, - 'jsdoc/require-param-description': 0, - 'jsdoc/no-multi-asterisks': 0, - 'jsdoc/check-tag-names': 0 - } -}; diff --git a/packages/logger/eslint.config.js b/packages/logger/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/logger/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/logger/src/extension-logger/index.ts b/packages/logger/src/extension-logger/index.ts index fd6e9c965ac..00c41187275 100644 --- a/packages/logger/src/extension-logger/index.ts +++ b/packages/logger/src/extension-logger/index.ts @@ -4,7 +4,14 @@ import { WinstonLogger } from '../winston-logger'; import { LogLevel } from '../types'; import { toWinstonLogLevel } from '../winston-logger/adapter'; +/** + * + */ export class ExtensionLogger extends WinstonLogger { + /** + * + * @param channelName + */ constructor(channelName: string) { const vscodeTransport = new VSCodeTransport({ channelName }); super({ diff --git a/packages/logger/src/transports/transport.ts b/packages/logger/src/transports/transport.ts index e61c89a3226..f7f9284d9d0 100644 --- a/packages/logger/src/transports/transport.ts +++ b/packages/logger/src/transports/transport.ts @@ -10,6 +10,10 @@ export class ConsoleTransport extends Transport { private static singletonInstance: ConsoleTransport; public readonly options: ConsoleTransportOptions; + /** + * + * @param opts + */ constructor(opts: ConsoleTransportOptions = {}) { super(); if (!ConsoleTransport.singletonInstance) { @@ -33,6 +37,10 @@ export class UI5ToolingTransport extends Transport { private static instances: Map = new Map(); public readonly options: UI5ToolingTransportOptions; + /** + * + * @param opts + */ constructor(opts: UI5ToolingTransportOptions) { super(); const instance = UI5ToolingTransport.instances.get(opts.moduleName); @@ -52,6 +60,9 @@ export class UI5ToolingTransport extends Transport { export class NullTransport extends Transport { private static singletonInstance: NullTransport; + /** + * + */ constructor() { super(); if (!NullTransport.singletonInstance) { @@ -71,6 +82,10 @@ export interface FileTransportOptions extends TransportOptions { export class FileTransport extends Transport { public readonly options: FileTransportOptions; + /** + * + * @param opts + */ constructor(opts: FileTransportOptions) { super(); this.options = this.copy(opts); @@ -84,6 +99,9 @@ export interface StringArrayTransportOptions extends TransportOptions { logs: string[]; } +/** + * + */ export class StringArrayTransport extends Transport {} export interface VSCodeTransportOptions extends TransportOptions { @@ -98,6 +116,10 @@ export class VSCodeTransport extends Transport { private static instances: Map = new Map(); public readonly options: VSCodeTransportOptions; + /** + * + * @param opts + */ constructor(opts: VSCodeTransportOptions) { super(); const instance = VSCodeTransport.instances.get(opts.channelName); @@ -123,12 +145,24 @@ export interface ArrayTransportOptions extends TransportOptions { logs?: ArrayTransportLogEntry[]; } +/** + * + */ export class ArrayTransport extends WinstonTransport { public readonly logs: ArrayTransportLogEntry[]; + /** + * + * @param opts + */ constructor(opts?: ArrayTransportOptions) { super({ level: typeof opts?.logLevel === 'number' ? LogLevel[opts.logLevel].toLowerCase() : 'debug' }); this.logs = opts?.logs ?? []; } + /** + * + * @param info + * @param next + */ log(info: ArrayTransportLogEntry, next: () => void) { this.logs.push(info); next(); diff --git a/packages/logger/src/types.ts b/packages/logger/src/types.ts index ea75675ca85..e44d56f3f79 100644 --- a/packages/logger/src/types.ts +++ b/packages/logger/src/types.ts @@ -74,7 +74,7 @@ export interface TransportOptions { */ export abstract class Transport { /** - * A utility copy method to make immutable, deep copies of objects + * A utility copy method to make immutable, deep copies of objects. * * @param obj * @returns a frozen deep clone of `obj` diff --git a/packages/logger/src/winston-logger/adapter.ts b/packages/logger/src/winston-logger/adapter.ts index f35be7087f0..c6dacd584d0 100644 --- a/packages/logger/src/winston-logger/adapter.ts +++ b/packages/logger/src/winston-logger/adapter.ts @@ -17,7 +17,7 @@ import { inspect } from 'util'; import chalk from 'chalk'; /** - * Translate @type {LogLevel} to what Winston understands + * Translate @type {LogLevel} to what Winston understands. * * @param {LogLevel} logLevel - optional logLevel * @returns log - level that Winston understands (https://github.com/winstonjs/winston#logging-levels) @@ -74,8 +74,8 @@ const decorateLevel = (level: string) => { * Return a colored label if label and color are specified, _if_ we running on a TTY. * Else return `''` * - * @param label - * @param labelColor + * @param label - Label name + * @param labelColor - Label color * @returns {string} decorated label */ const decorateLabel = (label?: string, labelColor?: string): string => { @@ -100,10 +100,9 @@ const consoleFormat = format.combine( ); /** - * Take a @type {Transport} and return the corresponding @type {WinstonTransport} - * Will throw an error if the transport is not recognized + * Take a @type {Transport} and return the corresponding @type {WinstonTransport} will throw an error if the transport is not recognized. * - * @param transport + * @param transport - transport to convert * @returns {WinstonTransport} winston transport */ export function toWinstonTransport(transport: Transport): WinstonTransport { diff --git a/packages/logger/src/winston-logger/logger.ts b/packages/logger/src/winston-logger/logger.ts index 61b45c95d75..04f823b7c7e 100644 --- a/packages/logger/src/winston-logger/logger.ts +++ b/packages/logger/src/winston-logger/logger.ts @@ -22,6 +22,9 @@ interface BaseLoggerOptions { metadataOverride?: Metadata; } +/** + * + */ class BaseWinstonLogger implements Logger { protected _logger: winston.Logger; protected logPrefix: string; @@ -30,6 +33,15 @@ class BaseWinstonLogger implements Logger { protected metadataOverride?: Metadata; // Maintain of map of transports. This is useful for adding/removing transports protected transportMap: Map; + /** + * + * @param root0 + * @param root0.logger + * @param root0.transportMap + * @param root0.metadataOverride + * @param root0.winstonLevel + * @param root0.logPrefix + */ protected initialize({ logger, transportMap, metadataOverride, winstonLevel, logPrefix }: BaseLoggerOptions): void { this._logger = logger; this.transportMap = transportMap; @@ -38,18 +50,38 @@ class BaseWinstonLogger implements Logger { this.metadataOverride = metadataOverride; } + /** + * + * @param message + */ info(message: string | object): void { this.log({ level: LogLevel.Info, message }); } + /** + * + * @param message + */ warn(message: string | object): void { this.log({ level: LogLevel.Warn, message }); } + /** + * + * @param message + */ error(message: string | object): void { this.log({ level: LogLevel.Error, message }); } + /** + * + * @param message + */ debug(message: string | object): void { this.log({ level: LogLevel.Debug, message }); } + /** + * + * @param data + */ log(data: string | Log): void { if (!this.transportMap.size) { // Nothing to do @@ -62,6 +94,13 @@ class BaseWinstonLogger implements Logger { this.winstonLog({ level, message: data.message, metadata: this.metadataOverride }); } } + /** + * + * @param root0 + * @param root0.level + * @param root0.message + * @param root0.metadata + */ private winstonLog({ level, message, @@ -74,6 +113,11 @@ class BaseWinstonLogger implements Logger { const msg = typeof message === 'string' ? message : inspect(message); this._logger.log(level, msg, metadata); } + /** + * + * @param transportMap + * @param transport + */ protected addToMap( transportMap: Map, transport: Transport @@ -85,6 +129,10 @@ class BaseWinstonLogger implements Logger { } return undefined; } + /** + * + * @param transport + */ add(transport: Transport) { const winstonTransport = this.addToMap(this.transportMap, transport); @@ -93,6 +141,10 @@ class BaseWinstonLogger implements Logger { } return this; } + /** + * + * @param transport + */ remove(transport: Transport) { const winstonTransport = this.transportMap.get(transport); if (winstonTransport) { @@ -103,9 +155,17 @@ class BaseWinstonLogger implements Logger { throw new Error('Cannot remove non-existent transport'); } } + /** + * + */ transports(): Transport[] { return Array.from(this.transportMap.keys()); } + /** + * + * @param root0 + * @param root0.logPrefix + */ child({ logPrefix }: ChildLoggerOptions): Logger { const childLogPrefix = `${this.logPrefix}.${logPrefix}`; const metadataOverride = { label: childLogPrefix, labelColor: nextColor() }; @@ -126,6 +186,13 @@ class BaseWinstonLogger implements Logger { * Winston implementation of the @type {Logger} interface */ export class WinstonLogger extends BaseWinstonLogger { + /** + * + * @param root0 + * @param root0.logLevel + * @param root0.transports + * @param root0.logPrefix + */ constructor({ logLevel = LogLevel.Info, transports = [], diff --git a/packages/logger/src/winston-logger/null-transport.ts b/packages/logger/src/winston-logger/null-transport.ts index 1700e239ca5..c4ee93ce038 100644 --- a/packages/logger/src/winston-logger/null-transport.ts +++ b/packages/logger/src/winston-logger/null-transport.ts @@ -4,6 +4,11 @@ import Transport from 'winston-transport'; * This is a sink, the equivalent of writing to /dev/null */ export class NullTransport extends Transport { + /** + * + * @param _data + * @param callback + */ public log(_data: unknown, callback: () => void) { callback(); } diff --git a/packages/logger/src/winston-logger/vscode-output-channel-transport.ts b/packages/logger/src/winston-logger/vscode-output-channel-transport.ts index 21e731a99e0..03244b3a00f 100644 --- a/packages/logger/src/winston-logger/vscode-output-channel-transport.ts +++ b/packages/logger/src/winston-logger/vscode-output-channel-transport.ts @@ -24,6 +24,10 @@ export class VSCodeTransport extends Transport { ['silly', 'trace'] ]); + /** + * + * @param options + */ public constructor( options: Transport.TransportStreamOptions & { channelName: string; @@ -32,6 +36,11 @@ export class VSCodeTransport extends Transport { super(options); this.channel = getVSCodeInstance().window.createOutputChannel(options.channelName, { log: true }); } + /** + * + * @param data + * @param callback + */ public log(data: DataLog, callback: () => void): void { setImmediate(() => { const logFunction = this.winstonToVSCodeMap.get(data.level) ?? 'info'; @@ -44,6 +53,10 @@ export class VSCodeTransport extends Transport { } } +/** + * + */ function getVSCodeInstance(): any { + // eslint-disable-next-line @typescript-eslint/no-require-imports return require('vscode'); } diff --git a/packages/mockserver-config-writer/.eslintignore b/packages/mockserver-config-writer/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/packages/mockserver-config-writer/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/packages/mockserver-config-writer/.eslintrc.js b/packages/mockserver-config-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/mockserver-config-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/mockserver-config-writer/eslint.config.js b/packages/mockserver-config-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/mockserver-config-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/mockserver-config-writer/test/unit/mockserver-config/ui5-mock-yaml.test.ts b/packages/mockserver-config-writer/test/unit/mockserver-config/ui5-mock-yaml.test.ts index 63238fe4f6a..7a404af70e0 100644 --- a/packages/mockserver-config-writer/test/unit/mockserver-config/ui5-mock-yaml.test.ts +++ b/packages/mockserver-config-writer/test/unit/mockserver-config/ui5-mock-yaml.test.ts @@ -204,10 +204,8 @@ server: function getFsWithUi5Yaml(manifestContent: string): Editor { return getFs({ - [join( - basePath, - 'ui5.yaml' - )]: `# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json + [join(basePath, 'ui5.yaml')]: + `# yaml-language-server: $schema=https://sap.github.io/ui5-tooling/schema/ui5.yaml.json specVersion: "2.5" metadata: diff --git a/packages/nodejs-utils/.eslintignore b/packages/nodejs-utils/.eslintignore deleted file mode 100644 index 93a3fe1f457..00000000000 --- a/packages/nodejs-utils/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -test/test-input -dist diff --git a/packages/nodejs-utils/.eslintrc.js b/packages/nodejs-utils/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/nodejs-utils/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/nodejs-utils/eslint.config.js b/packages/nodejs-utils/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/nodejs-utils/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/nodejs-utils/test/unit/commandRunner.test.ts b/packages/nodejs-utils/test/unit/commandRunner.test.ts index 3f8cca994c3..cdd8f2587f5 100644 --- a/packages/nodejs-utils/test/unit/commandRunner.test.ts +++ b/packages/nodejs-utils/test/unit/commandRunner.test.ts @@ -2,7 +2,7 @@ import childProcess, { type SpawnOptionsWithoutStdio } from 'child_process'; import { CommandRunner } from '../../src/commandRunner'; import { type Logger } from '@sap-ux/logger'; -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-require-imports const mockSpawn = require('mock-spawn'); // write test cases for the CommandRunner class diff --git a/packages/odata-annotation-core-types/.eslintignore b/packages/odata-annotation-core-types/.eslintignore deleted file mode 100644 index 1a33f1f2992..00000000000 --- a/packages/odata-annotation-core-types/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -docs diff --git a/packages/odata-annotation-core-types/.eslintrc b/packages/odata-annotation-core-types/.eslintrc deleted file mode 100644 index 1c96035374f..00000000000 --- a/packages/odata-annotation-core-types/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": [ - "../../.eslintrc" - ], - "parserOptions": { - "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true, - "project": "./tsconfig.eslint.json" - } -} \ No newline at end of file diff --git a/packages/odata-annotation-core-types/eslint.config.js b/packages/odata-annotation-core-types/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/odata-annotation-core-types/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/odata-annotation-core/.eslintignore b/packages/odata-annotation-core/.eslintignore deleted file mode 100644 index 1a33f1f2992..00000000000 --- a/packages/odata-annotation-core/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -docs diff --git a/packages/odata-annotation-core/.eslintrc b/packages/odata-annotation-core/.eslintrc deleted file mode 100644 index 1c96035374f..00000000000 --- a/packages/odata-annotation-core/.eslintrc +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": [ - "../../.eslintrc" - ], - "parserOptions": { - "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true, - "project": "./tsconfig.eslint.json" - } -} \ No newline at end of file diff --git a/packages/odata-annotation-core/eslint.config.js b/packages/odata-annotation-core/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/odata-annotation-core/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/odata-annotation-core/test/utils/metadata.test.ts b/packages/odata-annotation-core/test/utils/metadata.test.ts index b85d53d4aa6..e3bfdfc98f4 100644 --- a/packages/odata-annotation-core/test/utils/metadata.test.ts +++ b/packages/odata-annotation-core/test/utils/metadata.test.ts @@ -1,7 +1,12 @@ -import type { IMetadataService, MetadataElement, ODataVersionType } from '@sap-ux/odata-annotation-core-types'; +import type { + IMetadataService, + MetadataElement, + ODataVersionType, + Namespace, + Reference +} from '@sap-ux/odata-annotation-core-types'; import { MetadataService } from '@sap-ux/odata-entity-model'; import { getAliasInformation, getPathBaseMetadataElement, getSegmentWithoutAlias } from '../../src'; -import type { Namespace, Reference } from '@sap-ux/odata-annotation-core-types'; const ODataVersion: ODataVersionType = '2.0'; const metadataFileUri = 'testFileUri'; diff --git a/packages/odata-entity-model/.eslintignore b/packages/odata-entity-model/.eslintignore deleted file mode 100644 index 1a33f1f2992..00000000000 --- a/packages/odata-entity-model/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -docs diff --git a/packages/odata-entity-model/.eslintrc b/packages/odata-entity-model/.eslintrc deleted file mode 100644 index facf2acd1f2..00000000000 --- a/packages/odata-entity-model/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "parserOptions": { - "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true, - "project": "./tsconfig.eslint.json" - } -} \ No newline at end of file diff --git a/packages/odata-entity-model/eslint.config.js b/packages/odata-entity-model/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/odata-entity-model/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/odata-entity-model/test/metadata-service-cds.test.ts b/packages/odata-entity-model/test/metadata-service-cds.test.ts index 71385aba26c..38aa3023783 100644 --- a/packages/odata-entity-model/test/metadata-service-cds.test.ts +++ b/packages/odata-entity-model/test/metadata-service-cds.test.ts @@ -1,7 +1,6 @@ -import type { TargetKind } from '@sap-ux/odata-annotation-core-types'; +import type { TargetKind, MetadataElement } from '@sap-ux/odata-annotation-core-types'; import { MetadataService } from '../src'; -import type { MetadataElement } from '@sap-ux/odata-annotation-core-types'; function createTestService() { const metadataService = new MetadataService(); diff --git a/packages/odata-service-inquirer/.eslintignore b/packages/odata-service-inquirer/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/packages/odata-service-inquirer/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/packages/odata-service-inquirer/.eslintrc.js b/packages/odata-service-inquirer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/odata-service-inquirer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/odata-service-inquirer/eslint.config.js b/packages/odata-service-inquirer/eslint.config.js new file mode 100644 index 00000000000..5fe59c1a97f --- /dev/null +++ b/packages/odata-service-inquirer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: 'tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/odata-service-inquirer/src/prompts/datasources/cap-project/cap-helpers.ts b/packages/odata-service-inquirer/src/prompts/datasources/cap-project/cap-helpers.ts index 91fb047f221..277430075bc 100644 --- a/packages/odata-service-inquirer/src/prompts/datasources/cap-project/cap-helpers.ts +++ b/packages/odata-service-inquirer/src/prompts/datasources/cap-project/cap-helpers.ts @@ -95,7 +95,7 @@ function createCapServiceChoice( cdsVersionInfo: CdsVersionInfo ): CapServiceChoice | undefined { const srvDef = capModel.definitions?.[serviceInfo.name]; - /* eslint-disable-next-line @typescript-eslint/no-explicit-any */ + const serviceFilePath = (srvDef as any)?.$location?.file; LoggerHelper.logger.debug(`Cap service def: ${JSON.stringify(srvDef)}`); LoggerHelper.logger.debug(`Cap service def $location.file: ${JSON.stringify(serviceFilePath)}`); diff --git a/packages/odata-service-inquirer/src/prompts/datasources/sap-system/abap-on-prem/questions.ts b/packages/odata-service-inquirer/src/prompts/datasources/sap-system/abap-on-prem/questions.ts index 204f161f865..a1b14573de1 100644 --- a/packages/odata-service-inquirer/src/prompts/datasources/sap-system/abap-on-prem/questions.ts +++ b/packages/odata-service-inquirer/src/prompts/datasources/sap-system/abap-on-prem/questions.ts @@ -6,7 +6,7 @@ import { t } from '../../../../i18n'; import { type OdataServiceAnswers, type OdataServicePromptOptions, - type ServiceSelectionPromptOptions, + type ServiceSelectionPromptOptions, // eslint-disable-line @typescript-eslint/no-unused-vars type SystemNamePromptOptions } from '../../../../types'; import { isBackendSystemKeyExisting, PromptState } from '../../../../utils'; diff --git a/packages/odata-service-inquirer/src/prompts/datasources/sap-system/service-selection/questions.ts b/packages/odata-service-inquirer/src/prompts/datasources/sap-system/service-selection/questions.ts index b7e184c7c03..80f6121fd66 100644 --- a/packages/odata-service-inquirer/src/prompts/datasources/sap-system/service-selection/questions.ts +++ b/packages/odata-service-inquirer/src/prompts/datasources/sap-system/service-selection/questions.ts @@ -18,7 +18,7 @@ import { OdataVersion } from '@sap-ux/odata-service-writer'; import type { ConvertedMetadata } from '@sap-ux/vocabularies-types'; import type { Answers, ListChoiceOptions, Question } from 'inquirer'; import { t } from '../../../../i18n'; -import type { OdataServicePromptOptions, ServiceSelectionPromptOptions } from '../../../../types'; +import type { OdataServicePromptOptions, ServiceSelectionPromptOptions } from '../../../../types'; // eslint-disable-line @typescript-eslint/no-unused-vars import { promptNames } from '../../../../types'; import { getDefaultChoiceIndex, getPromptHostEnvironment, PromptState } from '../../../../utils'; import type { ConnectionValidator } from '../../../connectionValidator'; diff --git a/packages/odata-service-inquirer/src/prompts/datasources/sap-system/service-selection/service-helper.ts b/packages/odata-service-inquirer/src/prompts/datasources/sap-system/service-selection/service-helper.ts index a390234ef2a..10a006940fb 100644 --- a/packages/odata-service-inquirer/src/prompts/datasources/sap-system/service-selection/service-helper.ts +++ b/packages/odata-service-inquirer/src/prompts/datasources/sap-system/service-selection/service-helper.ts @@ -39,7 +39,7 @@ const createServiceChoices = (serviceInfos?: ODataServiceInfo[]): ListChoiceOpti const choices: ListChoiceOptions[] = []; // Provide additional service information in trace mode (YUI only) let isLogTrace = false; - // eslint-disable-next-line @typescript-eslint/no-explicit-any -- Only specific loggers have this method + if (typeof (LoggerHelper.logger as any).getLogLevel === 'function') { isLogTrace = (LoggerHelper.logger as any).getLogLevel() === 'trace'; } diff --git a/packages/odata-service-inquirer/src/prompts/logger-helper.ts b/packages/odata-service-inquirer/src/prompts/logger-helper.ts index 31e4d39e945..3de48c4d10d 100644 --- a/packages/odata-service-inquirer/src/prompts/logger-helper.ts +++ b/packages/odata-service-inquirer/src/prompts/logger-helper.ts @@ -38,7 +38,7 @@ export default class LoggerHelper { response: AxiosInterceptorManager; }): void { // Dont log response data, which can be huge (edmx) unless log level is explictly set to `trace` (@vscode-logging/logger) - // eslint-disable-next-line @typescript-eslint/no-explicit-any + const logResponseData = typeof (LoggerHelper.logger as any).getLogLevel === 'function' && (LoggerHelper.logger as any).getLogLevel() === 'trace'; diff --git a/packages/odata-service-inquirer/src/types.ts b/packages/odata-service-inquirer/src/types.ts index 9de3d2a93ec..284a02e363a 100644 --- a/packages/odata-service-inquirer/src/types.ts +++ b/packages/odata-service-inquirer/src/types.ts @@ -1,4 +1,4 @@ -import type { Annotations, ServiceProvider, ODataServiceInfo } from '@sap-ux/axios-extension'; +import type { Annotations, ServiceProvider, ODataServiceInfo } from '@sap-ux/axios-extension'; // eslint-disable-line @typescript-eslint/no-unused-vars import type { Destination } from '@sap-ux/btp-utils'; import type { CommonPromptOptions, YUIQuestion } from '@sap-ux/inquirer-common'; import type { OdataVersion } from '@sap-ux/odata-service-writer'; diff --git a/packages/odata-service-inquirer/test/unit/prompts/cap-project/fixtures/bookshop/index.js b/packages/odata-service-inquirer/test/unit/prompts/cap-project/fixtures/bookshop/index.js index 0f7a3ffa79e..e8a6953419f 100644 --- a/packages/odata-service-inquirer/test/unit/prompts/cap-project/fixtures/bookshop/index.js +++ b/packages/odata-service-inquirer/test/unit/prompts/cap-project/fixtures/bookshop/index.js @@ -1 +1 @@ -exports.CatalogService = require('./srv/cat-service') +exports.CatalogService = require('./srv/cat-service'); diff --git a/packages/odata-service-inquirer/test/unit/prompts/cap-project/fixtures/bookshop/srv/cat-service.js b/packages/odata-service-inquirer/test/unit/prompts/cap-project/fixtures/bookshop/srv/cat-service.js index 99332859f7d..c8843d6d498 100644 --- a/packages/odata-service-inquirer/test/unit/prompts/cap-project/fixtures/bookshop/srv/cat-service.js +++ b/packages/odata-service-inquirer/test/unit/prompts/cap-project/fixtures/bookshop/srv/cat-service.js @@ -1,20 +1,19 @@ -const cds = require('@sap/cds') -module.exports = async function (){ +const cds = require('@sap/cds'); +module.exports = async function () { + const db = await cds.connect.to('db'); // connect to database service + const { Books } = db.entities; // get reflected definitions - const db = await cds.connect.to('db') // connect to database service - const { Books } = db.entities // get reflected definitions + // Reduce stock of ordered books if available stock suffices + this.on('submitOrder', async (req) => { + const { book, amount } = req.data; + const n = await UPDATE(Books, book) + .with({ stock: { '-=': amount } }) + .where({ stock: { '>=': amount } }); + n > 0 || req.error(409, `${amount} exceeds stock for book #${book}`); + }); - // Reduce stock of ordered books if available stock suffices - this.on ('submitOrder', async req => { - const {book,amount} = req.data - const n = await UPDATE (Books, book) - .with ({ stock: {'-=': amount }}) - .where ({ stock: {'>=': amount }}) - n > 0 || req.error (409,`${amount} exceeds stock for book #${book}`) - }) - - // Add some discount for overstocked books - this.after ('READ','Books', each => { - if (each.stock > 111) each.title += ` -- 11% discount!` - }) -} + // Add some discount for overstocked books + this.after('READ', 'Books', (each) => { + if (each.stock > 111) each.title += ` -- 11% discount!`; + }); +}; diff --git a/packages/odata-service-inquirer/test/unit/prompts/cap-project/questions.test.ts b/packages/odata-service-inquirer/test/unit/prompts/cap-project/questions.test.ts index 51e051dbbbd..a31016eab10 100644 --- a/packages/odata-service-inquirer/test/unit/prompts/cap-project/questions.test.ts +++ b/packages/odata-service-inquirer/test/unit/prompts/cap-project/questions.test.ts @@ -1,7 +1,7 @@ import type { CapService } from '@sap-ux/cap-config-writer'; import { hostEnvironment } from '@sap-ux/fiori-generator-shared'; -import type { CapCustomPaths } from '@sap-ux/project-access'; -import { getCapCustomPaths, type CdsVersionInfo } from '@sap-ux/project-access'; +import { getCapCustomPaths } from '@sap-ux/project-access'; +import type { CapCustomPaths, CdsVersionInfo } from '@sap-ux/project-access'; import type { PathLike } from 'node:fs'; import * as fsPromises from 'fs/promises'; import type { ListQuestion } from 'inquirer'; diff --git a/packages/odata-service-inquirer/test/unit/prompts/sap-system/credentials/questions.test.ts b/packages/odata-service-inquirer/test/unit/prompts/sap-system/credentials/questions.test.ts index c67266bad2c..da348f3f491 100644 --- a/packages/odata-service-inquirer/test/unit/prompts/sap-system/credentials/questions.test.ts +++ b/packages/odata-service-inquirer/test/unit/prompts/sap-system/credentials/questions.test.ts @@ -149,6 +149,7 @@ describe('Test credentials prompts', () => { expect(await (passwordPrompt?.validate as Function)('pword01', { [systemUsernamePromptName]: username })).toBe( 'Could not authenticate with provided credentials' ); + // eslint-disable-next-line @typescript-eslint/no-unused-expressions expect(PromptState.odataService.connectedSystem).toBeUndefined; }); diff --git a/packages/odata-service-writer/.eslintignore b/packages/odata-service-writer/.eslintignore deleted file mode 100644 index 2b81aee6d5c..00000000000 --- a/packages/odata-service-writer/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -test/test-output -test/test-input -dist -templates \ No newline at end of file diff --git a/packages/odata-service-writer/.eslintrc.js b/packages/odata-service-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/odata-service-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/odata-service-writer/eslint.config.js b/packages/odata-service-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/odata-service-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/odata-service-writer/src/data/annotations.ts b/packages/odata-service-writer/src/data/annotations.ts index d5851b82418..6218099296d 100644 --- a/packages/odata-service-writer/src/data/annotations.ts +++ b/packages/odata-service-writer/src/data/annotations.ts @@ -288,7 +288,7 @@ function getAnnotationNamespacesForSingleAnnotation( ): NamespaceAlias[] { if (edmxAnnotation?.xml) { // Parse once - const annotationsJson: Object = xmlToJson(edmxAnnotation.xml); + const annotationsJson: object = xmlToJson(edmxAnnotation.xml); return schemaNamespaces.map((schema: NamespaceAlias) => { // Check if alias exists in backend annotation file, if so use it const annotationAlias = @@ -354,7 +354,7 @@ function xmlToJson(xml: string): any | void { * @returns Array of namespaces and their aliases */ function getNamespaces(metadata: string): NamespaceAlias[] { - const jsonMetadata: Object = xmlToJson(metadata); + const jsonMetadata: object = xmlToJson(metadata); let schema = jsonMetadata['edmx:Edmx']?.['edmx:DataServices']?.['Schema']; if (!schema) { @@ -381,7 +381,7 @@ function getNamespaces(metadata: string): NamespaceAlias[] { * @param namespace - the namespace to search * @returns An alias for the specified namespace or empty string */ -function getAliasFromAnnotation(annotations: Object, namespace: string): string { +function getAliasFromAnnotation(annotations: object, namespace: string): string { let references = annotations['edmx:Edmx']?.['edmx:Reference']; // Can be array or single item diff --git a/packages/odata-service-writer/src/data/manifest.ts b/packages/odata-service-writer/src/data/manifest.ts index b72e930b368..6dc5f9c1e06 100644 --- a/packages/odata-service-writer/src/data/manifest.ts +++ b/packages/odata-service-writer/src/data/manifest.ts @@ -376,7 +376,7 @@ async function addMultipleServiceSupportToManifest( const dataSources = manifest?.['sap.app']?.dataSources; for (const dataSourceKey in dataSources) { const dataSource = dataSources[dataSourceKey]; - if (dataSource && dataSource.type === 'OData') { + if (dataSource?.type === 'OData') { convertSingleService(webappPath, dataSourceKey, dataSource, fs); const annotations = dataSource.settings?.annotations; if (annotations) { diff --git a/packages/odata-vocabularies/.eslintignore b/packages/odata-vocabularies/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/odata-vocabularies/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/odata-vocabularies/.eslintrc.js b/packages/odata-vocabularies/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/odata-vocabularies/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/odata-vocabularies/eslint.config.js b/packages/odata-vocabularies/eslint.config.js new file mode 100644 index 00000000000..8281655c2f0 --- /dev/null +++ b/packages/odata-vocabularies/eslint.config.js @@ -0,0 +1,17 @@ +const { rules } = require('eslint-plugin-promise'); +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + rules: { + "sonarjs/no-implicit-dependencies": "warn", + } + }, +]; \ No newline at end of file diff --git a/packages/odata-vocabularies/src/vocabulary-service.ts b/packages/odata-vocabularies/src/vocabulary-service.ts index 8f6d2e2ec2f..573059e6ac8 100644 --- a/packages/odata-vocabularies/src/vocabulary-service.ts +++ b/packages/odata-vocabularies/src/vocabulary-service.ts @@ -802,7 +802,7 @@ export class VocabularyService { getDerivedTypeNames(typeName: FullyQualifiedName, includeAbstract?: boolean): Set { let names: { fName: FullyQualifiedName; isAbstract: boolean | undefined }[] = []; const type = this.dictionary.get(typeName); - if (type && type.kind === COMPLEX_TYPE_KIND) { + if (type?.kind === COMPLEX_TYPE_KIND) { // collect all derived types names.push({ fName: typeName, isAbstract: type.isAbstract }); const stack = [typeName]; diff --git a/packages/playwright/.eslintignore b/packages/playwright/.eslintignore deleted file mode 100644 index cc1f8e004cc..00000000000 --- a/packages/playwright/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test/fixtures -dist diff --git a/packages/playwright/.eslintrc.js b/packages/playwright/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/playwright/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/playwright/eslint.config.js b/packages/playwright/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/playwright/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/preview-middleware-client/.eslintignore b/packages/preview-middleware-client/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/packages/preview-middleware-client/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/packages/preview-middleware-client/.eslintrc.js b/packages/preview-middleware-client/.eslintrc.js deleted file mode 100644 index 4b940075174..00000000000 --- a/packages/preview-middleware-client/.eslintrc.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = { - root: true, - extends: ['plugin:@sap-ux/eslint-plugin-fiori-tools/defaultTS'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - 'quotes': ['error', 'single', { 'allowTemplateLiterals': true }], - 'valid-jsdoc': [ - 'error', - { - requireParamType: false, - requireReturn: false, - requireReturnType: false - } - ], - '@typescript-eslint/no-unused-vars': [ - 'error', - { - varsIgnorePattern: '^_', - argsIgnorePattern: '^_' - } - ], - '@typescript-eslint/no-unsafe-argument': 'warn', - '@typescript-eslint/no-unsafe-member-access': 'warn', - '@typescript-eslint/no-unsafe-assignment': 'warn' - }, - overrides: [ - { - files: ['types/*.*'], - rules: { - '@typescript-eslint/no-namespace': 'off', - 'jsdoc/require-jsdoc': 'off' - } - } - ] -}; diff --git a/packages/preview-middleware-client/eslint.config.js b/packages/preview-middleware-client/eslint.config.js new file mode 100644 index 00000000000..724310a12ed --- /dev/null +++ b/packages/preview-middleware-client/eslint.config.js @@ -0,0 +1,70 @@ +const { defineConfig } = require('eslint/config'); +const js = require('@eslint/js'); + +const jsdoc = require('eslint-plugin-jsdoc'); +const config = require('@sap-ux/eslint-plugin-fiori-tools'); + +module.exports = defineConfig([ + ...config.defaultTS, + { + languageOptions: { + ecmaVersion: 5, + sourceType: 'script', + + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigRootDir: './' + } + }, + plugins: { + jsdoc + }, + rules: { + quotes: [ + 'error', + 'single', + { + allowTemplateLiterals: true + } + ], + + // Replace valid-jsdoc with eslint-plugin-jsdoc rules + 'jsdoc/check-alignment': 'error', + 'jsdoc/check-param-names': 'error', + 'jsdoc/check-tag-names': 'error', + 'jsdoc/check-types': 'error', + 'jsdoc/implements-on-classes': 'error', + // "jsdoc/newline-after-description": 'error', + 'jsdoc/no-types': 'error', + 'jsdoc/require-description': 'error', + 'jsdoc/require-param': 'error', + 'jsdoc/require-param-description': 'error', + 'jsdoc/require-param-name': 'error', + 'jsdoc/require-param-type': 'off', + 'jsdoc/require-returns': 'off', + 'jsdoc/require-returns-check': 'error', + 'jsdoc/require-returns-description': 'error', + 'jsdoc/require-returns-type': 'off', + + '@typescript-eslint/no-unused-vars': [ + 'error', + { + varsIgnorePattern: '^_', + argsIgnorePattern: '^_' + } + ], + + '@typescript-eslint/no-unsafe-argument': 'warn', + '@typescript-eslint/no-unsafe-member-access': 'warn', + '@typescript-eslint/no-unsafe-assignment': 'warn' + } + }, + { + files: ['types/*.*'], + + rules: { + '@typescript-eslint/no-namespace': 'off', + 'jsdoc/require-jsdoc': 'off' + } + } +]); diff --git a/packages/preview-middleware-client/package.json b/packages/preview-middleware-client/package.json index 5b0702c7d0b..efbc5e1bfe4 100644 --- a/packages/preview-middleware-client/package.json +++ b/packages/preview-middleware-client/package.json @@ -35,6 +35,7 @@ "@sap-ux/eslint-plugin-fiori-tools": "workspace:*", "@sap-ux/i18n": "workspace:*", "@ui5/cli": "3.8.0", + "eslint-plugin-jsdoc": "^50.6.9", "npm-run-all2": "6.2.0", "ui5-tooling-transpile": "3.4.0", "vscode-languageserver-textdocument": "1.0.11" diff --git a/packages/preview-middleware-client/src/adp/controllers/AddFragment.controller.ts b/packages/preview-middleware-client/src/adp/controllers/AddFragment.controller.ts index 64cc71d1b33..f7e20efe856 100644 --- a/packages/preview-middleware-client/src/adp/controllers/AddFragment.controller.ts +++ b/packages/preview-middleware-client/src/adp/controllers/AddFragment.controller.ts @@ -38,10 +38,25 @@ import BaseDialog from './BaseDialog.controller'; const radix = 10; export type AddFragmentModel = JSONModel & { + /** + * + */ getProperty(sPath: '/title'): string; + /** + * + */ getProperty(sPath: '/completeView'): boolean; + /** + * + */ getProperty(sPath: '/newFragmentName'): string; + /** + * + */ getProperty(sPath: '/selectedIndex'): number; + /** + * + */ getProperty(sPath: '/selectedAggregation/value'): string; }; diff --git a/packages/preview-middleware-client/src/adp/controllers/AddSubpage.controller.ts b/packages/preview-middleware-client/src/adp/controllers/AddSubpage.controller.ts index 95f49406027..de3d0d0874a 100644 --- a/packages/preview-middleware-client/src/adp/controllers/AddSubpage.controller.ts +++ b/packages/preview-middleware-client/src/adp/controllers/AddSubpage.controller.ts @@ -1,5 +1,5 @@ /** sap.m */ -import Button from 'sap/m/Button'; +import type Button from 'sap/m/Button'; import type Dialog from 'sap/m/Dialog'; import type ComboBox from 'sap/m/ComboBox'; @@ -58,8 +58,17 @@ export interface AddSubpageOptions { export type AddSubpageModel = JSONModel & { getProperty(sPath: '/title'): string; + /** + * + */ getProperty(sPath: '/navigationData'): { navProperty: string; entitySet: string }[]; + /** + * + */ getProperty(sPath: '/selectedPageType/key'): SubpageType; + /** + * + */ getProperty(sPath: '/selectedNavigation/key'): string; }; @@ -107,6 +116,10 @@ export default class AddSubpage extends BaseDialog { // TODO: to be supported in future releases } + /** + * + * @param event + */ onNavigationChange(event: Event) { const source = event.getSource(); const selectedKey = source.getSelectedKey(); diff --git a/packages/preview-middleware-client/src/adp/controllers/AddTableColumnFragments.controller.ts b/packages/preview-middleware-client/src/adp/controllers/AddTableColumnFragments.controller.ts index 1e194d1e840..07d8fb3d45c 100644 --- a/packages/preview-middleware-client/src/adp/controllers/AddTableColumnFragments.controller.ts +++ b/packages/preview-middleware-client/src/adp/controllers/AddTableColumnFragments.controller.ts @@ -1,5 +1,5 @@ /** sap.m */ -import Button from 'sap/m/Button'; +import type Button from 'sap/m/Button'; import type Dialog from 'sap/m/Dialog'; /** sap.ui.core */ @@ -18,7 +18,7 @@ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; /** sap.ui.fl */ -import { AddTableCellFragmentChangeContentType } from 'sap/ui/fl/Change'; +import type { AddTableCellFragmentChangeContentType } from 'sap/ui/fl/Change'; /** sap.ui.layout */ import { type SimpleForm } from 'sap/ui/layout/form'; @@ -45,7 +45,13 @@ import BaseDialog from './BaseDialog.controller'; const radix = 10; type AddTableColumnsFragmentsModel = AddFragmentModel & { + /** + * + */ getProperty(sPath: '/newColumnFragmentName'): string; + /** + * + */ getProperty(sPath: '/newCellFragmentName'): string; }; diff --git a/packages/preview-middleware-client/src/adp/controllers/BaseDialog.controller.ts b/packages/preview-middleware-client/src/adp/controllers/BaseDialog.controller.ts index aecec44d5e7..14a791ad6ce 100644 --- a/packages/preview-middleware-client/src/adp/controllers/BaseDialog.controller.ts +++ b/packages/preview-middleware-client/src/adp/controllers/BaseDialog.controller.ts @@ -1,8 +1,8 @@ -import Dialog from 'sap/m/Dialog'; -import Input from 'sap/m/Input'; -import Event from 'sap/ui/base/Event'; -import ManagedObject from 'sap/ui/base/ManagedObject'; -import UI5Element from 'sap/ui/core/Element'; +import type Dialog from 'sap/m/Dialog'; +import type Input from 'sap/m/Input'; +import type Event from 'sap/ui/base/Event'; +import type ManagedObject from 'sap/ui/base/ManagedObject'; +import type UI5Element from 'sap/ui/core/Element'; import { ValueState } from 'sap/ui/core/library'; import Controller from 'sap/ui/core/mvc/Controller'; import JSONModel from 'sap/ui/model/json/JSONModel'; @@ -20,6 +20,9 @@ import { reportTelemetry } from '@sap-ux-private/control-property-editor-common' import Log from 'sap/base/Log'; type BaseDialogModel = JSONModel & { + /** + * + */ getProperty(sPath: '/fragmentList'): Fragments; }; @@ -83,6 +86,7 @@ export default abstract class BaseDialog { public readonly data: ExtensionPointData; + /** + * + * @param name + * @param _overlays + * @param rta + * @param data + */ constructor(name: string, _overlays: UI5Element, rta: RuntimeAuthoring, data: ExtensionPointData) { super(name); this.model = new JSONModel(); diff --git a/packages/preview-middleware-client/src/adp/controllers/FileExistsDialog.controller.ts b/packages/preview-middleware-client/src/adp/controllers/FileExistsDialog.controller.ts index 526b370f93c..9f64eb8505d 100644 --- a/packages/preview-middleware-client/src/adp/controllers/FileExistsDialog.controller.ts +++ b/packages/preview-middleware-client/src/adp/controllers/FileExistsDialog.controller.ts @@ -15,8 +15,17 @@ export interface FileExistsDialogOptions { } type FileExistModel = JSONModel & { + /** + * + */ getProperty(sPath: '/filePath'): string; + /** + * + */ getProperty(sPath: '/filePathFromRoot'): string; + /** + * + */ getProperty(sPath: '/isRunningInBAS'): boolean; }; @@ -26,6 +35,11 @@ type FileExistModel = JSONModel & { export default class FileExistsDialog extends BaseDialog { private options: FileExistsDialogOptions; public model: JSONModel; + /** + * + * @param name + * @param options + */ constructor(name: string, options: FileExistsDialogOptions) { super(name); this.model = new JSONModel(); diff --git a/packages/preview-middleware-client/src/adp/dialog-factory.ts b/packages/preview-middleware-client/src/adp/dialog-factory.ts index 5cfd91f3917..df9dea9cf63 100644 --- a/packages/preview-middleware-client/src/adp/dialog-factory.ts +++ b/packages/preview-middleware-client/src/adp/dialog-factory.ts @@ -1,11 +1,12 @@ -import Dialog from 'sap/m/Dialog'; -import UI5Element from 'sap/ui/core/Element'; +import type Dialog from 'sap/m/Dialog'; +import type UI5Element from 'sap/ui/core/Element'; import Fragment from 'sap/ui/core/Fragment'; -import RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; +import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import { getTextBundle } from '../i18n'; -import AddFragment, { AddFragmentOptions } from './controllers/AddFragment.controller'; +import type { AddFragmentOptions } from './controllers/AddFragment.controller'; +import AddFragment from './controllers/AddFragment.controller'; import AddTableColumnFragments from './controllers/AddTableColumnFragments.controller'; import ControllerExtension from './controllers/ControllerExtension.controller'; import ExtensionPoint from './controllers/ExtensionPoint.controller'; @@ -41,6 +42,9 @@ type DialogData = ExtensionPointData | AddFragmentData | ExtendControllerData; export const OPEN_DIALOG_STATUS_CHANGED = 'OPEN_DIALOG_STATUS_CHANGED'; +/** + * + */ export class DialogFactory { private static readonly eventTarget = new EventTarget(); private static isDialogOpen = false; @@ -48,6 +52,9 @@ export class DialogFactory { * Only one dialog can be open at a time. This flag indicates if a new dialog can be opened. */ + /** + * + */ public static get canOpenDialog(): boolean { return !this.isDialogOpen; } diff --git a/packages/preview-middleware-client/src/adp/extension-point.ts b/packages/preview-middleware-client/src/adp/extension-point.ts index 631db384ed3..652c87e3177 100644 --- a/packages/preview-middleware-client/src/adp/extension-point.ts +++ b/packages/preview-middleware-client/src/adp/extension-point.ts @@ -4,9 +4,11 @@ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import AddXMLAtExtensionPoint from 'sap/ui/rta/plugin/AddXMLAtExtensionPoint'; import CommandFactory from 'sap/ui/rta/command/CommandFactory'; -import { ExternalAction, addExtensionPoint } from '@sap-ux-private/control-property-editor-common'; +import type { ExternalAction } from '@sap-ux-private/control-property-editor-common'; +import { addExtensionPoint } from '@sap-ux-private/control-property-editor-common'; -import { Deferred, createDeferred } from './utils'; +import type { Deferred } from './utils'; +import { createDeferred } from './utils'; import { DialogFactory, DialogNames } from './dialog-factory'; import { CommunicationService } from '../cpe/communication-service'; @@ -38,6 +40,9 @@ export interface ExtensionPointData { info: ExtensionPointInfo[]; } +/** + * + */ export default class ExtensionPointService { private readonly actionId = 'CTX_ADDXML_AT_EXTENSIONPOINT'; private selectedExtensionPointName: string; @@ -64,7 +69,7 @@ export default class ExtensionPointService { service.execute(baseControlId, this.actionId); this.selectedExtensionPointName = name; - } catch (e) { + } catch { throw new Error(`Failed to execute service with actionId: ${this.actionId}`); } } @@ -99,7 +104,7 @@ export default class ExtensionPointService { * @returns Deferred extension point data that is provided to the plugin */ public async fragmentHandler(overlay: UI5Element, info: ExtensionPointInfo[]): Promise { - let deferred = createDeferred(); + const deferred = createDeferred(); const name = this.selectedExtensionPointName; await DialogFactory.createDialog(overlay, this.rta, DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT, { diff --git a/packages/preview-middleware-client/src/adp/init-dialogs.ts b/packages/preview-middleware-client/src/adp/init-dialogs.ts index 52684fa4906..b99040e4f2d 100644 --- a/packages/preview-middleware-client/src/adp/init-dialogs.ts +++ b/packages/preview-middleware-client/src/adp/init-dialogs.ts @@ -1,5 +1,5 @@ /** sap.ui.core */ -import UI5Element from 'sap/ui/core/Element'; +import type UI5Element from 'sap/ui/core/Element'; /** sap.ui.rta */ import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; @@ -25,7 +25,6 @@ import { getSyncViewIds } from './sync-views-utils'; * @param control UI5 control. * @param isReuseComponent Function to check if the control is a reuse component. * @param isCloud Whether the application is running in the cloud - * * @returns boolean whether menu item is enabled or not */ export function isControllerExtensionEnabledForControl( @@ -50,7 +49,6 @@ export function isControllerExtensionEnabledForControl( * @param overlays Control overlays * @param isReuseComponent Function to check if the control is a reuse component. * @param isCloud Whether the application is running in the cloud - * * @returns boolean whether menu item is enabled or not */ export const isControllerExtensionEnabled = ( diff --git a/packages/preview-middleware-client/src/adp/init.ts b/packages/preview-middleware-client/src/adp/init.ts index 19e5fae3273..edfb80b12b6 100644 --- a/packages/preview-middleware-client/src/adp/init.ts +++ b/packages/preview-middleware-client/src/adp/init.ts @@ -24,6 +24,10 @@ import { initDialogs } from './init-dialogs'; import { sendInfoCenterMessage } from '../utils/info-center-message'; import { CommunicationService } from '../cpe/communication-service'; +/** + * + * @param rta + */ export default async function (rta: RuntimeAuthoring) { const flexSettings = rta.getFlexSettings(); if (flexSettings.telemetry === true) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/common/add-controller-to-page.ts b/packages/preview-middleware-client/src/adp/quick-actions/common/add-controller-to-page.ts index da3bc0b8cce..8d24012bb46 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/common/add-controller-to-page.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/common/add-controller-to-page.ts @@ -1,5 +1,5 @@ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import { getUi5Version } from '../../../utils/version'; import { getControllerInfoForControl, getReuseComponentChecker, checkForExistingChange } from '../../utils'; @@ -26,6 +26,10 @@ export class AddControllerToPageQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ADD_CONTROLLER_TO_PAGE_TYPE, CONTROL_TYPES, '', context, [ DIALOG_ENABLEMENT_VALIDATOR, @@ -71,10 +75,16 @@ export class AddControllerToPageQuickAction } } + /** + * + */ protected get textKey() { return this.controllerExists ? 'QUICK_ACTION_SHOW_PAGE_CONTROLLER' : 'QUICK_ACTION_ADD_PAGE_CONTROLLER'; } + /** + * + */ async execute(): Promise { if (this.control) { const overlay = OverlayRegistry.getOverlay(this.control) || []; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/common/add-new-annotation-file.ts b/packages/preview-middleware-client/src/adp/quick-actions/common/add-new-annotation-file.ts index 39605d3e62b..dba712f3f2b 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/common/add-new-annotation-file.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/common/add-new-annotation-file.ts @@ -1,4 +1,4 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import { NESTED_QUICK_ACTION_KIND, @@ -36,10 +36,17 @@ export class AddNewAnnotationFile readonly type = ADD_NEW_ANNOTATION_FILE; readonly forceRefreshAfterExecution = true; public isApplicable = true; + /** + * + */ public get id(): string { return `${this.context.key}-${this.type}`; } private annotationDataSourceData: AnnotationDataSourceResponse; + /** + * + * @param context + */ constructor(protected readonly context: QuickActionContext) { super(ADD_NEW_ANNOTATION_FILE, NESTED_QUICK_ACTION_KIND, '', context, [DIALOG_ENABLEMENT_VALIDATOR]); } @@ -81,6 +88,9 @@ export class AddNewAnnotationFile } } } + /** + * + */ protected get textKey() { let result = ADD_NEW_ANNOTATION_FILE_TITLE; const dataSourceIds = Object.keys(this.annotationDataSourceData.annotationDataSourceMap); @@ -92,6 +102,10 @@ export class AddNewAnnotationFile } return result; } + /** + * + * @param path + */ async execute(path: string): Promise { const { annotationDataSourceMap, isRunningInBAS } = this.annotationDataSourceData; const appType = getApplicationType(this.context.rta.getRootControlInstance().getManifest()); @@ -160,6 +174,7 @@ export class AddNewAnnotationFile /** * Prepares nested quick action object + * * @returns action instance */ getActionObject(): NestedQuickAction { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/common/create-page-action.ts b/packages/preview-middleware-client/src/adp/quick-actions/common/create-page-action.ts index 622df4117ea..5d57b87b58c 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/common/create-page-action.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/common/create-page-action.ts @@ -1,10 +1,14 @@ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import { DialogFactory, DialogNames } from '../../dialog-factory'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base'; -import { ApplicationType, getApplicationType } from '../../../utils/application'; +import type { ApplicationType } from '../../../utils/application'; +import { getApplicationType } from '../../../utils/application'; import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version'; import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator'; @@ -16,6 +20,10 @@ const CONTROL_TYPES = ['sap.f.DynamicPageTitle', 'sap.uxap.ObjectPageHeader', 's */ export class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { private readonly appType: ApplicationType; + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ADD_PAGE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_PAGE_ACTION', context, [ DIALOG_ENABLEMENT_VALIDATOR @@ -31,6 +39,9 @@ export class AddPageActionQuickAction extends SimpleQuickActionDefinitionBase im await super.initialize(); } + /** + * + */ async execute(): Promise { if (this.control) { const overlay = OverlayRegistry.getOverlay(this.control) || []; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-custom-section.ts b/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-custom-section.ts index 0951c24fc50..91c71abb37e 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-custom-section.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-custom-section.ts @@ -1,10 +1,13 @@ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import ObjectPageLayout from 'sap/uxap/ObjectPageLayout'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type ObjectPageLayout from 'sap/uxap/ObjectPageLayout'; import { DialogFactory, DialogNames } from '../../dialog-factory'; import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base'; import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator'; @@ -18,12 +21,19 @@ export class AddCustomSectionQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(OP_ADD_CUSTOM_SECTION, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_CUSTOM_SECTION', context, [ DIALOG_ENABLEMENT_VALIDATOR ]); } + /** + * + */ async execute(): Promise { const objectPageLayout = getRelevantControlFromActivePage( this.context.controlIndex, diff --git a/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-header-field.ts b/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-header-field.ts index 1221503d22d..ea1d7d41628 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-header-field.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/common/op-add-header-field.ts @@ -1,14 +1,17 @@ import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import ObjectPageLayout from 'sap/uxap/ObjectPageLayout'; -import FlexBox from 'sap/m/FlexBox'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type ObjectPageLayout from 'sap/uxap/ObjectPageLayout'; +import type FlexBox from 'sap/m/FlexBox'; import { DialogFactory, DialogNames } from '../../dialog-factory'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { isA } from '../../../utils/core'; import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base'; import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator'; -import { EnablementValidatorResult } from '../enablement-validator'; +import type { EnablementValidatorResult } from '../enablement-validator'; import { getTextBundle } from '../../../i18n'; export const OP_ADD_HEADER_FIELD_TYPE = 'op-add-header-field'; @@ -21,6 +24,10 @@ export class AddHeaderFieldQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(OP_ADD_HEADER_FIELD_TYPE, CONTROL_TYPES, 'QUICK_ACTION_OP_ADD_HEADER_FIELD', context, [ DIALOG_ENABLEMENT_VALIDATOR, @@ -39,6 +46,9 @@ export class AddHeaderFieldQuickAction ]); } + /** + * + */ async execute(): Promise { if (!this.control) { return []; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/common/utils.ts b/packages/preview-middleware-client/src/adp/quick-actions/common/utils.ts index b285668dd40..859d144acc9 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/common/utils.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/common/utils.ts @@ -1,5 +1,9 @@ -import { TextBundle } from '../../../i18n'; +import type { TextBundle } from '../../../i18n'; +/** + * + * @param resourceBundle + */ export function getTooltipsForTableEmptyRowModeAction(resourceBundle: TextBundle) { const alreadyEnabledTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_ALREADY_ENABLED'); const unsupportedCreationRowsTooltip = resourceBundle.getText('EMPTY_ROW_MODE_IS_NOT_SUPPORTED'); diff --git a/packages/preview-middleware-client/src/adp/quick-actions/enablement-validator.ts b/packages/preview-middleware-client/src/adp/quick-actions/enablement-validator.ts index a636f689bb8..1ba596b05a5 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/enablement-validator.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/enablement-validator.ts @@ -12,6 +12,7 @@ export type EnablementValidatorResult = undefined | EnablementValidatorError; export interface EnablementValidator { /** * Checks if action can be executed. + * * @returns Validation result. */ run: () => EnablementValidatorResult | Promise; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/change-table-columns.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/change-table-columns.ts index d42e83e5ee2..add4388aefb 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/change-table-columns.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/change-table-columns.ts @@ -1,9 +1,12 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import type Table from 'sap/m/Table'; import type SmartTable from 'sap/ui/comp/smarttable/SmartTable'; -import ManagedObject from 'sap/ui/base/ManagedObject'; +import type ManagedObject from 'sap/ui/base/ManagedObject'; -import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + NestedQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { getControlById, isA } from '../../../utils/core'; import { TableQuickActionDefinitionBase } from '../table-quick-action-base'; import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator'; @@ -12,10 +15,17 @@ import { M_TABLE_TYPE, SMART_TABLE_TYPE } from '../control-types'; export const CHANGE_TABLE_COLUMNS = 'change-table-columns'; const CONTROL_TYPES = [SMART_TABLE_TYPE]; +/** + * + */ export class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super( CHANGE_TABLE_COLUMNS, @@ -29,6 +39,10 @@ export class ChangeTableColumnsQuickAction [DIALOG_ENABLEMENT_VALIDATOR] ); } + /** + * + * @param path + */ async execute(path: string): Promise { const { table, iconTabBarFilterKey, changeColumnActionId, sectionInfo } = this.tableMap[path]; if (!table) { @@ -67,6 +81,11 @@ export class ChangeTableColumnsQuickAction return []; } + /** + * + * @param element + * @param aggregationName + */ private isAbsoluteAggregationBinding(element: ManagedObject, aggregationName: string): boolean { const mBindingInfo = element.getBindingInfo(aggregationName); const path = mBindingInfo?.path; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/create-table-action.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/create-table-action.ts index 888dd6a743c..2a6350d12c9 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/create-table-action.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/create-table-action.ts @@ -1,9 +1,9 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import type Table from 'sap/m/Table'; import type SmartTable from 'sap/ui/comp/smarttable/SmartTable'; import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; -import ManagedObject from 'sap/ui/base/ManagedObject'; -import UI5Element from 'sap/ui/core/Element'; +import type ManagedObject from 'sap/ui/base/ManagedObject'; +import type UI5Element from 'sap/ui/core/Element'; import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; import { getControlById, isA } from '../../../utils/core'; @@ -19,7 +19,14 @@ export const CREATE_TABLE_ACTION = 'create-table-action'; const CONTROL_TYPES = [SMART_TABLE_TYPE, M_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE]; +/** + * + */ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(CREATE_TABLE_ACTION, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [ DIALOG_ENABLEMENT_VALIDATOR @@ -45,6 +52,10 @@ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase im // disable nested actions based on conditions this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`)); } + /** + * + * @param path + */ async execute(path: string): Promise { const { table, iconTabBarFilterKey, sectionInfo } = this.tableMap[path]; if (!table) { @@ -86,6 +97,10 @@ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase im return []; } + /** + * + * @param table + */ getHeaderToolbar(table: UI5Element): ManagedObject | ManagedObject[] | OverflowToolbar | null | undefined { let headerToolbar; if (isA(SMART_TABLE_TYPE, table)) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/create-table-custom-column.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/create-table-custom-column.ts index f9ebac31b71..3797fdd9399 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/create-table-custom-column.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/create-table-custom-column.ts @@ -1,14 +1,14 @@ -import ManagedObject from 'sap/ui/base/ManagedObject'; -import UI5Element from 'sap/ui/core/Element'; +import type ManagedObject from 'sap/ui/base/ManagedObject'; +import type UI5Element from 'sap/ui/core/Element'; import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; -import ObjectPageSection from 'sap/uxap/ObjectPageSection'; -import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection'; -import ObjectPageLayout from 'sap/uxap/ObjectPageLayout'; +import type ObjectPageSection from 'sap/uxap/ObjectPageSection'; +import type ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection'; +import type ObjectPageLayout from 'sap/uxap/ObjectPageLayout'; -import IconTabBar from 'sap/m/IconTabBar'; +import type IconTabBar from 'sap/m/IconTabBar'; import type SmartTable from 'sap/ui/comp/smarttable/SmartTable'; @@ -64,10 +64,17 @@ export function preprocessActionExecution( } } +/** + * + */ export class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super( CREATE_TABLE_CUSTOM_COLUMN, @@ -81,6 +88,10 @@ export class AddTableCustomColumnQuickAction ); } + /** + * + * @param path + */ async execute(path: string): Promise { const { table, iconTabBarFilterKey, sectionInfo } = this.tableMap[path]; if (!table) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts index 31ba57993cf..ac71920f8b9 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-semantic-date-range-filter-bar.ts @@ -1,11 +1,14 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { pageHasControlId } from '../../../cpe/quick-actions/utils'; import { getControlById, isA } from '../../../utils/core'; import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base'; import { areManifestChangesSupported, prepareManifestChange } from './utils'; import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version'; -import SmartFilterBar from 'sap/ui/comp/smartfilterbar/SmartFilterBar'; +import type SmartFilterBar from 'sap/ui/comp/smartfilterbar/SmartFilterBar'; export const ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR = 'enable-semantic-daterange-filterbar'; const CONTROL_TYPE_LR = 'sap.ui.comp.smartfilterbar.SmartFilterBar'; @@ -20,6 +23,10 @@ export class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR, [], '', context); } @@ -52,12 +59,18 @@ export class ToggleSemanticDateRangeFilterBar } } + /** + * + */ protected get textKey() { return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR'; } + /** + * + */ async execute(): Promise { const version = await getUi5Version(); const isLowerMinimalVersion = isLowerThanMinimalUi5Version(version, { major: 1, minor: 126 }); diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts index 5a8d6a79ce1..45ada4a27f2 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-table-filtering.ts @@ -1,8 +1,11 @@ -import SmartTable from 'sap/ui/comp/smarttable/SmartTable'; +import type SmartTable from 'sap/ui/comp/smarttable/SmartTable'; import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { getRelevantControlFromActivePage, pageHasControlId } from '../../../cpe/quick-actions/utils'; import { GRID_TABLE_TYPE, M_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types'; import { areManifestChangesSupported, prepareManifestChange } from './utils'; @@ -23,6 +26,10 @@ export class EnableTableFilteringQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ENABLE_TABLE_FILTERING, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context, [ { @@ -77,6 +84,9 @@ export class EnableTableFilteringQuickAction } } + /** + * + */ async execute(): Promise { if (!this.control) { return []; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-variant-management.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-variant-management.ts index 4de8e68b968..2376aeeda5a 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-variant-management.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-enable-variant-management.ts @@ -1,8 +1,11 @@ import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { areManifestChangesSupported, prepareManifestChange } from './utils'; -import ListReportComponent from 'sap/suite/ui/generic/template/ListReport'; +import type ListReportComponent from 'sap/suite/ui/generic/template/ListReport'; import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base'; import Component from 'sap/ui/core/Component'; @@ -22,6 +25,10 @@ export class EnableListReportVariantManagementQuickAction private ownerComponent: ListReportComponent; readonly forceRefreshAfterExecution = true; + /** + * + * @param context + */ constructor(context: QuickActionContext) { super( ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, @@ -73,6 +80,9 @@ export class EnableListReportVariantManagementQuickAction } } + /** + * + */ async execute(): Promise { if (!this.control) { return []; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts index ed376d7031c..03accc08420 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/lr-toggle-clear-filter-bar.ts @@ -1,8 +1,11 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import CommandFactory from 'sap/ui/rta/command/CommandFactory'; import type FilterBar from 'sap/ui/comp/filterbar/FilterBar'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { pageHasControlId } from '../../../cpe/quick-actions/utils'; import { getControlById } from '../../../utils/core'; import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base'; @@ -19,12 +22,19 @@ export class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context); } private isClearButtonEnabled = false; + /** + * + */ initialize(): Promise { const controls = [ ...(this.context.controlIndex[CONTROL_TYPE_LR] ?? []), @@ -41,12 +51,18 @@ export class ToggleClearFilterBarQuickAction return Promise.resolve(); } + /** + * + */ protected get textKey() { return this.isClearButtonEnabled ? 'V2_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V2_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR'; } + /** + * + */ async execute(): Promise { if (this.control) { const { flexSettings } = this.context; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts index df5ca86937d..e45af569277 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/op-enable-empty-row-mode.ts @@ -1,10 +1,13 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + NestedQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { TableQuickActionDefinitionBase } from '../table-quick-action-base'; import { ANALYTICAL_TABLE_TYPE, SMART_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types'; -import { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common'; +import type { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common'; import { areManifestChangesSupported, prepareManifestChange } from './utils'; import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version'; import { isA } from '../../../utils/core'; @@ -18,12 +21,19 @@ const UNSUPPORTED_TABLES = [ANALYTICAL_TABLE_TYPE, TREE_TABLE_TYPE]; const CREATION_ROWS_MODE = 'creationRows'; const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage'; +/** + * + */ export class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { readonly forceRefreshAfterExecution = true; + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context); } @@ -66,6 +76,10 @@ export class EnableTableEmptyRowModeQuickAction this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`)); } + /** + * + * @param path + */ async execute(path: string): Promise { const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path]; if (!table) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/op-enable-variant-management.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/op-enable-variant-management.ts index 7c58b2156b4..c8028d45db5 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/op-enable-variant-management.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/op-enable-variant-management.ts @@ -1,13 +1,16 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + NestedQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { TableQuickActionDefinitionBase } from '../table-quick-action-base'; import { SMART_TABLE_TYPE } from '../control-types'; -import { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common'; +import type { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common'; import { areManifestChangesSupported, prepareManifestChange } from './utils'; import { preprocessActionExecution } from './create-table-custom-column'; -import SmartTableExtended from 'sap/ui/comp/smarttable'; +import type SmartTableExtended from 'sap/ui/comp/smarttable'; export const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts'; @@ -15,12 +18,19 @@ const CONTROL_TYPES = [SMART_TABLE_TYPE]; const OBJECT_PAGE_COMPONENT_NAME = 'sap.suite.ui.generic.template.ObjectPage'; +/** + * + */ export class EnableObjectPageVariantManagementQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { readonly forceRefreshAfterExecution = true; + /** + * + * @param context + */ constructor(context: QuickActionContext) { super( ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, @@ -78,6 +88,10 @@ export class EnableObjectPageVariantManagementQuickAction this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`)); } + /** + * + * @param path + */ async execute(path: string): Promise { const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path]; if (!table) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/registry.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/registry.ts index 2a187dfe14d..47477fc6a5e 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/registry.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/registry.ts @@ -1,5 +1,5 @@ import XMLView from 'sap/ui/core/mvc/XMLView'; -import Control from 'sap/ui/core/Control'; +import type Control from 'sap/ui/core/Control'; import ComponentContainer from 'sap/ui/core/ComponentContainer'; import type { @@ -39,6 +39,10 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist [OBJECT_PAGE_TYPE]: 'objectPage', [ANALYTICAL_LIST_PAGE_TYPE]: 'analyticalListPage' }; + /** + * + * @param context + */ getDefinitions(context: QuickActionActivationContext): QuickActionDefinitionGroup[] { const activePages = this.getActivePageContent(context.controlIndex); @@ -110,6 +114,10 @@ export default class FEV2QuickActionRegistry extends QuickActionDefinitionRegist return definitionGroups; } + /** + * + * @param page + */ protected getComponentContainerFromPage(page: Control): ComponentContainer | undefined { // in ui5 version 1.71 there is no XMLView wrapper around ComponentContainer const componentContainer = page instanceof XMLView ? page.getContent()[0] : page; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/utils.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/utils.ts index 0113ce5bb02..97f17f7fdfa 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/utils.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v2/utils.ts @@ -1,10 +1,10 @@ -import UI5Element from 'sap/ui/core/Element'; -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type UI5Element from 'sap/ui/core/Element'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import CommandFactory from 'sap/ui/rta/command/CommandFactory'; -import { QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition'; +import type { QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition'; import { getUi5Version, isLowerThanMinimalUi5Version, isVersionEqualOrHasNewerPatch } from '../../../utils/version'; -import { Manifest } from 'sap/ui/rta/RuntimeAuthoring'; +import type { Manifest } from 'sap/ui/rta/RuntimeAuthoring'; import Component from 'sap/ui/core/Component'; import type AppComponent from 'sap/suite/ui/generic/template/lib/AppComponent'; import type ManagedObject from 'sap/ui/base/ManagedObject'; @@ -35,7 +35,6 @@ export function getV2AppComponent(control: ManagedObject): AppComponent | undefi * @param component - component name e.g list report or object page. * @param entitySet - Entity Set name. * @param propertyValue - The value to be set for the property. - * * @returns A Promise resolving to an array of FlexCommand objects. */ export async function prepareManifestChange( @@ -76,6 +75,7 @@ export async function prepareManifestChange( /** * Checks whether the manifest has array structured page definitions + * * @param manifest - manifest object * @returns true if pages are defined as array, false if defined as object */ @@ -93,7 +93,6 @@ export function isManifestArrayStructured(manifest: Manifest): boolean { * - If the manifest is structured is an array and is below version 1.134 * - If the UI5 version is not supported * Otherwise, returns `true`. - * */ export async function areManifestChangesSupported(manifest: Manifest): Promise { const version = await getUi5Version(); diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/change-table-columns.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/change-table-columns.ts index b25e87c33b2..0c49e5d0992 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/change-table-columns.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/change-table-columns.ts @@ -1,13 +1,16 @@ import OverlayUtil from 'sap/ui/dt/OverlayUtil'; -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; import FlexRuntimeInfoAPI from 'sap/ui/fl/apply/api/FlexRuntimeInfoAPI'; -import { QuickActionContext, NestedQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + NestedQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { getControlById } from '../../../utils/core'; import { TableQuickActionDefinitionBase } from '../table-quick-action-base'; import { MDC_TABLE_TYPE } from '../control-types'; import { DIALOG_ENABLEMENT_VALIDATOR } from '../dialog-enablement-validator'; import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils'; -import Table from 'sap/ui/mdc/Table'; +import type Table from 'sap/ui/mdc/Table'; export const CHANGE_TABLE_COLUMNS = 'change-table-columns'; const ACTION_ID = 'CTX_SETTINGS0'; @@ -19,6 +22,10 @@ export class ChangeTableColumnsQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(CHANGE_TABLE_COLUMNS, [MDC_TABLE_TYPE], 'V4_QUICK_ACTION_CHANGE_TABLE_COLUMNS', context, undefined, [ DIALOG_ENABLEMENT_VALIDATOR @@ -74,6 +81,10 @@ export class ChangeTableColumnsQuickAction } } + /** + * + * @param path + */ async execute(path: string): Promise { const { table } = this.tableMap[path]; if (!table) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/create-table-action.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/create-table-action.ts index 844051b8b19..cf3a0f1d0b5 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/create-table-action.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/create-table-action.ts @@ -18,12 +18,20 @@ export const CREATE_TABLE_ACTION = 'create-table-action'; * Quick Action for creating table action. */ export class AddTableActionQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(CREATE_TABLE_ACTION, [MDC_TABLE_TYPE], 'QUICK_ACTION_ADD_CUSTOM_TABLE_ACTION', context, undefined, [ DIALOG_ENABLEMENT_VALIDATOR ]); } + /** + * + * @param path + */ async execute(path: string): Promise { const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path]; if (!table) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/create-table-custom-column.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/create-table-custom-column.ts index a01c0ae1606..04d43e3d263 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/create-table-custom-column.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/create-table-custom-column.ts @@ -16,16 +16,27 @@ export const CREATE_TABLE_CUSTOM_COLUMN = 'create-table-custom-column'; export const CONTROL_TYPES = [SMART_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE, GRID_TABLE_TYPE]; +/** + * + */ export class AddTableCustomColumnQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(CREATE_TABLE_CUSTOM_COLUMN, CONTROL_TYPES, 'QUICK_ACTION_ADD_CUSTOM_TABLE_COLUMN', context, undefined, [ DIALOG_ENABLEMENT_VALIDATOR ]); } + /** + * + * @param path + */ async execute(path: string): Promise { const { table, iconTabBarFilterKey, sectionInfo } = this.tableMap[path]; if (!table) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/enable-variant-management.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/enable-variant-management.ts index 2da5298c22b..2e73ffbbde8 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/enable-variant-management.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/enable-variant-management.ts @@ -1,12 +1,15 @@ import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { SimpleQuickActionDefinitionBase } from '../simple-quick-action-base'; import Component from 'sap/ui/core/Component'; import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version'; import { createManifestPropertyChange } from '../../../utils/fe-v4'; -import ListReportComponent from 'sap/suite/ui/generic/template/ListReport'; +import type ListReportComponent from 'sap/suite/ui/generic/template/ListReport'; export const ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS = 'enable-variant-management-in-tables-charts'; @@ -22,6 +25,10 @@ export class EnableVariantManagementQuickAction { private pageSmartVariantManagementMode = ''; private ownerComponent: ListReportComponent; + /** + * + * @param context + */ constructor(context: QuickActionContext) { super( ENABLE_VARIANT_MANAGEMENT_IN_TABLES_CHARTS, @@ -75,6 +82,9 @@ export class EnableVariantManagementQuickAction } } + /** + * + */ async execute(): Promise { if (!this.control) { return []; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts index ab2637e2cd3..e2306826ae1 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-enable-semantic-date-range-filter-bar.ts @@ -1,7 +1,10 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import FilterBar from 'sap/ui/mdc/FilterBar'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FilterBar from 'sap/ui/mdc/FilterBar'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { pageHasControlId } from '../../../cpe/quick-actions/utils'; import { getControlById } from '../../../utils/core'; import { executeToggleAction } from './utils'; @@ -22,12 +25,19 @@ export class ToggleSemanticDateRangeFilterBar extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ENABLE_SEMANTIC_DATE_RANGE, [], '', context); } readonly forceRefreshAfterExecution = true; private isUseDateRangeTypeEnabled = false; + /** + * + */ initialize(): Promise { const controls = this.context.controlIndex[CONTROL_TYPE] ?? []; for (const control of controls) { @@ -46,12 +56,18 @@ export class ToggleSemanticDateRangeFilterBar return Promise.resolve(); } + /** + * + */ protected get textKey() { return this.isUseDateRangeTypeEnabled ? 'QUICK_ACTION_LR_DISABLE_SEMANTIC_DATE_RANGE_FILTER_BAR' : 'QUICK_ACTION_LR_ENABLE_SEMANTIC_DATE_RANGE_FILTER_BAR'; } + /** + * + */ async execute(): Promise { const command = await executeToggleAction( this.context, diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts index 68d396596b0..a69a1ed3091 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-enable-table-filtering.ts @@ -1,7 +1,10 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition'; -import Table from 'sap/ui/mdc/Table'; +import type { + NestedQuickActionDefinition, + QuickActionContext +} from '../../../cpe/quick-actions/quick-action-definition'; +import type Table from 'sap/ui/mdc/Table'; import { TableQuickActionDefinitionBase } from '../table-quick-action-base'; import { getRelevantControlFromActivePage } from '../../../cpe/quick-actions/utils'; import { createManifestPropertyChange } from '../../../utils/fe-v4'; @@ -25,6 +28,10 @@ export class EnableTableFilteringQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ENABLE_TABLE_FILTERING, [MDC_TABLE_TYPE], 'QUICK_ACTION_ENABLE_TABLE_FILTERING', context); } @@ -67,6 +74,10 @@ export class EnableTableFilteringQuickAction } } + /** + * + * @param path + */ async execute(path: string): Promise { const { flexSettings } = this.context; const { table } = this.tableMap[path]; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts index 67fafd9e72c..72edf7bcba8 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/lr-toggle-clear-filter-bar.ts @@ -1,7 +1,10 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import FilterBar from 'sap/ui/mdc/FilterBar'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FilterBar from 'sap/ui/mdc/FilterBar'; -import { QuickActionContext, SimpleQuickActionDefinition } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + QuickActionContext, + SimpleQuickActionDefinition +} from '../../../cpe/quick-actions/quick-action-definition'; import { pageHasControlId } from '../../../cpe/quick-actions/utils'; import { getControlById } from '../../../utils/core'; import { executeToggleAction } from './utils'; @@ -19,12 +22,19 @@ export class ToggleClearFilterBarQuickAction extends SimpleQuickActionDefinitionBase implements SimpleQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ENABLE_CLEAR_FILTER_BAR_TYPE, [], '', context); } readonly forceRefreshAfterExecution = true; private isClearButtonEnabled = false; + /** + * + */ initialize(): Promise { const controls = this.context.controlIndex[CONTROL_TYPE] ?? []; for (const control of controls) { @@ -42,12 +52,18 @@ export class ToggleClearFilterBarQuickAction return Promise.resolve(); } + /** + * + */ protected get textKey() { return this.isClearButtonEnabled ? 'V4_QUICK_ACTION_LR_DISABLE_CLEAR_FILTER_BAR' : 'V4_QUICK_ACTION_LR_ENABLE_CLEAR_FILTER_BAR'; } + /** + * + */ async execute(): Promise { const command = await executeToggleAction(this.context, this.isClearButtonEnabled, CONTROL_TYPE, PROPERTY_PATH); if (command.length) { diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts index 389cdc40ddd..fa6ed4b4c2c 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/op-enable-empty-row-mode.ts @@ -1,13 +1,16 @@ -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { NestedQuickActionDefinition, QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition'; +import type { + NestedQuickActionDefinition, + QuickActionContext +} from '../../../cpe/quick-actions/quick-action-definition'; import { createManifestPropertyChange } from '../../../utils/fe-v4'; import { getUi5Version, isLowerThanMinimalUi5Version } from '../../../utils/version'; import { ANALYTICAL_TABLE_TYPE, GRID_TABLE_TYPE, MDC_TABLE_TYPE, TREE_TABLE_TYPE } from '../control-types'; import { TableQuickActionDefinitionBase } from '../table-quick-action-base'; import { isA } from '../../../utils/core'; import { getTooltipsForTableEmptyRowModeAction } from '../common/utils'; -import { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common'; +import type { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common'; import { preprocessActionExecution } from '../fe-v2/create-table-custom-column'; export const ENABLE_TABLE_EMPTY_ROW_MODE = 'enable-table-empty-row-mode'; @@ -22,6 +25,10 @@ export class EnableTableEmptyRowModeQuickAction extends TableQuickActionDefinitionBase implements NestedQuickActionDefinition { + /** + * + * @param context + */ constructor(context: QuickActionContext) { super(ENABLE_TABLE_EMPTY_ROW_MODE, CONTROL_TYPES, 'QUICK_ACTION_ENABLE_TABLE_EMPTY_ROW_MODE', context); } @@ -58,6 +65,10 @@ export class EnableTableEmptyRowModeQuickAction this.children.forEach((nestedChild, idx) => processChild(nestedChild, `${idx.toFixed(0)}`)); } + /** + * + * @param path + */ async execute(path: string): Promise { const { flexSettings } = this.context; const { table, sectionInfo, iconTabBarFilterKey } = this.tableMap[path]; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/registry.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/registry.ts index db76dbf19ce..cd309ff9225 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/registry.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/registry.ts @@ -34,6 +34,10 @@ export default class FEV4QuickActionRegistry extends QuickActionDefinitionRegist [OBJECT_PAGE_TYPE]: 'objectPage' }; + /** + * + * @param context + */ getDefinitions(context: QuickActionActivationContext): QuickActionDefinitionGroup[] { const activePages = this.getActivePageContent(context.controlIndex); const definitionGroups: QuickActionDefinitionGroup[] = []; diff --git a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/utils.ts b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/utils.ts index 208fad0ae37..bf46c924f22 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/utils.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/fe-v4/utils.ts @@ -1,9 +1,16 @@ import { getControlById } from '../../../utils/core'; -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import { QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type { QuickActionContext } from '../../../cpe/quick-actions/quick-action-definition'; import CommandFactory from 'sap/ui/rta/command/CommandFactory'; import { getV4AppComponent, getPageName, getReference } from '../../../utils/fe-v4'; +/** + * + * @param context + * @param isButtonEnabled + * @param controlType + * @param propertyPath + */ export async function executeToggleAction( context: QuickActionContext, isButtonEnabled: boolean, diff --git a/packages/preview-middleware-client/src/adp/quick-actions/quick-action-base.ts b/packages/preview-middleware-client/src/adp/quick-actions/quick-action-base.ts index f77f8c3a1dc..46992d85b6e 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/quick-action-base.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/quick-action-base.ts @@ -1,4 +1,4 @@ -import { QuickActionContext } from '../../cpe/quick-actions/quick-action-definition'; +import type { QuickActionContext } from '../../cpe/quick-actions/quick-action-definition'; import { EnablementValidator, EnablementValidatorError, EnablementValidatorResult } from './enablement-validator'; import { DIALOG_ENABLEMENT_VALIDATOR } from './dialog-enablement-validator'; @@ -43,6 +43,9 @@ export abstract class QuickActionDefinitionBase { } protected validationResult: EnablementValidatorResult[] | undefined; + /** + * + */ protected get isDisabled(): boolean { if (this.validationResult === undefined) { return false; @@ -51,10 +54,21 @@ export abstract class QuickActionDefinitionBase { return validationErrors.length > 0; } + /** + * + */ protected get textKey(): string { return this.defaultTextKey; } + /** + * + * @param type + * @param kind + * @param defaultTextKey + * @param context + * @param enablementValidators + */ constructor( public readonly type: string, public readonly kind: T, diff --git a/packages/preview-middleware-client/src/adp/quick-actions/simple-quick-action-base.ts b/packages/preview-middleware-client/src/adp/quick-actions/simple-quick-action-base.ts index 25106c8c9a5..a3d4f91826d 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/simple-quick-action-base.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/simple-quick-action-base.ts @@ -1,10 +1,11 @@ -import UI5Element from 'sap/ui/core/Element'; +import type UI5Element from 'sap/ui/core/Element'; -import { SIMPLE_QUICK_ACTION_KIND, SimpleQuickAction } from '@sap-ux-private/control-property-editor-common'; +import type { SimpleQuickAction } from '@sap-ux-private/control-property-editor-common'; +import { SIMPLE_QUICK_ACTION_KIND } from '@sap-ux-private/control-property-editor-common'; import { getRelevantControlFromActivePage } from '../../cpe/quick-actions/utils'; -import { QuickActionContext } from '../../cpe/quick-actions/quick-action-definition'; -import { EnablementValidator } from './enablement-validator'; +import type { QuickActionContext } from '../../cpe/quick-actions/quick-action-definition'; +import type { EnablementValidator } from './enablement-validator'; import { QuickActionDefinitionBase } from './quick-action-base'; /** @@ -13,12 +14,23 @@ import { QuickActionDefinitionBase } from './quick-action-base'; export abstract class SimpleQuickActionDefinitionBase< T extends UI5Element = UI5Element > extends QuickActionDefinitionBase { + /** + * + */ public get isApplicable(): boolean { return this.control !== undefined; } protected control: T | undefined; + /** + * + * @param type + * @param controlTypes + * @param defaultTextKey + * @param context + * @param enablementValidators + */ constructor( public readonly type: string, protected readonly controlTypes: string[], @@ -29,6 +41,9 @@ export abstract class SimpleQuickActionDefinitionBase< super(type, SIMPLE_QUICK_ACTION_KIND, defaultTextKey, context, enablementValidators); } + /** + * + */ initialize(): Promise { this.control = getRelevantControlFromActivePage( this.context.controlIndex, @@ -38,6 +53,9 @@ export abstract class SimpleQuickActionDefinitionBase< return Promise.resolve(); } + /** + * + */ getActionObject(): SimpleQuickAction { return { kind: SIMPLE_QUICK_ACTION_KIND, diff --git a/packages/preview-middleware-client/src/adp/quick-actions/table-quick-action-base.ts b/packages/preview-middleware-client/src/adp/quick-actions/table-quick-action-base.ts index 3452ce25d7d..edd283bd4bc 100644 --- a/packages/preview-middleware-client/src/adp/quick-actions/table-quick-action-base.ts +++ b/packages/preview-middleware-client/src/adp/quick-actions/table-quick-action-base.ts @@ -1,21 +1,21 @@ -import UI5Element from 'sap/ui/core/Element'; -import { NESTED_QUICK_ACTION_KIND, NestedQuickAction } from '@sap-ux-private/control-property-editor-common'; +import type UI5Element from 'sap/ui/core/Element'; +import { NESTED_QUICK_ACTION_KIND } from '@sap-ux-private/control-property-editor-common'; import type IconTabBar from 'sap/m/IconTabBar'; import type IconTabFilter from 'sap/m/IconTabFilter'; import type Table from 'sap/m/Table'; import type MdcTable from 'sap/ui/mdc/Table'; import type SmartTable from 'sap/ui/comp/smarttable/SmartTable'; -import { QuickActionContext } from '../../cpe/quick-actions/quick-action-definition'; +import type { QuickActionContext } from '../../cpe/quick-actions/quick-action-definition'; import OverlayUtil from 'sap/ui/dt/OverlayUtil'; -import type { NestedQuickActionChild } from '@sap-ux-private/control-property-editor-common'; +import type { NestedQuickActionChild, NestedQuickAction } from '@sap-ux-private/control-property-editor-common'; import { getParentContainer, getRelevantControlFromActivePage } from '../../cpe/quick-actions/utils'; import { getControlById, isA, isManagedObject } from '../../utils/core'; import { getUi5Version, isLowerThanMinimalUi5Version } from '../../utils/version'; -import ObjectPageSection from 'sap/uxap/ObjectPageSection'; -import ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection'; -import ObjectPageLayout from 'sap/uxap/ObjectPageLayout'; -import ManagedObject from 'sap/ui/base/ManagedObject'; -import { EnablementValidator } from './enablement-validator'; +import type ObjectPageSection from 'sap/uxap/ObjectPageSection'; +import type ObjectPageSubSection from 'sap/uxap/ObjectPageSubSection'; +import type ObjectPageLayout from 'sap/uxap/ObjectPageLayout'; +import type ManagedObject from 'sap/ui/base/ManagedObject'; +import type { EnablementValidator } from './enablement-validator'; import { QuickActionDefinitionBase } from './quick-action-base'; import { ANALYTICAL_TABLE_TYPE, @@ -33,6 +33,10 @@ const SETTINGS_ID = 'CTX_SETTINGS'; const REARRANGE_TOOLBAR_SETTINGS_ID = 'CTX_SETTINGS0'; const ICON_TAB_BAR_TYPE = 'sap.m.IconTabBar'; +/** + * + * @param table + */ async function getActionId(table: UI5Element): Promise { const { major, minor } = await getUi5Version(); @@ -87,12 +91,24 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti > = {}; public iconTabBar: IconTabBar | undefined; + /** + * + */ protected get textKey(): string { return this.defaultTextKey; } protected control: UI5Element | undefined; + /** + * + * @param type + * @param controlTypes + * @param defaultTextKey + * @param context + * @param options + * @param enablementValidators + */ constructor( public readonly type: string, protected readonly controlTypes: string[], @@ -106,6 +122,7 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti /** * Adds action id to the table map entry, if the service actions are needed. + * * @param table - table element * @param tableMapKey - map key */ @@ -187,13 +204,14 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti ); } return tableInternal as UI5Element | undefined; - } catch (error) { + } catch { return undefined; } } /** * Determines table label for the given table element + * * @param table - table element * @returns table label if found or 'Unnamed table' */ @@ -215,6 +233,7 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti /** * Builds a map kay/tab_name for ICON_TAB_BAR control of the active page, if such exists + * * @returns built map */ protected buildIconTabBarFilterMap(): { [key: string]: string } { @@ -241,6 +260,7 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti /** * Collects subsection data in the table map for the given section and table + * * @param section - object page section * @param table - table element */ @@ -284,8 +304,12 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti /** * Processes table element and pushes table data to the children array + * * @param table - table element * @param sectionInfo - section info object + * @param sectionInfo.section + * @param sectionInfo.subSection + * @param sectionInfo.layout */ private async processTable( table: UI5Element, @@ -317,6 +341,7 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti /** * Selects closest overlay for the given table element + * * @param table - table element */ protected selectOverlay(table: UI5Element): void { @@ -328,6 +353,7 @@ export abstract class TableQuickActionDefinitionBase extends QuickActionDefiniti /** * Prepares nested quick action object + * * @returns action instance */ getActionObject(): NestedQuickAction { diff --git a/packages/preview-middleware-client/src/adp/utils.ts b/packages/preview-middleware-client/src/adp/utils.ts index 8bd3fc4c27f..0418b6b66e2 100644 --- a/packages/preview-middleware-client/src/adp/utils.ts +++ b/packages/preview-middleware-client/src/adp/utils.ts @@ -36,7 +36,6 @@ export function resetReuseComponentChecker(): void { * Defers the resolution of the promise, stores resolve/reject functions so that they can be accessed at a later stage. * * @description A Deferred object contains an unresolved promise along with the functions to resolve or reject that promise. - * * @returns {Deferred} Deferred object */ export function createDeferred(): Deferred { @@ -143,6 +142,10 @@ export function getControllerInfoForControl(control: ManagedObject): ControllerI * @returns The controller name and view ID. */ +/** + * + * @param overlayControl + */ export function getControllerInfo(overlayControl: ElementOverlay): ControllerInfo { const control = overlayControl.getElement(); return getControllerInfoForControl(control); diff --git a/packages/preview-middleware-client/src/cpe/changes/flex-change.ts b/packages/preview-middleware-client/src/cpe/changes/flex-change.ts index 55a6069e570..62551d748e6 100644 --- a/packages/preview-middleware-client/src/cpe/changes/flex-change.ts +++ b/packages/preview-middleware-client/src/cpe/changes/flex-change.ts @@ -54,7 +54,9 @@ export async function applyChange(options: UI5AdaptationOptions, change: Propert ); await rta.getCommandStack().pushAndExecute(command); } else if (change.propertyType === PropertyType.Configuration) { - const command = await createManifestPropertyChange(modifiedControl, flexSettings, { [change.propertyName]: change.value }); + const command = await createManifestPropertyChange(modifiedControl, flexSettings, { + [change.propertyName]: change.value + }); if (command) { await rta.getCommandStack().pushAndExecute(command); } else { diff --git a/packages/preview-middleware-client/src/cpe/changes/service.ts b/packages/preview-middleware-client/src/cpe/changes/service.ts index 22255ee3ead..191441854cd 100644 --- a/packages/preview-middleware-client/src/cpe/changes/service.ts +++ b/packages/preview-middleware-client/src/cpe/changes/service.ts @@ -112,7 +112,7 @@ export class ChangeService extends EventTarget { } const error = getError(exception); - // eslint-disable-next-line @typescript-eslint/no-unsafe-call + const modifiedMessage = modifyRTAErrorMessage(error.toString(), id, name); const errorMessage = modifiedMessage || `RTA Exception applying expression "${action.payload.value}"`; @@ -515,7 +515,7 @@ export class ChangeService extends EventTarget { continue; } return result; - } catch (error) { + } catch { continue; } } @@ -545,7 +545,7 @@ export class ChangeService extends EventTarget { private getCommandSelectorId(command: FlexCommand): string | undefined { return this.retryOperations([ () => command.getSelector().id, - // eslint-disable-next-line @typescript-eslint/no-unsafe-return + () => command.getElement().getProperty('persistencyKey'), () => command.getElement().getId(), () => command.getParent()?.getElement().getId() @@ -568,6 +568,10 @@ export class ChangeService extends EventTarget { this.updateStack(); } + /** + * + * @param handler + */ public onStackChange(handler: (event: CustomEvent) => void | Promise): void { this.addEventListener(STACK_CHANGE_EVENT, handler as EventListener); } diff --git a/packages/preview-middleware-client/src/cpe/changes/validator.ts b/packages/preview-middleware-client/src/cpe/changes/validator.ts index 137e8b55e35..0b840cba3d4 100644 --- a/packages/preview-middleware-client/src/cpe/changes/validator.ts +++ b/packages/preview-middleware-client/src/cpe/changes/validator.ts @@ -1,5 +1,5 @@ -import ResourceBundle from 'sap/base/i18n/ResourceBundle'; -import ResourceModel from 'sap/ui/model/resource/ResourceModel'; +import type ResourceBundle from 'sap/base/i18n/ResourceBundle'; +import type ResourceModel from 'sap/ui/model/resource/ResourceModel'; import type UI5Element from 'sap/ui/core/Element'; import { getTextBundle } from '../../i18n'; @@ -21,8 +21,8 @@ export async function validateBindingModel(modifiedControl: UI5Element, value: s if (bindingParts.length === 2) { const bindingModel = bindingParts[0]; const resourceKey = bindingParts[1].trim(); - const resourceModel = (modifiedControl.getModel(bindingModel) as ResourceModel); - if(!resourceModel) { + const resourceModel = modifiedControl.getModel(bindingModel) as ResourceModel; + if (!resourceModel) { throw new SyntaxError(textBundle.getText('INVALID_BINDING_MODEL')); } const resourceBundle = resourceModel.getResourceBundle() as ResourceBundle; diff --git a/packages/preview-middleware-client/src/cpe/communication-service.ts b/packages/preview-middleware-client/src/cpe/communication-service.ts index 1ab05b56616..bd392b02938 100644 --- a/packages/preview-middleware-client/src/cpe/communication-service.ts +++ b/packages/preview-middleware-client/src/cpe/communication-service.ts @@ -1,11 +1,15 @@ import Log from 'sap/base/Log'; -import { ExternalAction, startPostMessageCommunication } from '@sap-ux-private/control-property-editor-common'; +import type { ExternalAction } from '@sap-ux-private/control-property-editor-common'; +import { startPostMessageCommunication } from '@sap-ux-private/control-property-editor-common'; import { getError } from '../utils/error'; -import { ActionHandler } from './types'; +import type { ActionHandler } from './types'; +/** + * + */ export class CommunicationService { /** * Sends an action to the CPE. diff --git a/packages/preview-middleware-client/src/cpe/connector-service.ts b/packages/preview-middleware-client/src/cpe/connector-service.ts index e3d7c6d8808..afcbff94e6d 100644 --- a/packages/preview-middleware-client/src/cpe/connector-service.ts +++ b/packages/preview-middleware-client/src/cpe/connector-service.ts @@ -1,5 +1,6 @@ -import { ExternalAction, reloadApplication, storageFileChanged } from '@sap-ux-private/control-property-editor-common'; -import { ActionSenderFunction, SubscribeFunction } from './types'; +import type { ExternalAction } from '@sap-ux-private/control-property-editor-common'; +import { reloadApplication, storageFileChanged } from '@sap-ux-private/control-property-editor-common'; +import type { ActionSenderFunction, SubscribeFunction } from './types'; import { getUi5Version, isLowerThanMinimalUi5Version } from '../utils/version'; import { AdditionalChangeInfo } from '../utils/additional-change-info'; /** diff --git a/packages/preview-middleware-client/src/cpe/control-data.ts b/packages/preview-middleware-client/src/cpe/control-data.ts index dd42aad8c1d..713d1e0b848 100644 --- a/packages/preview-middleware-client/src/cpe/control-data.ts +++ b/packages/preview-middleware-client/src/cpe/control-data.ts @@ -14,12 +14,13 @@ import { import Utils from 'sap/ui/fl/Utils'; import type ManagedObject from 'sap/ui/base/ManagedObject'; import type ElementOverlay from 'sap/ui/dt/ElementOverlay'; -import { getManifestProperties, MergedSetting, type ManagedObjectMetadataProperties } from './utils'; -import { UI5ControlProperty } from './types'; +import type { MergedSetting, ManagedObjectMetadataProperties } from './utils'; +import { getManifestProperties } from './utils'; +import type { UI5ControlProperty } from './types'; import DataType from 'sap/ui/base/DataType'; import { getV4PageType } from '../utils/fe-v4'; -import { ChangeService } from './changes'; -import { TemplateType } from 'sap/ui/dt/DesignTimeMetadata'; +import type { ChangeService } from './changes'; +import type { TemplateType } from 'sap/ui/dt/DesignTimeMetadata'; type AnalyzedType = Pick; @@ -110,7 +111,7 @@ function analyzePropertyType(property: ManagedObjectMetadataProperties): Analyze // enum values are created differently and use DataType as prototype, which only has stubs for instance functions -> getName returns undefined // array and base types also return undefined, but we have already handled those above // https://github.com/SAP/openui5/blob/203ce22763a76e28b7a422f6c635a42480f733f1/src/sap.ui.core/src/sap/ui/base/DataType.js#L430 - // eslint-disable-next-line @typescript-eslint/no-unsafe-call + const name = (Object.getPrototypeOf(propertyDataType) as DataType).getName(); if (!name) { analyzedType.primitiveType = 'enum'; @@ -128,6 +129,10 @@ function analyzePropertyType(property: ManagedObjectMetadataProperties): Analyze return analyzedType; } +/** + * + * @param property + */ function analyzeManifestProperty(property: MergedSetting): AnalyzedType | undefined { const analyzedType: AnalyzedType = { primitiveType: 'any', diff --git a/packages/preview-middleware-client/src/cpe/feature-service.ts b/packages/preview-middleware-client/src/cpe/feature-service.ts index 8bf875a1a66..f553aee67cf 100644 --- a/packages/preview-middleware-client/src/cpe/feature-service.ts +++ b/packages/preview-middleware-client/src/cpe/feature-service.ts @@ -1,3 +1,6 @@ +/** + * + */ export class FeatureService { private static features: Record = {}; diff --git a/packages/preview-middleware-client/src/cpe/init.ts b/packages/preview-middleware-client/src/cpe/init.ts index f7d9c26d275..b25e6d3d206 100644 --- a/packages/preview-middleware-client/src/cpe/init.ts +++ b/packages/preview-middleware-client/src/cpe/init.ts @@ -21,6 +21,11 @@ import { SelectionService } from './selection'; import type { ActionHandler, Service } from './types'; import { getIcons } from './ui5-utils'; +/** + * + * @param rta + * @param registries + */ export default function init( rta: RuntimeAuthoring, registries: QuickActionDefinitionRegistry[] = [] @@ -70,7 +75,7 @@ export default function init( .then(() => { CommunicationService.sendAction(appLoaded()); }) - // eslint-disable-next-line @typescript-eslint/unbound-method + .catch(Log.error); const icons = getIcons(); CommunicationService.sendAction(iconsLoaded(icons)); diff --git a/packages/preview-middleware-client/src/cpe/logger.ts b/packages/preview-middleware-client/src/cpe/logger.ts index 61f158a24d4..6281ea8d532 100644 --- a/packages/preview-middleware-client/src/cpe/logger.ts +++ b/packages/preview-middleware-client/src/cpe/logger.ts @@ -1,7 +1,10 @@ import Log from 'sap/base/Log'; -import { Logger } from '@sap-ux-private/control-property-editor-common'; - +import type { Logger } from '@sap-ux-private/control-property-editor-common'; +/** + * + * @param message + */ function getString(message: string | object): string { if (typeof message === 'object') { return JSON.stringify(message).toString(); @@ -23,4 +26,3 @@ export const logger: Logger = { Log.error(getString(message)); } }; - diff --git a/packages/preview-middleware-client/src/cpe/outline/editable.ts b/packages/preview-middleware-client/src/cpe/outline/editable.ts index 6e9f8fe3252..7a3e472a605 100644 --- a/packages/preview-middleware-client/src/cpe/outline/editable.ts +++ b/packages/preview-middleware-client/src/cpe/outline/editable.ts @@ -3,7 +3,7 @@ import { getRuntimeControl } from '../utils'; import OverlayUtil from 'sap/ui/dt/OverlayUtil'; import OverlayRegistry from 'sap/ui/dt/OverlayRegistry'; import { getComponent } from '../../utils/core'; -import { ChangeService } from '../changes'; +import type { ChangeService } from '../changes'; export const isEditable = (changeService: ChangeService, id = ''): boolean => { let editable = false; diff --git a/packages/preview-middleware-client/src/cpe/outline/nodes.ts b/packages/preview-middleware-client/src/cpe/outline/nodes.ts index a32d87ba70b..20fc809b9ec 100644 --- a/packages/preview-middleware-client/src/cpe/outline/nodes.ts +++ b/packages/preview-middleware-client/src/cpe/outline/nodes.ts @@ -10,7 +10,7 @@ import type { ControlTreeIndex } from '../types'; import { getOverlay } from '../utils'; import { isEditable } from './editable'; -import { ChangeService } from '../changes'; +import type { ChangeService } from '../changes'; import { getConfigMapControlIdMap, getPageName } from '../../utils/fe-v4'; interface AdditionalData { @@ -31,7 +31,7 @@ function getAdditionalData(id: string): AdditionalData { } const metadata = control.getMetadata(); - let details: AdditionalData = {}; + const details: AdditionalData = {}; const technicalName = metadata.getElementName(); if (technicalName) { @@ -56,7 +56,7 @@ function getAdditionalData(id: string): AdditionalData { */ function getChildren(current: OutlineViewNode): OutlineViewNode[] { return (current.elements ?? []).flatMap((element: OutlineViewNode) => - element.type === 'aggregation' ? element.elements ?? [] : [] + element.type === 'aggregation' ? (element.elements ?? []) : [] ); } @@ -96,6 +96,11 @@ function indexNode(controlIndex: ControlTreeIndex, node: OutlineNode): void { } } +/** + * + * @param node + * @param propertyIdMap + */ function addToPropertyIdMap(node: OutlineNode, propertyIdMap: Map): void { const control = getControlById(node.controlId); if (control) { @@ -173,7 +178,7 @@ export async function transformNodes( if (isAdp && isExtPoint) { const { defaultContent = [], createdControls = [] } = current.extensionPointInfo; - let children: OutlineNode[] = []; + const children: OutlineNode[] = []; // We can combine both because there can only be either defaultContent or createdControls for one extension point node. [...defaultContent, ...createdControls].forEach((id: string) => { addChildToExtensionPoint(id, children, changeService); diff --git a/packages/preview-middleware-client/src/cpe/outline/service.ts b/packages/preview-middleware-client/src/cpe/outline/service.ts index 514e2f1c6dd..2dfd30181bb 100644 --- a/packages/preview-middleware-client/src/cpe/outline/service.ts +++ b/packages/preview-middleware-client/src/cpe/outline/service.ts @@ -60,6 +60,10 @@ export class OutlineService extends EventTarget { outline.attachEvent('update', syncOutline); } + /** + * + * @param handler + */ public onOutlineChange(handler: (event: CustomEvent) => void | Promise): void { this.addEventListener(OUTLINE_CHANGE_EVENT, handler as EventListener); } diff --git a/packages/preview-middleware-client/src/cpe/quick-actions/quick-action-definition.ts b/packages/preview-middleware-client/src/cpe/quick-actions/quick-action-definition.ts index c60a40788f6..05cb7492e04 100644 --- a/packages/preview-middleware-client/src/cpe/quick-actions/quick-action-definition.ts +++ b/packages/preview-middleware-client/src/cpe/quick-actions/quick-action-definition.ts @@ -13,7 +13,7 @@ import type { import type { TextBundle } from '../../i18n'; import type { ControlTreeIndex } from '../types'; -import { ChangeService } from '../changes'; +import type { ChangeService } from '../changes'; export interface QuickActionActivationContext { controlIndex: ControlTreeIndex; diff --git a/packages/preview-middleware-client/src/cpe/quick-actions/quick-action-service.ts b/packages/preview-middleware-client/src/cpe/quick-actions/quick-action-service.ts index 2132366e26a..36a93a8f323 100644 --- a/packages/preview-middleware-client/src/cpe/quick-actions/quick-action-service.ts +++ b/packages/preview-middleware-client/src/cpe/quick-actions/quick-action-service.ts @@ -1,27 +1,34 @@ -import RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; -import { ActionService } from 'sap/ui/rta/service/Action'; +import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; +import type { ActionService } from 'sap/ui/rta/service/Action'; import Log from 'sap/base/Log'; +import type { + ExternalAction, + QuickActionExecutionPayload, + QuickActionGroup +} from '@sap-ux-private/control-property-editor-common'; import { executeQuickAction, - ExternalAction, quickActionListChanged, SIMPLE_QUICK_ACTION_KIND, NESTED_QUICK_ACTION_KIND, - QuickActionExecutionPayload, - QuickActionGroup, updateQuickAction, externalFileChange, reportTelemetry } from '@sap-ux-private/control-property-editor-common'; -import { ActionSenderFunction, ControlTreeIndex, Service, SubscribeFunction } from '../types'; - -import { QuickActionActivationContext, QuickActionContext, QuickActionDefinition } from './quick-action-definition'; -import { QuickActionDefinitionRegistry } from './registry'; -import { OutlineService } from '../outline/service'; -import { getTextBundle, TextBundle } from '../../i18n'; -import { ChangeService } from '../changes'; +import type { ActionSenderFunction, ControlTreeIndex, Service, SubscribeFunction } from '../types'; + +import type { + QuickActionActivationContext, + QuickActionContext, + QuickActionDefinition +} from './quick-action-definition'; +import type { QuickActionDefinitionRegistry } from './registry'; +import type { OutlineService } from '../outline/service'; +import type { TextBundle } from '../../i18n'; +import { getTextBundle } from '../../i18n'; +import type { ChangeService } from '../changes'; import { DialogFactory } from '../../adp/dialog-factory'; import { getApplicationType } from '../../utils/application'; import { getUi5Version } from '../../utils/version'; @@ -43,6 +50,7 @@ export class QuickActionService implements Service { * @param rta - RTA object. * @param outlineService - Outline service instance. * @param registries - Quick action registries. + * @param changeService */ constructor( private readonly rta: RuntimeAuthoring, @@ -143,6 +151,11 @@ export class QuickActionService implements Service { this.sendAction(quickActionListChanged(groups)); } + /** + * + * @param group + * @param instance + */ private async addAction(group: QuickActionGroup, instance: QuickActionDefinition): Promise { if (instance.isApplicable) { await instance.runEnablementValidators(); diff --git a/packages/preview-middleware-client/src/cpe/quick-actions/registry.ts b/packages/preview-middleware-client/src/cpe/quick-actions/registry.ts index 4044aff221c..26a8d9676a6 100644 --- a/packages/preview-middleware-client/src/cpe/quick-actions/registry.ts +++ b/packages/preview-middleware-client/src/cpe/quick-actions/registry.ts @@ -1,12 +1,12 @@ import NavContainer from 'sap/m/NavContainer'; import FlexibleColumnLayout from 'sap/f/FlexibleColumnLayout'; import { LayoutType } from 'sap/f/library'; -import Control from 'sap/ui/core/Control'; -import XMLView from 'sap/ui/core/mvc/XMLView'; +import type Control from 'sap/ui/core/Control'; +import type XMLView from 'sap/ui/core/mvc/XMLView'; import Log from 'sap/base/Log'; import ComponentContainer from 'sap/ui/core/ComponentContainer'; -import { QuickActionActivationContext, QuickActionDefinitionGroup } from './quick-action-definition'; +import type { QuickActionActivationContext, QuickActionDefinitionGroup } from './quick-action-definition'; import type { ControlTreeIndex } from '../types'; import { getControlById } from '../../utils/core'; @@ -126,10 +126,15 @@ export abstract class QuickActionDefinitionRegistry { /** * Finds the visible Flexible Column Layout pages. + * * @param control - Flexible Column Layout control. * @returns A list of visible pages. */ + /** + * + * @param control + */ private getVisibleFlexibleColumnLayoutPages(control: FlexibleColumnLayout): (Control | undefined)[] { const layout = control.getLayout(); switch (layout) { diff --git a/packages/preview-middleware-client/src/cpe/quick-actions/utils.ts b/packages/preview-middleware-client/src/cpe/quick-actions/utils.ts index 8576d0ad055..90c409d526c 100644 --- a/packages/preview-middleware-client/src/cpe/quick-actions/utils.ts +++ b/packages/preview-middleware-client/src/cpe/quick-actions/utils.ts @@ -1,12 +1,12 @@ -import UI5Element from 'sap/ui/core/Element'; -import Control from 'sap/ui/core/Control'; -import ManagedObject from 'sap/ui/base/ManagedObject'; -import { FEAppPage } from 'sap/ui/rta/RuntimeAuthoring'; +import type UI5Element from 'sap/ui/core/Element'; +import type Control from 'sap/ui/core/Control'; +import type ManagedObject from 'sap/ui/base/ManagedObject'; +import type { FEAppPage } from 'sap/ui/rta/RuntimeAuthoring'; import { getControlById, isA } from '../../utils/core'; import type { ControlTreeIndex } from '../types'; -import Component from 'sap/ui/core/Component'; +import type Component from 'sap/ui/core/Component'; export interface FEAppPageInfo { page: FEAppPage; @@ -18,7 +18,7 @@ export interface FEAppPagesMap { /** * Checks if control is visible in the page. - * + * * @param page - Page control. * @param controlId - UI5 control id. * @returns True if control is visible in the page. @@ -28,10 +28,9 @@ export function pageHasControlId(page: Control, controlId: string): boolean { return !!controlDomElement && !!page?.getDomRef()?.contains(controlDomElement); } - /** * Checks if control is a child element of the rootControl. - * + * * @param control - UI5 Control to be tested. * @param rootControl - UI5 root control. * @returns True if control is the child of the specified rootControl. @@ -57,7 +56,7 @@ function isDescendantOfPage(control: ManagedObject | null | undefined, rootContr /** * Find all controls in page that match the provided types. - * + * * @param controlIndex - Control tree index. * @param activePage - Active page control. * @param controlTypes - Relevant control types. @@ -91,6 +90,11 @@ export function getRelevantControlFromActivePage( control: ManagedObject | null | undefined, type: string @@ -111,4 +115,4 @@ export function getParentContainer( } } return undefined; -} \ No newline at end of file +} diff --git a/packages/preview-middleware-client/src/cpe/rta-service.ts b/packages/preview-middleware-client/src/cpe/rta-service.ts index 26d4d4760f7..e7d21a4511e 100644 --- a/packages/preview-middleware-client/src/cpe/rta-service.ts +++ b/packages/preview-middleware-client/src/cpe/rta-service.ts @@ -1,3 +1,4 @@ +import type { ExternalAction } from '@sap-ux-private/control-property-editor-common'; import { setAppMode, setUndoRedoEnablement, @@ -5,12 +6,11 @@ import { undo, redo, save, - ExternalAction, reloadApplication, applicationModeChanged } from '@sap-ux-private/control-property-editor-common'; -import { ActionSenderFunction, SubscribeFunction } from './types'; -import RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; +import type { ActionSenderFunction, SubscribeFunction } from './types'; +import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; /** * A Class of RtaService @@ -19,6 +19,7 @@ export class RtaService { /** * * @param options ui5 adaptation options. + * @param rta */ constructor(private readonly rta: RuntimeAuthoring) {} @@ -64,6 +65,9 @@ export class RtaService { }); } + /** + * + */ private save(): Promise { if (this.rta.save) { // v1.107.x and above @@ -75,6 +79,11 @@ export class RtaService { } } +/** + * + * @param sendAction + * @param rta + */ export function modeAndStackChangeHandler(sendAction: (action: ExternalAction) => void, rta: RuntimeAuthoring) { return () => { const canUndo = rta.canUndo(); diff --git a/packages/preview-middleware-client/src/cpe/selection.ts b/packages/preview-middleware-client/src/cpe/selection.ts index bcce712857d..f95fd8cb076 100644 --- a/packages/preview-middleware-client/src/cpe/selection.ts +++ b/packages/preview-middleware-client/src/cpe/selection.ts @@ -1,8 +1,7 @@ -import type { Control, ExternalAction } from '@sap-ux-private/control-property-editor-common'; +import type { Control, ExternalAction, Properties } from '@sap-ux-private/control-property-editor-common'; import { changeProperty, controlSelected, - Properties, propertyChanged, PropertyType, reportTelemetry, @@ -67,6 +66,11 @@ function getPropertyDocument( } as PropertiesInfo); } +/** + * + * @param control + * @param controlData + */ async function addDocumentationForProperties(control: ManagedObject, controlData: Control): Promise { try { const controlMetadata = control.getMetadata(); @@ -99,8 +103,12 @@ export class SelectionService implements Service { * * @param rta - rta object. * @param ui5 - facade for ui5 framework methods + * @param changeService */ - constructor(private readonly rta: RuntimeAuthoring, private readonly changeService: ChangeService) {} + constructor( + private readonly rta: RuntimeAuthoring, + private readonly changeService: ChangeService + ) {} /** * Initialize selection service. @@ -160,6 +168,12 @@ export class SelectionService implements Service { }); } + /** + * + * @param control + * @param sendAction + * @param overlay + */ private async buildProperties( control: ManagedObject, sendAction: ActionSenderFunction, diff --git a/packages/preview-middleware-client/src/cpe/types.ts b/packages/preview-middleware-client/src/cpe/types.ts index b1d14af990a..a19708bf279 100644 --- a/packages/preview-middleware-client/src/cpe/types.ts +++ b/packages/preview-middleware-client/src/cpe/types.ts @@ -10,7 +10,7 @@ export type PropertyValue = boolean | object | number | string; export interface UI5ControlProperty { defaultValue: unknown; - enumValues: Record | undefined; + enumValues: Record | undefined; isArray: boolean; isDeprecated: boolean; isEnabled: boolean; @@ -39,9 +39,12 @@ export type UnSubscribeFunction = (handler: ActionHandler) => void; export type IsReuseComponentApi = (controlId: string) => boolean; export interface Service { + /** + * + */ init(sendAction: ActionSenderFunction, subscribe: SubscribeFunction): void | Promise; } export interface ControlTreeIndex { - [controlType: string]: OutlineNode[] -} \ No newline at end of file + [controlType: string]: OutlineNode[]; +} diff --git a/packages/preview-middleware-client/src/cpe/utils.ts b/packages/preview-middleware-client/src/cpe/utils.ts index b5a06b86391..4f1a4cf5792 100644 --- a/packages/preview-middleware-client/src/cpe/utils.ts +++ b/packages/preview-middleware-client/src/cpe/utils.ts @@ -102,6 +102,12 @@ export function getRootControlFromComponentContainer(container?: ComponentContai return undefined; } +/** + * + * @param control + * @param changeService + * @param controlOverlay + */ export function getManifestProperties( control: ManagedObject, changeService: ChangeService, diff --git a/packages/preview-middleware-client/src/flp/WorkspaceConnector.ts b/packages/preview-middleware-client/src/flp/WorkspaceConnector.ts index 8513bc198af..0e7a9a52026 100644 --- a/packages/preview-middleware-client/src/flp/WorkspaceConnector.ts +++ b/packages/preview-middleware-client/src/flp/WorkspaceConnector.ts @@ -1,7 +1,8 @@ import merge from 'sap/base/util/merge'; import ObjectStorageConnector from 'sap/ui/fl/write/api/connectors/ObjectStorageConnector'; import Layer from 'sap/ui/fl/Layer'; -import { CHANGES_API_PATH, FlexChange, getFlexSettings } from './common'; +import type { FlexChange } from './common'; +import { CHANGES_API_PATH, getFlexSettings } from './common'; import { getUi5Version, isLowerThanMinimalUi5Version } from '../utils/version'; import { getAdditionalChangeInfo } from '../utils/additional-change-info'; @@ -44,7 +45,7 @@ const connector = merge({}, ObjectStorageConnector, { if (typeof this.fileChangeRequestNotifier === 'function') { try { this.fileChangeRequestNotifier(key, 'delete'); - } catch (e) { + } catch { // exceptions in the listener call are ignored } } diff --git a/packages/preview-middleware-client/src/flp/common.ts b/packages/preview-middleware-client/src/flp/common.ts index c8125051526..4e5fb7727b5 100644 --- a/packages/preview-middleware-client/src/flp/common.ts +++ b/packages/preview-middleware-client/src/flp/common.ts @@ -1,4 +1,4 @@ -import { FlexSettings } from 'sap/ui/rta/RuntimeAuthoring'; +import type { FlexSettings } from 'sap/ui/rta/RuntimeAuthoring'; export interface FlexChange { [key: string]: string | object | undefined; diff --git a/packages/preview-middleware-client/src/flp/enableFakeConnector.ts b/packages/preview-middleware-client/src/flp/enableFakeConnector.ts index b07ec71c201..c08df9cad09 100644 --- a/packages/preview-middleware-client/src/flp/enableFakeConnector.ts +++ b/packages/preview-middleware-client/src/flp/enableFakeConnector.ts @@ -2,7 +2,8 @@ import LrepConnector from 'sap/ui/fl/LrepConnector'; import FakeLrepConnector from 'sap/ui/fl/FakeLrepConnector'; import { getAdditionalChangeInfo } from '../utils/additional-change-info'; -import { CHANGES_API_PATH, FlexChange, getFlexSettings } from './common'; +import type { FlexChange } from './common'; +import { CHANGES_API_PATH, getFlexSettings } from './common'; interface FetchedChanges { [key: string]: FlexChange; @@ -69,6 +70,7 @@ export async function create(changes: FlexChange | FlexChange[]): Promise * Loads changes from a given path and processes them using an LrepConnector instance. * The changes are then formatted and returned in a specified structure. * + * @param {...any} args * @returns {Promise} A promise that resolves to an object of type LoadChangesResult. */ export async function loadChanges(...args: []): Promise { diff --git a/packages/preview-middleware-client/src/flp/homepage/Component.ts b/packages/preview-middleware-client/src/flp/homepage/Component.ts index 2f85e83dead..12313ec9786 100644 --- a/packages/preview-middleware-client/src/flp/homepage/Component.ts +++ b/packages/preview-middleware-client/src/flp/homepage/Component.ts @@ -7,4 +7,4 @@ export default class Component extends BaseComponent { public static readonly metadata = { manifest: 'json' }; -} \ No newline at end of file +} diff --git a/packages/preview-middleware-client/src/flp/init.ts b/packages/preview-middleware-client/src/flp/init.ts index a554da9547f..b6ec21366a1 100644 --- a/packages/preview-middleware-client/src/flp/init.ts +++ b/packages/preview-middleware-client/src/flp/init.ts @@ -5,7 +5,7 @@ import { MessageBarType, SCENARIO, type Scenario } from '@sap-ux-private/control import type { FlexSettings, RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; import IconPool from 'sap/ui/core/IconPool'; import ResourceBundle from 'sap/base/i18n/ResourceBundle'; -import AppState from 'sap/ushell/services/AppState'; +import type AppState from 'sap/ushell/services/AppState'; import { getManifestAppdescr } from '../adp/api-handler'; import { getError } from '../utils/error'; import initCdm from './initCdm'; @@ -324,7 +324,7 @@ export async function init({ const view = event.getParameter('componentInstance'); const pluginScript = flexSettings.pluginScript ?? ''; - let libs: string[] = []; + const libs: string[] = []; if (isLowerThanMinimalUi5Version(ui5VersionInfo, { major: 1, minor: 72 })) { libs.push('open/ux/preview/client/flp/initRta'); @@ -345,7 +345,7 @@ export async function init({ sap.ui.require( libs, - // eslint-disable-next-line no-shadow + async function (startAdaptation: StartAdaptation | InitRtaScript, pluginScript: RTAPlugin) { try { await startAdaptation(options, pluginScript); diff --git a/packages/preview-middleware-client/src/flp/initCdm.ts b/packages/preview-middleware-client/src/flp/initCdm.ts index 9855eb5906c..1594073302d 100644 --- a/packages/preview-middleware-client/src/flp/initCdm.ts +++ b/packages/preview-middleware-client/src/flp/initCdm.ts @@ -1,4 +1,4 @@ -import { Window } from 'types/global'; +import type { Window } from 'types/global'; /** * Initializes the CDM (Common Data Model) configuration for the SAP Fiori Launchpad. @@ -42,11 +42,7 @@ export default function initCdm(): void { config: { userProfile: { metadata: { - editablePropterties: [ - 'accessibility', - 'contentDensity', - 'theme' - ] + editablePropterties: ['accessibility', 'contentDensity', 'theme'] }, defaults: { email: 'john.doe@sap.com', diff --git a/packages/preview-middleware-client/src/flp/initRta.ts b/packages/preview-middleware-client/src/flp/initRta.ts index e9435399d05..2fee0275f09 100644 --- a/packages/preview-middleware-client/src/flp/initRta.ts +++ b/packages/preview-middleware-client/src/flp/initRta.ts @@ -1,4 +1,4 @@ -import Button from 'sap/m/Button'; +import type Button from 'sap/m/Button'; import merge from 'sap/base/util/merge'; @@ -10,7 +10,7 @@ import Utils from 'sap/ui/fl/Utils'; import FeaturesAPI from 'sap/ui/fl/write/api/FeaturesAPI'; import type { RTAPlugin } from 'sap/ui/rta/api/startAdaptation'; -import RuntimeAuthoring, { Manifest, type RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import RuntimeAuthoring, { type Manifest, type RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; const defaultOptions = { flexSettings: { diff --git a/packages/preview-middleware-client/src/i18n.ts b/packages/preview-middleware-client/src/i18n.ts index a1ba34f9909..3cf6b2bd59b 100644 --- a/packages/preview-middleware-client/src/i18n.ts +++ b/packages/preview-middleware-client/src/i18n.ts @@ -4,6 +4,10 @@ import ResourceModel from 'sap/ui/model/resource/ResourceModel'; const BUNDLE_CACHE: Record = {}; const MODEL_CACHE: Record = {}; +/** + * + * @param key + */ export async function getResourceBundle(key: string): Promise { const cachedBundle = BUNDLE_CACHE[key]; @@ -22,6 +26,10 @@ export async function getResourceBundle(key: string): Promise { return bundle; } +/** + * + * @param key + */ export async function getResourceModel(key = 'open.ux.preview.client'): Promise { const cachedModel = MODEL_CACHE[key]; @@ -35,14 +43,30 @@ export async function getResourceModel(key = 'open.ux.preview.client'): Promise< return model; } +/** + * + */ export class TextBundle { + /** + * + * @param bundle + */ constructor(private bundle: ResourceBundle) {} + /** + * + * @param key + * @param args + */ getText(key: string, args?: string[]): string { return this.bundle.getText(key, args) ?? key; } } +/** + * + * @param key + */ export async function getTextBundle(key = 'open.ux.preview.client'): Promise { const bundle = await getResourceBundle(key); return new TextBundle(bundle); diff --git a/packages/preview-middleware-client/src/utils/fe-v2.ts b/packages/preview-middleware-client/src/utils/fe-v2.ts index 9451e952a72..2126751da75 100644 --- a/packages/preview-middleware-client/src/utils/fe-v2.ts +++ b/packages/preview-middleware-client/src/utils/fe-v2.ts @@ -22,9 +22,7 @@ export function getV2ApplicationPages(manifest: Manifest): { id: string; entityS if (rootEntry) { const result: { id: string; entitySet: string | undefined }[] = []; - const collectPageData = < - T extends Record | Array - >( + const collectPageData = | Array>( pagesDefinitions: T | undefined, idPrefix: string ) => { diff --git a/packages/preview-middleware-client/src/utils/fe-v4.ts b/packages/preview-middleware-client/src/utils/fe-v4.ts index 77ddf83de84..31c8586da78 100644 --- a/packages/preview-middleware-client/src/utils/fe-v4.ts +++ b/packages/preview-middleware-client/src/utils/fe-v4.ts @@ -1,15 +1,15 @@ -import ManagedObject from 'sap/ui/base/ManagedObject'; -import TemplateComponent from 'sap/fe/core/TemplateComponent'; +import type ManagedObject from 'sap/ui/base/ManagedObject'; +import type TemplateComponent from 'sap/fe/core/TemplateComponent'; import Component from 'sap/ui/core/Component'; -import AppComponent from 'sap/fe/core/AppComponent'; -import XMLView from 'sap/ui/core/mvc/XMLView'; +import type AppComponent from 'sap/fe/core/AppComponent'; +import type XMLView from 'sap/ui/core/mvc/XMLView'; import type { FlexSettings, Manifest } from 'sap/ui/rta/RuntimeAuthoring'; import { isA } from './core'; import CommandFactory from 'sap/ui/rta/command/CommandFactory'; import { getOverlay } from '../cpe/utils'; -import UI5Element from 'sap/ui/core/Element'; -import FlexCommand from 'sap/ui/rta/command/FlexCommand'; +import type UI5Element from 'sap/ui/core/Element'; +import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; /** * Gets app component of a v4 project. @@ -73,6 +73,11 @@ export function getPageName(control: ManagedObject): string | undefined { return view.getId().split('::').pop(); } +/** + * + * @param page + * @param propertyPathSegments + */ export function getConfigMapControlIdMap(page: string | undefined, propertyPathSegments: string[]): string { if (page && !propertyPathSegments.length) { return page; @@ -86,11 +91,11 @@ export function getConfigMapControlIdMap(page: string | undefined, propertyPathS /** * Get the modified value for a control. + * * @param modifiedControl - The modified control. * @param flexSettings - Flex Settings of the control. * @param propertyChanges - The change object * @param propertyPathExtraSegments - optional path segments which are added to the default modified control manifest path - * * @returns A Promise resolving to an array of FlexCommand objects. */ export async function createManifestPropertyChange( diff --git a/packages/preview-middleware-client/src/utils/version.ts b/packages/preview-middleware-client/src/utils/version.ts index 2ede9b24a0d..3a31c09cb0d 100644 --- a/packages/preview-middleware-client/src/utils/version.ts +++ b/packages/preview-middleware-client/src/utils/version.ts @@ -30,6 +30,7 @@ export const minVersionInfo = { /** * Check if the given version info is valid. + * * @param versionInfo to check * @throws Error if the version info is invalid */ @@ -86,7 +87,6 @@ export async function getUi5Version(library: string = 'sap.ui.core'): Promise(v: T | T[]) => { type StateType = ValueState | keyof typeof ValueState; const mockFormInput = ( isInput: boolean, - values: String | String[] = '', + values: string | string[] = '', states?: StateType | StateType[], stateTexts?: string | string[] ) => ({ @@ -141,7 +142,7 @@ describe('AddSubpage controller', () => { ]; } }) - } as unknown as JSONModel); + }) as unknown as JSONModel; addSubpage.model = getTestModel(); const dialogMock = { @@ -243,7 +244,7 @@ describe('AddSubpage controller', () => { ({ setProperty: jest.fn(), getProperty: jest.fn() - } as unknown as JSONModel); + }) as unknown as JSONModel; let addSubpage: AddSubpage; let beginBtnSetEnabledMock: jest.Mock; diff --git a/packages/preview-middleware-client/test/unit/adp/controllers/AddTableColumnFragments.controller.test.ts b/packages/preview-middleware-client/test/unit/adp/controllers/AddTableColumnFragments.controller.test.ts index 7faae53a965..93176d93117 100644 --- a/packages/preview-middleware-client/test/unit/adp/controllers/AddTableColumnFragments.controller.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/controllers/AddTableColumnFragments.controller.test.ts @@ -1,8 +1,8 @@ import type Dialog from 'sap/m/Dialog'; -import Event from 'sap/ui/base/Event'; +import type Event from 'sap/ui/base/Event'; import type UI5Element from 'sap/ui/core/Element'; -import JSONModel from 'sap/ui/model/json/JSONModel'; -import { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type JSONModel from 'sap/ui/model/json/JSONModel'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import CommandFactory from 'mock/sap/ui/rta/command/CommandFactory'; @@ -29,6 +29,7 @@ const mocks = { /** * Simulates various values returns in sequential calls * the last value stays persistent and is returned in further calls + * * @param v - value or array of values * @returns jest mock function returning provided values, the last value stays persistent and is returned in further calls */ @@ -47,7 +48,7 @@ const nCallsMock = (v: T | T[]) => { type StateType = ValueState | keyof typeof ValueState; const mockFormInput = ( isInput: boolean, - values: String | String[] = '', + values: string | string[] = '', states?: StateType | StateType[], stateTexts?: string | string[] ) => ({ @@ -58,13 +59,13 @@ const mockFormInput = ( setValueState: mocks.setValueStateMock }); -const mockInputEvent = (value: String | Object): Event => +const mockInputEvent = (value: string | object): Event => ({ getSource: jest.fn().mockReturnValue({ getValue: jest.fn().mockReturnValue(value), setValueState: mocks.setValueStateMock }) - } as unknown as Event); + }) as unknown as Event; describe('AddTableColumnsFragments controller', () => { beforeAll(() => { @@ -174,7 +175,7 @@ describe('AddTableColumnsFragments controller', () => { ({ setProperty: jest.fn(), getProperty: jest.fn().mockReturnValue([{ fragmentName: 'Delete.fragment.xml' }]) - } as unknown as JSONModel); + }) as unknown as JSONModel; let addFragment: AddTableColumnFragments; let beginBtnSetEnabledMock: jest.Mock; @@ -544,7 +545,7 @@ describe('AddTableColumnsFragments controller', () => { ({ setProperty: jest.fn(), getProperty: jest.fn().mockReturnValue([{ fragmentName: 'Delete.fragment.xml' }]) - } as unknown as JSONModel); + }) as unknown as JSONModel; let addFragment: AddTableColumnFragments; let beginBtnSetEnabledMock: jest.Mock; diff --git a/packages/preview-middleware-client/test/unit/adp/controllers/ControllerExtension.controller.test.ts b/packages/preview-middleware-client/test/unit/adp/controllers/ControllerExtension.controller.test.ts index bd0ed68a79e..6de3c9c2615 100644 --- a/packages/preview-middleware-client/test/unit/adp/controllers/ControllerExtension.controller.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/controllers/ControllerExtension.controller.test.ts @@ -508,7 +508,7 @@ describe('ControllerExtension', () => { () => ({ toISOString: () => '2020-01-01T00:00:00.000Z' - } as unknown as Date) + }) as unknown as Date ); jest.spyOn(apiHandler, 'writeChange').mockImplementation(async (data) => { return Promise.resolve(data); diff --git a/packages/preview-middleware-client/test/unit/adp/controllers/FileExistDialog.controller.test.ts b/packages/preview-middleware-client/test/unit/adp/controllers/FileExistDialog.controller.test.ts index 5c8e3104090..bf892ab6ec4 100644 --- a/packages/preview-middleware-client/test/unit/adp/controllers/FileExistDialog.controller.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/controllers/FileExistDialog.controller.test.ts @@ -3,7 +3,7 @@ import { fetchMock, sapCoreMock } from 'mock/window'; import OverlayRegistry from 'mock/sap/ui/dt/OverlayRegistry'; import type Dialog from 'sap/m/Dialog'; import FileExistsDialog from '../../../../src/adp/controllers/FileExistsDialog.controller'; -import JSONModel from 'sap/ui/model/json/JSONModel'; +import type JSONModel from 'sap/ui/model/json/JSONModel'; describe('FileExistsDialog', () => { beforeAll(() => { diff --git a/packages/preview-middleware-client/test/unit/adp/dialog-factory.test.ts b/packages/preview-middleware-client/test/unit/adp/dialog-factory.test.ts index 9f43fb994a9..4e7b8a08b28 100644 --- a/packages/preview-middleware-client/test/unit/adp/dialog-factory.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/dialog-factory.test.ts @@ -1,5 +1,5 @@ import type UI5Element from 'sap/ui/core/Element'; -import { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import Fragment, { attachBeforeClose } from 'mock/sap/ui/core/Fragment'; @@ -16,7 +16,7 @@ import AddCustomFragment from 'open/ux/preview/client/adp/controllers/AddCustomF describe('DialogFactory', () => { afterEach(() => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const closeDialogFunction = attachBeforeClose.mock.calls[0]?.[0]; if (typeof closeDialogFunction === 'function') { // make sure that dialog factory is in clean state after each test @@ -66,11 +66,11 @@ describe('DialogFactory', () => { defaultAggregationArrayIndex: 1 } ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].name).toStrictEqual('open.ux.preview.client.adp.ui.AddFragment'); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].id).toStrictEqual(undefined); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].controller).toBeInstanceOf(AddFragment); expect(DialogFactory.canOpenDialog).toBe(false); @@ -88,13 +88,13 @@ describe('DialogFactory', () => { rtaMock as unknown as RuntimeAuthoring, DialogNames.ADD_TABLE_COLUMN_FRAGMENTS ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].name).toStrictEqual( 'open.ux.preview.client.adp.ui.AddTableColumnFragments' ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].id).toStrictEqual(undefined); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].controller).toBeInstanceOf(AddTableColumnFragments); expect(DialogFactory.canOpenDialog).toBe(false); @@ -112,11 +112,11 @@ describe('DialogFactory', () => { rtaMock as unknown as RuntimeAuthoring, DialogNames.CONTROLLER_EXTENSION ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].name).toStrictEqual('open.ux.preview.client.adp.ui.ControllerExtension'); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].id).toStrictEqual(undefined); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].controller).toBeInstanceOf(ControllerExtension); expect(DialogFactory.canOpenDialog).toBe(false); @@ -134,11 +134,11 @@ describe('DialogFactory', () => { rtaMock as unknown as RuntimeAuthoring, DialogNames.ADD_FRAGMENT_AT_EXTENSION_POINT ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].name).toStrictEqual('open.ux.preview.client.adp.ui.ExtensionPoint'); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].id).toStrictEqual('dialog--ExtensionPoint'); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].controller).toBeInstanceOf(ExtensionPoint); expect(DialogFactory.canOpenDialog).toBe(false); @@ -156,11 +156,11 @@ describe('DialogFactory', () => { rtaMock as unknown as RuntimeAuthoring, DialogNames.FILE_EXISTS ); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].name).toStrictEqual('open.ux.preview.client.adp.ui.FileExistsDialog'); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].id).toStrictEqual(undefined); - // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access + expect(Fragment.load.mock.calls[0][0].controller).toBeInstanceOf(FileExistsDialog); }); diff --git a/packages/preview-middleware-client/test/unit/adp/init-dialogs.test.ts b/packages/preview-middleware-client/test/unit/adp/init-dialogs.test.ts index f68611cea0e..4636ab63460 100644 --- a/packages/preview-middleware-client/test/unit/adp/init-dialogs.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/init-dialogs.test.ts @@ -1,4 +1,4 @@ -import { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; import type ElementOverlay from 'sap/ui/dt/ElementOverlay'; import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import hasStableId from 'mock/sap/ui/rta/util/hasStableId'; diff --git a/packages/preview-middleware-client/test/unit/adp/init.test.ts b/packages/preview-middleware-client/test/unit/adp/init.test.ts index 2eeca3c96eb..53c1e40f22c 100644 --- a/packages/preview-middleware-client/test/unit/adp/init.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/init.test.ts @@ -6,7 +6,7 @@ import { OutlineService } from '../../../src/cpe/outline/service'; import { CommunicationService } from '../../../src/cpe/communication-service'; import VersionInfo from 'mock/sap/ui/VersionInfo'; import RuntimeAuthoringMock from 'mock/sap/ui/rta/RuntimeAuthoring'; -import { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import ElementRegistry from 'mock/sap/ui/core/ElementRegistry'; import Element from 'mock/sap/ui/core/Element'; diff --git a/packages/preview-middleware-client/test/unit/adp/quick-actions/fe-v2.test.ts b/packages/preview-middleware-client/test/unit/adp/quick-actions/fe-v2.test.ts index c7212a16960..063d144aa43 100644 --- a/packages/preview-middleware-client/test/unit/adp/quick-actions/fe-v2.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/quick-actions/fe-v2.test.ts @@ -1,5 +1,6 @@ import FlexBox from 'sap/m/FlexBox'; -import RuntimeAuthoring, { FlexSettings, RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { FlexSettings, RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import RuntimeAuthoringMock from 'mock/sap/ui/rta/RuntimeAuthoring'; import * as versionUtils from 'open/ux/preview/client/utils/version'; import type AppComponentV2 from 'sap/suite/ui/generic/template/lib/AppComponent'; @@ -18,7 +19,7 @@ import { FeatureService } from '../../../../src/cpe/feature-service'; import FEV2QuickActionRegistry from '../../../../src/adp/quick-actions/fe-v2/registry'; import { attachBeforeClose } from 'mock/sap/ui/core/Fragment'; -import { sapCoreMock } from 'mock/window'; +import { sapCoreMock, fetchMock } from 'mock/window'; import NavContainer from 'mock/sap/m/NavContainer'; import XMLView from 'mock/sap/ui/core/mvc/XMLView'; import ComponentContainer from 'sap/ui/core/ComponentContainer'; @@ -27,9 +28,7 @@ import Component from 'mock/sap/ui/core/Component'; import CommandFactory from 'mock/sap/ui/rta/command/CommandFactory'; import FlexUtils from 'mock/sap/ui/fl/Utils'; import * as QCUtils from '../../../../src/cpe/quick-actions/utils'; -import { fetchMock } from 'mock/window'; -import { mockOverlay } from 'mock/sap/ui/dt/OverlayRegistry'; -import OverlayRegistry from 'mock/sap/ui/dt/OverlayRegistry'; +import OverlayRegistry, { mockOverlay } from 'mock/sap/ui/dt/OverlayRegistry'; import ManagedObject from 'mock/sap/ui/base/ManagedObject'; import { ANALYTICAL_TABLE_TYPE, @@ -85,7 +84,7 @@ describe('FE V2 quick actions', () => { }); }); afterEach(() => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const closeDialogFunction = attachBeforeClose.mock.calls[0]?.[0]; if (typeof closeDialogFunction === 'function') { // make sure that dialog factory is in clean state after each test @@ -512,7 +511,7 @@ describe('FE V2 quick actions', () => { }); const pageView = new XMLView(); const scrollIntoView = jest.fn(); - let attachedEvent: (() => Promise) | undefined = undefined; + let attachedEvent: (() => Promise) | undefined; const tableId = 'SmartTable' + testCase.isWithIconTabBar ? '-tab1' : ''; if (testCase.variantManagementDisabled) { jest.spyOn(ComponentMock, 'getOwnerComponentFor').mockImplementation(() => { @@ -1473,16 +1472,16 @@ describe('FE V2 quick actions', () => { } ] : testCase.versionInfo === '1.134.0' && testCase.isManifestPagesAsArray // support manifest pages as array from version 1.134 and above - ? [ - { - enabled: true, - id: 'listReport0-enable-semantic-daterange-filterbar', - kind: 'simple', - title: 'Enable Semantic Date Range in Filter Bar', - tooltip: undefined - } - ] - : [] + ? [ + { + enabled: true, + id: 'listReport0-enable-semantic-daterange-filterbar', + kind: 'simple', + title: 'Enable Semantic Date Range in Filter Bar', + tooltip: undefined + } + ] + : [] } ]) ); @@ -2165,7 +2164,7 @@ describe('FE V2 quick actions', () => { } as any ] }); - let tooltip = undefined; + let tooltip; let enabled = true; if (!testCase.isEnabled) { (tooltip = @@ -3030,7 +3029,7 @@ describe('FE V2 quick actions', () => { expectDisabledReason?: string; expectUnsupported?: boolean; expectToThrow?: string; - manifestPages?: Object; + manifestPages?: object; }[] = [ { innerTableType: M_TABLE_TYPE, diff --git a/packages/preview-middleware-client/test/unit/adp/quick-actions/fe-v4.test.ts b/packages/preview-middleware-client/test/unit/adp/quick-actions/fe-v4.test.ts index 3309aba75d5..a964bfa78b4 100644 --- a/packages/preview-middleware-client/test/unit/adp/quick-actions/fe-v4.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/quick-actions/fe-v4.test.ts @@ -10,18 +10,15 @@ const mockChangeService = { syncOutlineChanges: jest.fn() } as unknown as ChangeService; -import { - quickActionListChanged, - executeQuickAction, - QuickAction -} from '@sap-ux-private/control-property-editor-common'; +import type { QuickAction } from '@sap-ux-private/control-property-editor-common'; +import { quickActionListChanged, executeQuickAction } from '@sap-ux-private/control-property-editor-common'; import { QuickActionService } from '../../../../src/cpe/quick-actions/quick-action-service'; import { OutlineService } from '../../../../src/cpe/outline/service'; import { FeatureService } from '../../../../src/cpe/feature-service'; import FEV4QuickActionRegistry from 'open/ux/preview/client/adp/quick-actions/fe-v4/registry'; -import { sapCoreMock } from 'mock/window'; +import { sapCoreMock, fetchMock } from 'mock/window'; import NavContainer from 'mock/sap/m/NavContainer'; import XMLView from 'mock/sap/ui/core/mvc/XMLView'; import ComponentContainer from 'mock/sap/ui/core/ComponentContainer'; @@ -31,10 +28,9 @@ import CommandFactory from 'mock/sap/ui/rta/command/CommandFactory'; import FlexUtils from 'mock/sap/ui/fl/Utils'; import VersionInfo from 'mock/sap/ui/VersionInfo'; -import { fetchMock } from 'mock/window'; import { mockOverlay } from 'mock/sap/ui/dt/OverlayRegistry'; import ComponentMock from 'mock/sap/ui/core/Component'; -import UIComponent from 'sap/ui/core/UIComponent'; +import type UIComponent from 'sap/ui/core/UIComponent'; import AppComponentMock from 'mock/sap/fe/core/AppComponent'; import FlexRuntimeInfoAPI from 'mock/sap/ui/fl/apply/api/FlexRuntimeInfoAPI'; import { DialogFactory, DialogNames } from 'open/ux/preview/client/adp/dialog-factory'; @@ -73,7 +69,7 @@ describe('FE V4 quick actions', () => { }); afterEach(() => { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const closeDialogFunction = attachBeforeClose.mock.calls[0]?.[0]; if (typeof closeDialogFunction === 'function') { // make sure that dialog factory is in clean state after each test @@ -1612,9 +1608,10 @@ describe('FE V4 quick actions', () => { } as any ] }); - let tooltip = undefined; + let tooltip; let enabled = true; if (testCase.varianManagmentValue === 'Control') { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions (tooltip = 'This option has been disabled because variant management is already enabled for tables and charts'), (enabled = false); @@ -2530,9 +2527,10 @@ describe('FE V4 quick actions', () => { } as any ] }); - let tooltip = undefined; + let tooltip; let enabled = true; if (testCase.varianManagmentValue === 'Control') { + // eslint-disable-next-line @typescript-eslint/no-unused-expressions (tooltip = 'This option has been disabled because variant management is already enabled for tables and charts'), (enabled = false); @@ -2567,7 +2565,7 @@ describe('FE V4 quick actions', () => { enabled, title: 'Enable Variant Management in Tables and Charts', tooltip - } as QuickAction); + }) as QuickAction; expect(sendActionMock).toHaveBeenCalledWith( quickActionListChanged([ diff --git a/packages/preview-middleware-client/test/unit/adp/quick-actions/load.test.ts b/packages/preview-middleware-client/test/unit/adp/quick-actions/load.test.ts index e60f4d6e943..faad49d77e7 100644 --- a/packages/preview-middleware-client/test/unit/adp/quick-actions/load.test.ts +++ b/packages/preview-middleware-client/test/unit/adp/quick-actions/load.test.ts @@ -3,7 +3,7 @@ import FEV4QuickActionRegistry from 'open/ux/preview/client/adp/quick-actions/fe import FEV2QuickActionRegistry from 'open/ux/preview/client/adp/quick-actions/fe-v2/registry'; describe('quick action dynamic loading', () => { - test('fe-v2', async () => { + test('fe-v2', async () => { const definitions = await loadDefinitions('fe-v2'); expect(definitions[0]).toBeInstanceOf(FEV2QuickActionRegistry); }); diff --git a/packages/preview-middleware-client/test/unit/cpe/changes/flex-change.test.ts b/packages/preview-middleware-client/test/unit/cpe/changes/flex-change.test.ts index de558f3d0de..a440739be9c 100644 --- a/packages/preview-middleware-client/test/unit/cpe/changes/flex-change.test.ts +++ b/packages/preview-middleware-client/test/unit/cpe/changes/flex-change.test.ts @@ -4,10 +4,10 @@ import { PropertyType, type PropertyChange } from '@sap-ux-private/control-prope import { sapCoreMock } from 'mock/window'; import CommandFactory from 'mock/sap/ui/rta/command/CommandFactory'; import RuntimeAuthoringMock from 'mock/sap/ui/rta/RuntimeAuthoring'; -import { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import OverlayUtil from 'mock/sap/ui/dt/OverlayUtil'; -import { ManifestPropertyChange } from 'sap/ui/dt/DesignTimeMetadata'; +import type { ManifestPropertyChange } from 'sap/ui/dt/DesignTimeMetadata'; describe('flexChange', () => { // prepare diff --git a/packages/preview-middleware-client/test/unit/cpe/changes/service.test.ts b/packages/preview-middleware-client/test/unit/cpe/changes/service.test.ts index cc394b57be3..56d2f2aa58d 100644 --- a/packages/preview-middleware-client/test/unit/cpe/changes/service.test.ts +++ b/packages/preview-middleware-client/test/unit/cpe/changes/service.test.ts @@ -1,6 +1,6 @@ import * as flexChange from '../../../../src/cpe/changes/flex-change'; import { ChangeService } from '../../../../src/cpe/changes/service'; -import { ActionHandler } from '../../../../src/cpe/types'; +import type { ActionHandler } from '../../../../src/cpe/types'; import { changeProperty, deletePropertyChanges, @@ -11,10 +11,10 @@ import { showInfoCenterMessage } from '@sap-ux-private/control-property-editor-common'; import RuntimeAuthoringMock from 'mock/sap/ui/rta/RuntimeAuthoring'; -import { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; import { fetchMock } from 'mock/window'; import JsControlTreeModifierMock from 'mock/sap/ui/core/util/reflection/JsControlTreeModifier'; -import Control from 'sap/ui/core/Control'; +import type Control from 'sap/ui/core/Control'; import * as Utils from '../../../../src/utils/version'; import ChangesWriteAPIMock from 'mock/sap/ui/fl/write/api/ChangesWriteAPI'; import { CommunicationService } from 'open/ux/preview/client/cpe/communication-service'; diff --git a/packages/preview-middleware-client/test/unit/cpe/changes/validator.spec.ts b/packages/preview-middleware-client/test/unit/cpe/changes/validator.spec.ts index faa8454e0fa..117f38d3c75 100644 --- a/packages/preview-middleware-client/test/unit/cpe/changes/validator.spec.ts +++ b/packages/preview-middleware-client/test/unit/cpe/changes/validator.spec.ts @@ -4,16 +4,16 @@ import { validateBindingModel } from '../../../../src/cpe/changes/validator'; describe('vaildateBindingModel', () => { const mockModifiedcontrol = { getModel: jest.fn().mockReturnValue({ - getResourceBundle: jest.fn().mockReturnValue( - { - getText: jest.fn().mockImplementation(() => false) - } - ) + getResourceBundle: jest.fn().mockReturnValue({ + getText: jest.fn().mockImplementation(() => false) + }) }) }; test('should throw when invalid binding model string is provided', async () => { - await expect(() => validateBindingModel(mockModifiedcontrol as unknown as UI5Element, '{}')).rejects.toThrow('Invalid binding string.'); + await expect(() => validateBindingModel(mockModifiedcontrol as unknown as UI5Element, '{}')).rejects.toThrow( + 'Invalid binding string.' + ); }); test('should throw when invalid binding string for i18n model is provided', async () => { @@ -28,6 +28,8 @@ describe('vaildateBindingModel', () => { const control = { getModel: jest.fn().mockReturnValue(undefined) }; - await expect(() => validateBindingModel(control as unknown as UI5Element, '{ i18n>test }')).rejects.toThrow('Invalid binding model.'); + await expect(() => validateBindingModel(control as unknown as UI5Element, '{ i18n>test }')).rejects.toThrow( + 'Invalid binding model.' + ); }); }); diff --git a/packages/preview-middleware-client/test/unit/cpe/context-menu-service.test.ts b/packages/preview-middleware-client/test/unit/cpe/context-menu-service.test.ts index 791386c2826..41a42f97252 100644 --- a/packages/preview-middleware-client/test/unit/cpe/context-menu-service.test.ts +++ b/packages/preview-middleware-client/test/unit/cpe/context-menu-service.test.ts @@ -4,7 +4,8 @@ import * as cpeCpmmon from '@sap-ux-private/control-property-editor-common'; import RuntimeAuthoringMock from 'mock/sap/ui/rta/RuntimeAuthoring'; import { fetchMock } from 'mock/window'; import * as coreUtils from '../../../src/utils/core'; -import RuntimeAuthoring, { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import * as cpeUtils from '../../../src/cpe/utils'; import * as versionUtils from '../../../src/utils/version'; import * as applicationUtils from '../../../src/utils/application'; @@ -84,7 +85,7 @@ describe('context-menu-service', () => { contextMenuItems: [ { enabled: true, - id : 'DEFAULTACTION01', + id: 'DEFAULTACTION01', title: 'default action 01', tooltip: undefined }, diff --git a/packages/preview-middleware-client/test/unit/cpe/control-data.test.ts b/packages/preview-middleware-client/test/unit/cpe/control-data.test.ts index 0fc5fdcee7c..d1fe5ec91b4 100644 --- a/packages/preview-middleware-client/test/unit/cpe/control-data.test.ts +++ b/packages/preview-middleware-client/test/unit/cpe/control-data.test.ts @@ -3,7 +3,7 @@ import { buildControlData } from '../../../src/cpe/control-data'; import { getNameMock } from 'mock/sap/ui/base/DataType'; import { sapMock } from 'mock/window'; import { mockOverlay } from 'mock/sap/ui/dt/OverlayRegistry'; -import { DesigntimeSetting, ManifestSettingsValue } from 'sap/ui/dt/DesignTimeMetadata'; +import type { DesigntimeSetting, ManifestSettingsValue } from 'sap/ui/dt/DesignTimeMetadata'; describe('controlData', () => { // prepare diff --git a/packages/preview-middleware-client/test/unit/cpe/init.test.ts b/packages/preview-middleware-client/test/unit/cpe/init.test.ts index 0cd7d8401a6..24ebd843d7f 100644 --- a/packages/preview-middleware-client/test/unit/cpe/init.test.ts +++ b/packages/preview-middleware-client/test/unit/cpe/init.test.ts @@ -1,4 +1,5 @@ -import RuntimeAuthoring, { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import * as common from '@sap-ux-private/control-property-editor-common'; diff --git a/packages/preview-middleware-client/test/unit/cpe/logger.test.ts b/packages/preview-middleware-client/test/unit/cpe/logger.test.ts index 1f9631c5802..f1d5ecbc322 100644 --- a/packages/preview-middleware-client/test/unit/cpe/logger.test.ts +++ b/packages/preview-middleware-client/test/unit/cpe/logger.test.ts @@ -4,7 +4,7 @@ import Log from 'mock/sap/base/Log'; describe('logger', () => { beforeEach(() => { Log.error.mockClear(); - }) + }); test('info', async () => { logger.info('test'); expect(Log.info).toHaveBeenCalledTimes(1); diff --git a/packages/preview-middleware-client/test/unit/cpe/quick-actions/service.test.ts b/packages/preview-middleware-client/test/unit/cpe/quick-actions/service.test.ts index ca651e5ed23..ef4b0e3d007 100644 --- a/packages/preview-middleware-client/test/unit/cpe/quick-actions/service.test.ts +++ b/packages/preview-middleware-client/test/unit/cpe/quick-actions/service.test.ts @@ -1,9 +1,10 @@ import type FlexCommand from 'sap/ui/rta/command/FlexCommand'; -import RuntimeAuthoring, { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; import RuntimeAuthoringMock from 'mock/sap/ui/rta/RuntimeAuthoring'; +import type { SimpleQuickAction } from '@sap-ux-private/control-property-editor-common'; import { - SimpleQuickAction, quickActionListChanged, executeQuickAction, externalFileChange @@ -12,7 +13,7 @@ import { import type { ChangeService } from '../../../../src/cpe/changes/service'; import { QuickActionService } from '../../../../src/cpe/quick-actions/quick-action-service'; import { OutlineService } from '../../../../src/cpe/outline/service'; -import { +import type { QuickActionActivationContext, QuickActionContext, QuickActionDefinitionGroup, diff --git a/packages/preview-middleware-client/test/unit/cpe/rta-service.test.ts b/packages/preview-middleware-client/test/unit/cpe/rta-service.test.ts index cc56f2a284a..6f4e812deb5 100644 --- a/packages/preview-middleware-client/test/unit/cpe/rta-service.test.ts +++ b/packages/preview-middleware-client/test/unit/cpe/rta-service.test.ts @@ -1,9 +1,10 @@ import { RtaService } from '../../../src/cpe/rta-service'; -import { ActionHandler } from '../../../src/cpe/types'; +import type { ActionHandler } from '../../../src/cpe/types'; import { setAppMode, undo, redo, save, reloadApplication } from '@sap-ux-private/control-property-editor-common'; import RuntimeAuthoringMock from 'mock/sap/ui/rta/RuntimeAuthoring'; import { fetchMock } from 'mock/window'; -import RuntimeAuthoring, { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type { RTAOptions } from 'sap/ui/rta/RuntimeAuthoring'; +import type RuntimeAuthoring from 'sap/ui/rta/RuntimeAuthoring'; describe('rta-service', () => { let sendActionMock: jest.Mock; diff --git a/packages/preview-middleware-client/test/unit/flp/initCdm.test.ts b/packages/preview-middleware-client/test/unit/flp/initCdm.test.ts index a5e909abae1..549e05fc35f 100644 --- a/packages/preview-middleware-client/test/unit/flp/initCdm.test.ts +++ b/packages/preview-middleware-client/test/unit/flp/initCdm.test.ts @@ -1,5 +1,5 @@ import { sapMock } from 'mock/window'; -import { Window } from 'types/global'; +import type { Window } from 'types/global'; import initCdm from '../../../src/flp/initCdm'; describe('flp/initCdm', () => { diff --git a/packages/preview-middleware-client/test/unit/utils/error.test.ts b/packages/preview-middleware-client/test/unit/utils/error.test.ts index 2613b4a5505..029bbdb0474 100644 --- a/packages/preview-middleware-client/test/unit/utils/error.test.ts +++ b/packages/preview-middleware-client/test/unit/utils/error.test.ts @@ -12,7 +12,7 @@ describe('utils/error', () => { }); test('getError with object', async () => { - const error = getError({error: 'test'}); + const error = getError({ error: 'test' }); expect(error.message).toEqual('{"error":"test"}'); }); }); diff --git a/packages/preview-middleware-client/types/sap.fe.core.ts b/packages/preview-middleware-client/types/sap.fe.core.ts index 8fdf719344f..fe3a93f152a 100644 --- a/packages/preview-middleware-client/types/sap.fe.core.ts +++ b/packages/preview-middleware-client/types/sap.fe.core.ts @@ -1,17 +1,19 @@ declare module 'sap/fe/core/AppComponent' { - import UIComponent from 'sap/ui/core/UIComponent'; + import type UIComponent from 'sap/ui/core/UIComponent'; interface AppComponent extends UIComponent {} export default AppComponent; } declare module 'sap/fe/core/TemplateComponent' { - import UIComponent from 'sap/ui/core/UIComponent'; + import type UIComponent from 'sap/ui/core/UIComponent'; import type AppComponent from 'sap/fe/core/AppComponent'; interface TemplateComponent extends UIComponent { + /** + * + */ getAppComponent(): AppComponent; } export default TemplateComponent; } - diff --git a/packages/preview-middleware-client/types/sap.ui.dt.d.ts b/packages/preview-middleware-client/types/sap.ui.dt.d.ts index ea7c6f00ab2..e15728318b9 100644 --- a/packages/preview-middleware-client/types/sap.ui.dt.d.ts +++ b/packages/preview-middleware-client/types/sap.ui.dt.d.ts @@ -136,6 +136,7 @@ declare module 'sap/ui/dt/plugin/ContextMenu' { export interface ContextMenuItem { id: string; text: string | ((overlay: ElementOverlay) => string); + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type handler: Function; icon?: string; enabled: ((overlay: ElementOverlay[]) => boolean); diff --git a/packages/preview-middleware-client/types/sap.ushell.d.ts b/packages/preview-middleware-client/types/sap.ushell.d.ts index dc6466af5d2..468b2caf446 100644 --- a/packages/preview-middleware-client/types/sap.ushell.d.ts +++ b/packages/preview-middleware-client/types/sap.ushell.d.ts @@ -3,6 +3,7 @@ declare namespace sap.ushell { export class Container { static getServiceAsync(name: string): Promise; + // eslint-disable-next-line @typescript-eslint/no-unsafe-function-type static attachRendererCreatedEvent(callback: Function): void; static createRenderer(): ComponentContainer; static createRenderer(async: true): Promise; diff --git a/packages/preview-middleware/.eslintignore b/packages/preview-middleware/.eslintignore deleted file mode 100644 index cc1f8e004cc..00000000000 --- a/packages/preview-middleware/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test/fixtures -dist diff --git a/packages/preview-middleware/.eslintrc.js b/packages/preview-middleware/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/preview-middleware/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/preview-middleware/eslint.config.js b/packages/preview-middleware/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/preview-middleware/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/preview-middleware/src/base/flex.ts b/packages/preview-middleware/src/base/flex.ts index 674aadc86a9..58c01933a78 100644 --- a/packages/preview-middleware/src/base/flex.ts +++ b/packages/preview-middleware/src/base/flex.ts @@ -1,4 +1,5 @@ import type { Logger } from '@sap-ux/logger'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection } from '@ui5/fs'; import type { Editor } from 'mem-fs-editor'; import { existsSync, readdirSync, statSync, unlinkSync } from 'node:fs'; diff --git a/packages/preview-middleware/src/base/flp.ts b/packages/preview-middleware/src/base/flp.ts index 5609c1b59e6..46d95d370aa 100644 --- a/packages/preview-middleware/src/base/flp.ts +++ b/packages/preview-middleware/src/base/flp.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection } from '@ui5/fs'; import { create as createStorage } from 'mem-fs'; import { create } from 'mem-fs-editor'; @@ -9,6 +10,7 @@ import { Router as createRouter, static as serveStatic, json } from 'express'; import type connect from 'connect'; import path, { dirname, join, posix } from 'node:path'; import type { Logger, ToolsLogger } from '@sap-ux/logger'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { MiddlewareUtils } from '@ui5/server'; import { getWebappPath, @@ -473,7 +475,7 @@ export class FlpSandbox { //use protocol from request header referer as fallback for connect API (karma test runner) 'protocol' in req ? req.protocol - : req.headers.referer?.substring(0, req.headers.referer.indexOf(':')) ?? 'http', + : (req.headers.referer?.substring(0, req.headers.referer.indexOf(':')) ?? 'http'), req.headers.host, 'ui5-patched-router' in req ? req['ui5-patched-router']?.baseUrl : undefined ); diff --git a/packages/preview-middleware/src/base/test.ts b/packages/preview-middleware/src/base/test.ts index bd8b250a6cc..05d471cb3ac 100644 --- a/packages/preview-middleware/src/base/test.ts +++ b/packages/preview-middleware/src/base/test.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { Resource } from '@ui5/fs'; import type { CompleteTestConfig, TestConfig, TestConfigDefaults } from '../types'; diff --git a/packages/preview-middleware/src/ui5/middleware.ts b/packages/preview-middleware/src/ui5/middleware.ts index de2cb42f366..0d5d8cf8b48 100644 --- a/packages/preview-middleware/src/ui5/middleware.ts +++ b/packages/preview-middleware/src/ui5/middleware.ts @@ -1,5 +1,6 @@ import { LogLevel, ToolsLogger, UI5ToolingTransport } from '@sap-ux/logger'; import type { RequestHandler } from 'express'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { MiddlewareParameters } from '@ui5/server'; import { type EnhancedRouter, FlpSandbox, initAdp } from '../base/flp'; import type { MiddlewareConfig } from '../types'; diff --git a/packages/preview-middleware/test/fixtures/multi-app/webapp/test/locate-reuse-libs.js b/packages/preview-middleware/test/fixtures/multi-app/webapp/test/locate-reuse-libs.js index 6d28a3b2bb0..711eb5cf9aa 100644 --- a/packages/preview-middleware/test/fixtures/multi-app/webapp/test/locate-reuse-libs.js +++ b/packages/preview-middleware/test/fixtures/multi-app/webapp/test/locate-reuse-libs.js @@ -1,3 +1,3 @@ sap.ui.getCore().attachInit(function () { - sap.ushell.Container.createRenderer().placeAt("content"); -}); \ No newline at end of file + sap.ushell.Container.createRenderer().placeAt('content'); +}); diff --git a/packages/preview-middleware/test/unit/base/flex.test.ts b/packages/preview-middleware/test/unit/base/flex.test.ts index 3dc8c6acf88..99cbb636ac1 100644 --- a/packages/preview-middleware/test/unit/base/flex.test.ts +++ b/packages/preview-middleware/test/unit/base/flex.test.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection } from '@ui5/fs'; import { ToolsLogger } from '@sap-ux/logger'; import { tmpdir } from 'node:os'; diff --git a/packages/preview-middleware/test/unit/base/flp.test.ts b/packages/preview-middleware/test/unit/base/flp.test.ts index 2aa62ac0b86..dc0333b462f 100644 --- a/packages/preview-middleware/test/unit/base/flp.test.ts +++ b/packages/preview-middleware/test/unit/base/flp.test.ts @@ -1,12 +1,15 @@ +// es +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection } from '@ui5/fs'; import { CARD_GENERATOR_DEFAULT, type TemplateConfig } from '../../../src/base/config'; import { FlpSandbox as FlpSandboxUnderTest, initAdp } from '../../../src'; import type { FlpConfig, MiddlewareConfig } from '../../../src'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { MiddlewareUtils } from '@ui5/server'; import type { Logger, ToolsLogger } from '@sap-ux/logger'; import type { ProjectAccess, I18nBundles, Manifest, ApplicationAccess } from '@sap-ux/project-access'; -import { readFileSync } from 'node:fs'; -import { join } from 'node:path'; +import { readFileSync, promises } from 'node:fs'; +import path, { join } from 'node:path'; import type { SuperTest, Test } from 'supertest'; import supertest from 'supertest'; import express, { type Response, type NextFunction } from 'express'; @@ -17,9 +20,7 @@ import * as adpTooling from '@sap-ux/adp-tooling'; import * as projectAccess from '@sap-ux/project-access'; import type { I18nEntry } from '@sap-ux/i18n/src/types'; import { fetchMock } from '../../__mock__/global'; -import { promises } from 'node:fs'; import { getWebappPath } from '@sap-ux/project-access'; -import path from 'node:path'; import { createPropertiesI18nEntries } from '@sap-ux/i18n'; //@ts-expect-error: this import is not relevant for the 'erasableSyntaxOnly' check import connect = require('connect'); @@ -43,8 +44,8 @@ jest.mock('@sap-ux/i18n', () => { const createPropertiesI18nEntriesMock = createPropertiesI18nEntries as jest.Mock; class FlpSandbox extends FlpSandboxUnderTest { - public declare templateConfig: TemplateConfig; - public declare readonly flpConfig: FlpConfig; + declare public templateConfig: TemplateConfig; + declare public readonly flpConfig: FlpConfig; } describe('FlpSandbox', () => { diff --git a/packages/preview-middleware/test/unit/base/test.test.ts b/packages/preview-middleware/test/unit/base/test.test.ts index 5a96d01a9ec..01c6b2db1d5 100644 --- a/packages/preview-middleware/test/unit/base/test.test.ts +++ b/packages/preview-middleware/test/unit/base/test.test.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { Resource } from '@ui5/fs'; import { mergeTestConfigDefaults, generateImportList } from '../../../src/base/test'; diff --git a/packages/project-access/.eslintignore b/packages/project-access/.eslintignore deleted file mode 100644 index 3017c352b0d..00000000000 --- a/packages/project-access/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -src/types/package \ No newline at end of file diff --git a/packages/project-access/.eslintrc.js b/packages/project-access/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/project-access/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/project-access/eslint.config.js b/packages/project-access/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/project-access/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/project-access/src/file/file-search.ts b/packages/project-access/src/file/file-search.ts index 947ac557e47..fec3b2292bb 100644 --- a/packages/project-access/src/file/file-search.ts +++ b/packages/project-access/src/file/file-search.ts @@ -143,7 +143,6 @@ export function findBy(options: { if (fatalErrors.length === 0) { resolve(searchResult); } else { - // eslint-disable-next-line prefer-promise-reject-errors reject(fatalErrors); } }); diff --git a/packages/project-access/src/project/access.ts b/packages/project-access/src/project/access.ts index b8d8918368a..65269441d6a 100644 --- a/packages/project-access/src/project/access.ts +++ b/packages/project-access/src/project/access.ts @@ -43,7 +43,11 @@ class ApplicationAccessImp implements ApplicationAccess { * @param options - optional options, see below * @param options.fs - optional `mem-fs-editor` instance */ - constructor(private _project: Project, private appId: string, private options?: ApplicationAccessOptions) {} + constructor( + private _project: Project, + private appId: string, + private options?: ApplicationAccessOptions + ) {} /** * Returns the application structure. @@ -241,7 +245,10 @@ class ProjectAccessImp implements ProjectAccess { * @param _project - Project structure * @param options - optional options, like logger */ - constructor(private _project: Project, private options?: ProjectAccessOptions) {} + constructor( + private _project: Project, + private options?: ProjectAccessOptions + ) {} /** * Returns list of application IDs. diff --git a/packages/project-access/src/project/search.ts b/packages/project-access/src/project/search.ts index d5a62a01067..f9f9c59d98d 100644 --- a/packages/project-access/src/project/search.ts +++ b/packages/project-access/src/project/search.ts @@ -457,7 +457,7 @@ async function filterLibraries(pathMap: FileMapAndCache, memFs?: Editor): Promis try { pathMap.files[manifestPath] ??= await readJSON(manifestPath, memFs); const manifest = pathMap.files[manifestPath] as Manifest; - if (manifest['sap.app'] && manifest['sap.app'].type === 'library') { + if (manifest['sap.app']?.type === 'library') { const packageJsonPath = await findFileUp(FileName.Package, dirname(manifestPath), memFs); const projectRoot = packageJsonPath ? dirname(packageJsonPath) : null; if (projectRoot && (await fileExists(join(projectRoot, FileName.Ui5Yaml), memFs))) { @@ -485,7 +485,7 @@ async function filterComponents(pathMap: FileMapAndCache, memFs?: Editor): Promi try { pathMap.files[manifestPath] ??= await readJSON(manifestPath, memFs); const manifest = pathMap.files[manifestPath] as Manifest; - if (manifest['sap.app'] && manifest['sap.app'].type === 'component') { + if (manifest['sap.app']?.type === 'component') { const packageJsonPath = await findFileUp(FileName.Package, dirname(manifestPath), memFs); const projectRoot = packageJsonPath ? dirname(packageJsonPath) : null; if (projectRoot) { diff --git a/packages/project-access/src/types/package/basic.ts b/packages/project-access/src/types/package/basic.ts index 2365d3ff230..1d7e6998c33 100644 --- a/packages/project-access/src/types/package/basic.ts +++ b/packages/project-access/src/types/package/basic.ts @@ -1,45 +1,44 @@ /** Matches a [`class`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). - + @category Class -*/ + */ export type Class = Constructor & { prototype: T }; /** Matches a [`class` constructor](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes). - + @category Class -*/ + */ export type Constructor = new (...arguments_: Arguments) => T; /** Matches a JSON object. - + This type can be useful to enforce some input to be JSON-compatible or as a super-type to be extended from. Don't use this as a direct return type as the user would have to double-cast it: `jsonObject as unknown as CustomResponse`. Instead, you could extend your CustomResponse type from it to ensure your type only uses JSON-compatible types: `interface CustomResponse extends JsonObject { … }`. - + @category JSON -*/ + */ export type JsonObject = { [Key in string]: JsonValue } & { [Key in string]?: JsonValue | undefined }; /** Matches a JSON array. - + @category JSON -*/ + */ export type JsonArray = JsonValue[]; /** Matches any valid JSON primitive value. - + @category JSON -*/ + */ export type JsonPrimitive = string | number | boolean | null; /** Matches any valid JSON value. - + @see `Jsonify` if you need to transform a type to one that is assignable to `JsonValue`. - @category JSON -*/ + */ export type JsonValue = JsonPrimitive | JsonObject | JsonArray; diff --git a/packages/project-access/src/types/package/literal-union.ts b/packages/project-access/src/types/package/literal-union.ts index 9c0620b51b6..d4a7d9a994b 100644 --- a/packages/project-access/src/types/package/literal-union.ts +++ b/packages/project-access/src/types/package/literal-union.ts @@ -2,31 +2,30 @@ import type { Primitive } from './primitive'; /** Allows creating a union type by combining primitive types and literal types without sacrificing auto-completion in IDEs for the literal type part of the union. - + Currently, when a union type of a primitive type is combined with literal types, TypeScript loses all information about the combined literals. Thus, when such type is used in an IDE with autocompletion, no suggestions are made for the declared literals. - + This type is a workaround for [Microsoft/TypeScript#29729](https://github.com/Microsoft/TypeScript/issues/29729). It will be removed as soon as it's not needed anymore. - + @example ``` import type {LiteralUnion} from 'type-fest'; - + // Before - + type Pet = 'dog' | 'cat' | string; - + const pet: Pet = ''; // Start typing in your TypeScript-enabled IDE. // You **will not** get auto-completion for `dog` and `cat` literals. - + // After - + type Pet2 = LiteralUnion<'dog' | 'cat', string>; - + const pet: Pet2 = ''; // You **will** get auto-completion for `dog` and `cat` literals. ``` - @category Type -*/ + */ export type LiteralUnion = LiteralType | (BaseType & Record); diff --git a/packages/project-access/src/types/package/package-json.ts b/packages/project-access/src/types/package/package-json.ts index ff0fc32df35..665ea991412 100644 --- a/packages/project-access/src/types/package/package-json.ts +++ b/packages/project-access/src/types/package/package-json.ts @@ -1,10 +1,11 @@ import type { LiteralUnion } from './literal-union'; import type { JsonObject, JsonValue } from './basic'; +// eslint-disable-next-line @typescript-eslint/no-namespace declare namespace PackageJson { /** A person who has been involved in creating or maintaining the package. - */ + */ export type Person = | string | { @@ -18,12 +19,12 @@ declare namespace PackageJson { | { /** The URL to the package's issue tracker. - */ + */ url?: string; /** The email address to which issues should be reported. - */ + */ email?: string; }; @@ -32,185 +33,185 @@ declare namespace PackageJson { /** Location for executable scripts. Sugar to generate entries in the `bin` property by walking the folder. - */ + */ bin?: string; /** Location for Markdown files. - */ + */ doc?: string; /** Location for example scripts. - */ + */ example?: string; /** Location for the bulk of the library. - */ + */ lib?: string; /** Location for man pages. Sugar to generate a `man` array by walking the folder. - */ + */ man?: string; /** Location for test files. - */ + */ test?: string; }; export type Scripts = { /** Run **before** the package is published (Also run on local `npm install` without any arguments). - */ + */ prepublish?: string; /** Run both **before** the package is packed and published, and on local `npm install` without any arguments. This is run **after** `prepublish`, but **before** `prepublishOnly`. - */ + */ prepare?: string; /** Run **before** the package is prepared and packed, **only** on `npm publish`. - */ + */ prepublishOnly?: string; /** Run **before** a tarball is packed (on `npm pack`, `npm publish`, and when installing git dependencies). - */ + */ prepack?: string; /** Run **after** the tarball has been generated and moved to its final destination. - */ + */ postpack?: string; /** Run **after** the package is published. - */ + */ publish?: string; /** Run **after** the package is published. - */ + */ postpublish?: string; /** Run **before** the package is installed. - */ + */ preinstall?: string; /** Run **after** the package is installed. - */ + */ install?: string; /** Run **after** the package is installed and after `install`. - */ + */ postinstall?: string; /** Run **before** the package is uninstalled and before `uninstall`. - */ + */ preuninstall?: string; /** Run **before** the package is uninstalled. - */ + */ uninstall?: string; /** Run **after** the package is uninstalled. - */ + */ postuninstall?: string; /** Run **before** bump the package version and before `version`. - */ + */ preversion?: string; /** Run **before** bump the package version. - */ + */ version?: string; /** Run **after** bump the package version. - */ + */ postversion?: string; /** Run with the `npm test` command, before `test`. - */ + */ pretest?: string; /** Run with the `npm test` command. - */ + */ test?: string; /** Run with the `npm test` command, after `test`. - */ + */ posttest?: string; /** Run with the `npm stop` command, before `stop`. - */ + */ prestop?: string; /** Run with the `npm stop` command. - */ + */ stop?: string; /** Run with the `npm stop` command, after `stop`. - */ + */ poststop?: string; /** Run with the `npm start` command, before `start`. - */ + */ prestart?: string; /** Run with the `npm start` command. - */ + */ start?: string; /** Run with the `npm start` command, after `start`. - */ + */ poststart?: string; /** Run with the `npm restart` command, before `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. - */ + */ prerestart?: string; /** Run with the `npm restart` command. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. - */ + */ restart?: string; /** Run with the `npm restart` command, after `restart`. Note: `npm restart` will run the `stop` and `start` scripts if no `restart` script is provided. - */ + */ postrestart?: string; } & Partial>; /** Dependencies of the package. The version range is a string which has one or more space-separated descriptors. Dependencies can also be identified with a tarball or Git URL. - */ + */ export type Dependency = Partial>; /** Conditions which provide a way to resolve a package entry point based on the environment. - */ + */ export type ExportCondition = LiteralUnion< 'import' | 'require' | 'node' | 'node-addons' | 'deno' | 'browser' | 'electron' | 'react-native' | 'default', string @@ -220,7 +221,7 @@ declare namespace PackageJson { /** Entry points of a module, optionally with conditions and subpath exports. - */ + */ export type Exports = | null | string @@ -230,22 +231,20 @@ declare namespace PackageJson { /** Import map entries of a module, optionally with conditions. - */ + */ export type Imports = { - // eslint-disable-line @typescript-eslint/consistent-indexed-object-style [key: string]: string | { [key in ExportCondition]: Exports }; }; - // eslint-disable-next-line @typescript-eslint/consistent-type-definitions export interface NonStandardEntryPoints { /** An ECMAScript module ID that is the primary entry point to the program. - */ + */ module?: string; /** A module ID with untranspiled code that is the primary entry point to the program. - */ + */ esnext?: | string | { @@ -256,135 +255,135 @@ declare namespace PackageJson { /** A hint to JavaScript bundlers or component tools when packaging modules for client side use. - */ + */ browser?: string | Partial>; /** Denote which files in your project are "pure" and therefore safe for Webpack to prune if unused. - + [Read more.](https://webpack.js.org/guides/tree-shaking/) - */ + */ sideEffects?: boolean | string[]; } export type TypeScriptConfiguration = { /** Location of the bundled TypeScript declaration file. - */ + */ types?: string; /** Version selection map of TypeScript. - */ + */ typesVersions?: Partial>>>; /** Location of the bundled TypeScript declaration file. Alias of `types`. - */ + */ typings?: string; }; /** An alternative configuration for Yarn workspaces. - */ + */ export type WorkspaceConfig = { /** An array of workspace pattern strings which contain the workspace packages. - */ + */ packages?: WorkspacePattern[]; /** Designed to solve the problem of packages which break when their `node_modules` are moved to the root workspace directory - a process known as hoisting. For these packages, both within your workspace, and also some that have been installed via `node_modules`, it is important to have a mechanism for preventing the default Yarn workspace behavior. By adding workspace pattern strings here, Yarn will resume non-workspace behavior for any package which matches the defined patterns. - + [Read more](https://classic.yarnpkg.com/blog/2018/02/15/nohoist/) - */ + */ nohoist?: WorkspacePattern[]; }; /** A workspace pattern points to a directory or group of directories which contain packages that should be included in the workspace installation process. - + The patterns are handled with [minimatch](https://github.com/isaacs/minimatch). - + @example `docs` → Include the docs directory and install its dependencies. `packages/*` → Include all nested directories within the packages directory, like `packages/cli` and `packages/core`. - */ + */ type WorkspacePattern = string; export type YarnConfiguration = { /** Used to configure [Yarn workspaces](https://classic.yarnpkg.com/docs/workspaces/). - + Workspaces allow you to manage multiple packages within the same repository in such a way that you only need to run `yarn install` once to install all of them in a single pass. - + Please note that the top-level `private` property of `package.json` **must** be set to `true` in order to use workspaces. - */ + */ workspaces?: WorkspacePattern[] | WorkspaceConfig; /** If your package only allows one version of a given dependency, and you’d like to enforce the same behavior as `yarn install --flat` on the command-line, set this to `true`. - + Note that if your `package.json` contains `"flat": true` and other packages depend on yours (e.g. you are building a library rather than an app), those other packages will also need `"flat": true` in their `package.json` or be installed with `yarn install --flat` on the command-line. - */ + */ flat?: boolean; /** Selective version resolutions. Allows the definition of custom package versions inside dependencies without manual edits in the `yarn.lock` file. - */ + */ resolutions?: Dependency; }; export type JSPMConfiguration = { /** JSPM configuration. - */ + */ jspm?: PackageJson; }; /** Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Containing standard npm properties. - */ - // eslint-disable-next-line @typescript-eslint/consistent-type-definitions + */ + export interface PackageJsonStandard { /** The name of the package. - */ + */ name?: string; /** Package version, parseable by [`node-semver`](https://github.com/npm/node-semver). - */ + */ version?: string; /** Package description, listed in `npm search`. - */ + */ description?: string; /** Keywords associated with package, listed in `npm search`. - */ + */ keywords?: string[]; /** The URL to the package's homepage. - */ + */ homepage?: LiteralUnion<'.', string>; /** The URL to the package's issue tracker and/or the email address to which issues should be reported. - */ + */ bugs?: BugsLocation; /** The license for the package. - */ + */ license?: string; /** The licenses for the package. - */ + */ licenses?: Array<{ type?: string; url?: string; @@ -394,63 +393,63 @@ declare namespace PackageJson { /** A list of people who contributed to the package. - */ + */ contributors?: Person[]; /** A list of people who maintain the package. - */ + */ maintainers?: Person[]; /** The files included in the package. - */ + */ files?: string[]; /** Resolution algorithm for importing ".js" files from the package's scope. - + [Read more.](https://nodejs.org/api/esm.html#esm_package_json_type_field) - */ + */ type?: 'module' | 'commonjs'; /** The module ID that is the primary entry point to the program. - */ + */ main?: string; /** Subpath exports to define entry points of the package. - + [Read more.](https://nodejs.org/api/packages.html#subpath-exports) - */ + */ exports?: Exports; /** Subpath imports to define internal package import maps that only apply to import specifiers from within the package itself. - + [Read more.](https://nodejs.org/api/packages.html#subpath-imports) - */ + */ imports?: Imports; /** The executable files that should be installed into the `PATH`. - */ + */ bin?: string | Partial>; /** Filenames to put in place for the `man` program to find. - */ + */ man?: string | string[]; /** Indicates the structure of the package. - */ + */ directories?: DirectoryLocations; /** Location for the code repository. - */ + */ repository?: | string | { @@ -459,72 +458,72 @@ declare namespace PackageJson { /** Relative path to package.json if it is placed in non-root directory (for example if it is part of a monorepo). - + [Read more.](https://github.com/npm/rfcs/blob/latest/implemented/0010-monorepo-subdirectory-declaration.md) - */ + */ directory?: string; }; /** Script commands that are run at various times in the lifecycle of the package. The key is the lifecycle event, and the value is the command to run at that point. - */ + */ scripts?: Scripts; /** Is used to set configuration parameters used in package scripts that persist across upgrades. - */ + */ config?: JsonObject; /** The dependencies of the package. - */ + */ dependencies?: Dependency; /** Additional tooling dependencies that are not required for the package to work. Usually test, build, or documentation tooling. - */ + */ devDependencies?: Dependency; /** Dependencies that are skipped if they fail to install. - */ + */ optionalDependencies?: Dependency; /** Dependencies that will usually be required by the package user directly or via another dependency. - */ + */ peerDependencies?: Dependency; /** Indicate peer dependencies that are optional. - */ + */ peerDependenciesMeta?: Partial>; /** Package names that are bundled when the package is published. - */ + */ bundledDependencies?: string[]; /** Alias of `bundledDependencies`. - */ + */ bundleDependencies?: string[]; /** Engines that this package runs on. - */ + */ engines?: { - [EngineName in 'npm' | 'node' | string]?: string; // eslint-disable-line @typescript-eslint/no-redundant-type-constituents + [EngineName in 'npm' | 'node' | string]?: string; }; /** @deprecated - */ + */ engineStrict?: boolean; /** Operating systems the module runs on. - */ + */ os?: Array< LiteralUnion< | 'aix' @@ -547,7 +546,7 @@ declare namespace PackageJson { /** CPU architectures the module runs on. - */ + */ cpu?: Array< LiteralUnion< | 'arm' @@ -578,32 +577,32 @@ declare namespace PackageJson { /** If set to `true`, a warning will be shown if package is installed locally. Useful if the package is primarily a command-line application that should be installed globally. - + @deprecated - */ + */ preferGlobal?: boolean; /** If set to `true`, then npm will refuse to publish it. - */ + */ private?: boolean; /** A set of config values that will be used at publish-time. It's especially handy to set the tag, registry or access, to ensure that a given package is not tagged with 'latest', published to the global public registry or that a scoped module is private by default. - */ + */ publishConfig?: PublishConfig; /** Describes and notifies consumers of a package's monetary support information. - + [Read more.](https://github.com/npm/rfcs/blob/latest/accepted/0017-add-funding-support.md) - */ + */ funding?: | string | { /** The type of funding. - */ + */ type?: LiteralUnion< 'github' | 'opencollective' | 'patreon' | 'individual' | 'foundation' | 'corporation', string @@ -611,62 +610,62 @@ declare namespace PackageJson { /** The URL to the funding page. - */ + */ url: string; }; } /** Type for [`package.json` file used by the Node.js runtime](https://nodejs.org/api/packages.html#nodejs-packagejson-field-definitions). - */ + */ export type NodeJsStandard = { /** Defines which package manager is expected to be used when working on the current project. It can set to any of the [supported package managers](https://nodejs.org/api/corepack.html#supported-package-managers), and will ensure that your teams use the exact same package manager versions without having to install anything else than Node.js. - + __This field is currently experimental and needs to be opted-in; check the [Corepack](https://nodejs.org/api/corepack.html) page for details about the procedure.__ - + @example ```json { "packageManager": "@" } ``` - */ + */ packageManager?: string; }; export type PublishConfig = { /** Additional, less common properties from the [npm docs on `publishConfig`](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#publishconfig). - */ + */ [additionalProperties: string]: JsonValue | undefined; /** When publishing scoped packages, the access level defaults to restricted. If you want your scoped package to be publicly viewable (and installable) set `--access=public`. The only valid values for access are public and restricted. Unscoped packages always have an access level of public. - */ + */ access?: 'public' | 'restricted'; /** The base URL of the npm registry. - + Default: `'https://registry.npmjs.org/'` - */ + */ registry?: string; /** The tag to publish the package under. - + Default: `'latest'` - */ + */ tag?: string; }; } /** Type for [npm's `package.json` file](https://docs.npmjs.com/creating-a-package-json-file). Also includes types for fields used by other popular projects, like TypeScript and Yarn. - + @category File -*/ + */ export type PackageJson = JsonObject & PackageJson.NodeJsStandard & PackageJson.PackageJsonStandard & diff --git a/packages/project-access/src/types/package/primitive.ts b/packages/project-access/src/types/package/primitive.ts index cf2b3132abb..64e1715d767 100644 --- a/packages/project-access/src/types/package/primitive.ts +++ b/packages/project-access/src/types/package/primitive.ts @@ -1,6 +1,6 @@ /** Matches any [primitive value](https://developer.mozilla.org/en-US/docs/Glossary/Primitive). - + @category Type -*/ + */ export type Primitive = null | undefined | string | number | boolean | symbol | bigint; diff --git a/packages/project-input-validator/.eslintignore b/packages/project-input-validator/.eslintignore deleted file mode 100644 index 1521c8b7652..00000000000 --- a/packages/project-input-validator/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist diff --git a/packages/project-input-validator/.eslintrc.js b/packages/project-input-validator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/project-input-validator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/project-input-validator/eslint.config.js b/packages/project-input-validator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/project-input-validator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/project-integrity/.eslintignore b/packages/project-integrity/.eslintignore deleted file mode 100644 index 93a3fe1f457..00000000000 --- a/packages/project-integrity/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -test/test-input -dist diff --git a/packages/project-integrity/.eslintrc.js b/packages/project-integrity/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/project-integrity/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/project-integrity/eslint.config.js b/packages/project-integrity/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/project-integrity/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/reload-middleware/.eslintignore b/packages/reload-middleware/.eslintignore deleted file mode 100644 index 0fc18a40e56..00000000000 --- a/packages/reload-middleware/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test -dist diff --git a/packages/reload-middleware/.eslintrc.js b/packages/reload-middleware/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/reload-middleware/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/reload-middleware/eslint.config.js b/packages/reload-middleware/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/reload-middleware/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/reload-middleware/src/base/livereload.ts b/packages/reload-middleware/src/base/livereload.ts index 1a85b143ed4..ca5489bdf92 100644 --- a/packages/reload-middleware/src/base/livereload.ts +++ b/packages/reload-middleware/src/base/livereload.ts @@ -12,7 +12,7 @@ import { defaultLiveReloadOpts, defaultConnectLivereloadOpts } from './constants declare global { // false positive, const can't be used here https://github.com/eslint/eslint/issues/15896 - // eslint-disable-next-line no-var + var __SAP_UX_MANIFEST_SYNC_REQUIRED__: boolean | undefined; } diff --git a/packages/reload-middleware/src/ui5/middleware.ts b/packages/reload-middleware/src/ui5/middleware.ts index 49cf56c444e..0c5b589df11 100644 --- a/packages/reload-middleware/src/ui5/middleware.ts +++ b/packages/reload-middleware/src/ui5/middleware.ts @@ -5,6 +5,7 @@ import { defaultConnectLivereloadOpts } from '../base'; import type { ReloaderConfig, HttpsOptions } from '../base'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { MiddlewareParameters } from '@ui5/server'; import type { RequestHandler } from 'express'; import { ToolsLogger, UI5ToolingTransport } from '@sap-ux/logger'; diff --git a/packages/repo-app-import-sub-generator/.eslintignore b/packages/repo-app-import-sub-generator/.eslintignore deleted file mode 100644 index 2705234da53..00000000000 --- a/packages/repo-app-import-sub-generator/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -generators diff --git a/packages/repo-app-import-sub-generator/.eslintrc.js b/packages/repo-app-import-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/repo-app-import-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/repo-app-import-sub-generator/eslint.config.js b/packages/repo-app-import-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/repo-app-import-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/repo-app-import-sub-generator/test/app-config.test.ts b/packages/repo-app-import-sub-generator/test/app-config.test.ts index 8c27d205c3b..1627f6ea752 100644 --- a/packages/repo-app-import-sub-generator/test/app-config.test.ts +++ b/packages/repo-app-import-sub-generator/test/app-config.test.ts @@ -7,11 +7,10 @@ import { PromptState } from '../src/prompts/prompt-state'; import type { AppInfo, QfaJsonConfig } from '../src/app/types'; import { readManifest } from '../src/utils/file-helpers'; import { t } from '../src/utils/i18n'; -import { fioriAppSourcetemplateId } from '../src/utils/constants'; +import { fioriAppSourcetemplateId, qfaJsonFileName } from '../src/utils/constants'; import RepoAppDownloadLogger from '../src/utils/logger'; import { TestFixture } from './fixtures'; import { join } from 'node:path'; -import { qfaJsonFileName } from '../src/utils/constants'; import { type OdataServiceAnswers } from '@sap-ux/odata-service-inquirer'; jest.mock('../src/utils/logger', () => ({ diff --git a/packages/repo-app-import-sub-generator/test/prompts/prompts.test.ts b/packages/repo-app-import-sub-generator/test/prompts/prompts.test.ts index 6ad25e74e96..534fa02b28a 100644 --- a/packages/repo-app-import-sub-generator/test/prompts/prompts.test.ts +++ b/packages/repo-app-import-sub-generator/test/prompts/prompts.test.ts @@ -36,7 +36,7 @@ jest.mock('../../src/utils/validators', () => ({ validateAppSelection: jest.fn() })); describe('getPrompts', () => { - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const mockGetSystemSelectionQuestions = require('@sap-ux/odata-service-inquirer').getSystemSelectionQuestions; const mockFetchAppList = helpers.fetchAppListForSelectedSystem as jest.Mock; const mockDownloadApp = downloadUtils.downloadApp as jest.Mock; diff --git a/packages/repo-app-import-sub-generator/test/utils/validators.test.ts b/packages/repo-app-import-sub-generator/test/utils/validators.test.ts index d3c4305d4a9..ad99791f15d 100644 --- a/packages/repo-app-import-sub-generator/test/utils/validators.test.ts +++ b/packages/repo-app-import-sub-generator/test/utils/validators.test.ts @@ -3,11 +3,10 @@ import type { QfaJsonConfig, QuickDeployedAppConfig, AppInfo } from '../../src/a import { t } from '../../src/utils/i18n'; import RepoAppDownloadLogger from '../../src/utils/logger'; import { downloadApp, hasQfaJson } from '../../src/utils/download-utils'; -import type { AppIndex } from '@sap-ux/axios-extension'; +import type { AppIndex, AbapServiceProvider } from '@sap-ux/axios-extension'; import { ErrorHandler, ERROR_TYPE } from '@sap-ux/inquirer-common'; import { HELP_NODES } from '@sap-ux/guided-answers-helper'; import { PromptState } from '../../src/prompts/prompt-state'; -import type { AbapServiceProvider } from '@sap-ux/axios-extension'; import { qfaJsonFileName } from '../../src/utils/constants'; import type { AppWizard } from '@sap-devx/yeoman-ui-types'; import { MessageType } from '@sap-devx/yeoman-ui-types'; diff --git a/packages/serve-static-middleware/.eslintignore b/packages/serve-static-middleware/.eslintignore deleted file mode 100644 index ecfc81b1545..00000000000 --- a/packages/serve-static-middleware/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -test diff --git a/packages/serve-static-middleware/.eslintrc.js b/packages/serve-static-middleware/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/serve-static-middleware/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/serve-static-middleware/eslint.config.js b/packages/serve-static-middleware/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/serve-static-middleware/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/serve-static-middleware/src/ui5/middleware.ts b/packages/serve-static-middleware/src/ui5/middleware.ts index 1c7f4507013..a3ab7b2db33 100644 --- a/packages/serve-static-middleware/src/ui5/middleware.ts +++ b/packages/serve-static-middleware/src/ui5/middleware.ts @@ -1,5 +1,6 @@ import { serveStaticMiddleware } from '../base'; import type { ServeStaticConfig } from '../base'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { MiddlewareParameters } from '@ui5/server'; import type { RequestHandler } from 'express'; import { ToolsLogger, UI5ToolingTransport } from '@sap-ux/logger'; diff --git a/packages/serve-static-middleware/test/ui5/middleware.test.ts b/packages/serve-static-middleware/test/ui5/middleware.test.ts index 948e9d8e682..6240fbfcce9 100644 --- a/packages/serve-static-middleware/test/ui5/middleware.test.ts +++ b/packages/serve-static-middleware/test/ui5/middleware.test.ts @@ -86,14 +86,28 @@ describe('Start server with serve-static-middleware', () => { test('keepCacheBusterInUrl (cache buster URL)', async () => { const server = await getTestServer({ - paths: [{ path: '/resources', src: join(localUI5Path, 'resources'), fallthrough: false, keepCacheBusterInUrl: true }] + paths: [ + { + path: '/resources', + src: join(localUI5Path, 'resources'), + fallthrough: false, + keepCacheBusterInUrl: true + } + ] }); expect(await server.get(CACHEBUSTER_CORE)).toMatchObject({ status: 404 }); }); test('keepCacheBusterInUrl (normal URL)', async () => { const server = await getTestServer({ - paths: [{ path: '/resources', src: join(localUI5Path, 'resources'), fallthrough: false, keepCacheBusterInUrl: true }] + paths: [ + { + path: '/resources', + src: join(localUI5Path, 'resources'), + fallthrough: false, + keepCacheBusterInUrl: true + } + ] }); expect(await server.get(CORE)).toMatchObject({ status: 200 }); }); diff --git a/packages/store/.eslintignore b/packages/store/.eslintignore deleted file mode 100644 index 93a3fe1f457..00000000000 --- a/packages/store/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -test/test-input -dist diff --git a/packages/store/.eslintrc.js b/packages/store/.eslintrc.js deleted file mode 100644 index 65612a02793..00000000000 --- a/packages/store/.eslintrc.js +++ /dev/null @@ -1,18 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - 'jsdoc/require-returns': 0, - 'jsdoc/require-param': 0, - 'jsdoc/require-jsdoc': 0, - 'jsdoc/match-description': 0, - 'jsdoc/multiline-blocks': 0, - 'jsdoc/tag-lines': 0, - 'jsdoc/require-param-description': 0, - 'jsdoc/no-multi-asterisks': 0, - 'jsdoc/check-tag-names': 0 - } -}; diff --git a/packages/store/eslint.config.js b/packages/store/eslint.config.js new file mode 100644 index 00000000000..d5701f6d75e --- /dev/null +++ b/packages/store/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + } + }, +]; \ No newline at end of file diff --git a/packages/store/src/data-access/filesystem.ts b/packages/store/src/data-access/filesystem.ts index c1ed915f28c..e293f554cac 100644 --- a/packages/store/src/data-access/filesystem.ts +++ b/packages/store/src/data-access/filesystem.ts @@ -19,15 +19,29 @@ export const basedir = ({ baseDirectory }: { baseDirectory?: string } = {}): str } }; +/** + * + */ class FilesystemStore implements DataAccess { private readonly logger: Logger; private readonly storeDirectory: string; + /** + * + * @param logger + * @param options + */ constructor(logger: Logger, options: ServiceOptions = {}) { this.logger = logger; this.storeDirectory = basedir(options); } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.id + */ public async read({ entityName, id }: { entityName: string; id: string }): Promise { const name = toPersistenceName(entityName); if (!name) { @@ -50,6 +64,11 @@ class FilesystemStore implements DataAccess { return Promise.resolve(entities[id]); } + /** + * + * @param root0 + * @param root0.entityName + */ public async getAll({ entityName }: { entityName: string }): Promise { const name = toPersistenceName(entityName); if (!name) { @@ -72,6 +91,11 @@ class FilesystemStore implements DataAccess { return Promise.resolve(Object.values(entities)); } + /** + * + * @param root0 + * @param root0.entityName + */ public async readAll({ entityName }: { entityName: string }): Promise<{ [key: string]: E }> { const name = toPersistenceName(entityName); if (!name) { @@ -94,6 +118,13 @@ class FilesystemStore implements DataAccess { return Promise.resolve(entities); } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.id + * @param root0.entity + */ public async write({ entityName, id, @@ -119,6 +150,13 @@ class FilesystemStore implements DataAccess { return Promise.resolve(entity); } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.id + * @param root0.entity + */ public async partialUpdate({ entityName, id, @@ -142,11 +180,22 @@ class FilesystemStore implements DataAccess { return this.write({ entityName, id, entity: updatedEntity }); } + /** + * + * @param update + * @param existingSystem + */ private mergeProperties(update: Partial, existingSystem: E): E { const updatedEntity = { ...existingSystem, ...update }; return { ...updatedEntity }; } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.id + */ async del({ entityName, id }: { entityName: string; id: string }): Promise { const name = toPersistenceName(entityName); if (!name) { @@ -173,6 +222,10 @@ class FilesystemStore implements DataAccess { } } + /** + * + * @param entityName + */ private _readAll(entityName: string): { entities?: { [key: string]: E }; error?: Error & { code?: string } } { let rawContents: string; try { @@ -202,6 +255,10 @@ class FilesystemStore implements DataAccess { return { entities }; } + /** + * + * @param entityName + */ private writeToFile(entityName: string, entities: { [key: string]: E }): void { const data = JSON.stringify({ [entityName]: entities }, null, 2); const filename = getEntityFileName(entityName); @@ -230,12 +287,21 @@ function toPersistenceName(s: string): string | undefined { return t && plural(t); } +/** + * + * @param entityName + */ function getEntityFileName(entityName: string): string { return toPersistenceName(entityName) + '.json'; } -/** Return an FSWatcher for a given entity name - * The client is responsible for disposing of the FSWatcher +/** + * Return an FSWatcher for a given entity name + * The client is responsible for disposing of the FSWatcher + * + * @param entityName + * @param callback + * @param options */ export function getFilesystemWatcherFor( entityName: Entity, @@ -257,6 +323,9 @@ export function getFilesystemWatcherFor( * Filesystem store. The entity is stored in JSON format (don't depend on the format, this could change). * The entity is stored in a file named with the plural form of the entity name in the base directory. Again, this is an * implementation detail, please don't depend on it. + * + * @param logger + * @param options */ export function getFilesystemStore(logger: Logger, options?: ServiceOptions): DataAccess { return new FilesystemStore(logger, options); diff --git a/packages/store/src/data-access/hybrid.ts b/packages/store/src/data-access/hybrid.ts index c48b4b67505..ef596bb63a4 100644 --- a/packages/store/src/data-access/hybrid.ts +++ b/packages/store/src/data-access/hybrid.ts @@ -8,21 +8,39 @@ import type { DataAccess } from '.'; import type { ServiceOptions } from '../types'; import { inspect } from 'util'; +/** + * + * @param name + */ function getFullyQualifiedServiceName(name: string): string { return 'fiori/v2/' + name; } +/** + * + */ class HybridStore implements DataAccess { private readonly logger: Logger; private readonly filesystem: DataAccess; private readonly secureStore: SecureStore; + /** + * + * @param logger + * @param options + */ constructor(logger: Logger, options: ServiceOptions = {}) { this.logger = logger; this.filesystem = dataAccessFilesystem(this.logger, options); this.secureStore = getSecureStore(this.logger); } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.id + */ public async read({ entityName, id }: { entityName: string; id: string }): Promise { const serialized = await this.filesystem.read({ entityName, id }); if (!serialized) { @@ -49,6 +67,12 @@ class HybridStore implements DataAccess { } } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.includeSensitiveData + */ public async getAll({ entityName, includeSensitiveData = true @@ -59,6 +83,12 @@ class HybridStore implements DataAccess { return Object.values(await this.readAll({ entityName, includeSensitiveData })) as unknown as E[]; } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.includeSensitiveData + */ async readAll({ entityName, includeSensitiveData = true @@ -86,6 +116,13 @@ class HybridStore implements DataAccess { return result; } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.id + * @param root0.entity + */ public async write({ entityName, id, @@ -131,6 +168,12 @@ class HybridStore implements DataAccess { return entity; } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.id + */ public async del({ entityName, id }: { entityName: string; id: string }): Promise { const deletedinFs = await this.filesystem.del({ entityName, id }); this.logger.debug(`hybrid/del - delete result for id [${id}] on the filesystem: ${deletedinFs}`); @@ -141,6 +184,13 @@ class HybridStore implements DataAccess { return deletedinFs || deletedInSecureStore; } + /** + * + * @param root0 + * @param root0.entityName + * @param root0.id + * @param root0.entity + */ public async partialUpdate({ entityName, id, @@ -158,12 +208,16 @@ class HybridStore implements DataAccess { } } -/** A hybrid store +/** + * A hybrid store * Stores serializable properties on the filesystem * The properties need to be decorated with `@serilizable` annotations * * Sensitive properties (decorated with `@sensitiveData`) will be stored * in the system's secure store + * + * @param logger + * @param options */ export function getHybridStore(logger: Logger, options?: ServiceOptions): DataAccess { return new HybridStore(logger, options); diff --git a/packages/store/src/data-access/index.ts b/packages/store/src/data-access/index.ts index 809f2dc2e73..e995b729350 100644 --- a/packages/store/src/data-access/index.ts +++ b/packages/store/src/data-access/index.ts @@ -6,10 +6,19 @@ import type { Logger } from '@sap-ux/logger'; * related to the medium used (locking, buffering, etc) */ export interface DataAccess { + /** + * + */ read(options: { entityName: string; id: string }): Promise; + /** + * + */ write(options: { entityName: string; id: string; entity: Entity }): Promise; + /** + * + */ del(options: { entityName: string; id: string }): Promise; /** Return an array of entities */ diff --git a/packages/store/src/data-provider/api-hub.ts b/packages/store/src/data-provider/api-hub.ts index b9d606523f7..17a9a953728 100644 --- a/packages/store/src/data-provider/api-hub.ts +++ b/packages/store/src/data-provider/api-hub.ts @@ -14,15 +14,28 @@ export const ApiHubSettingsProvider: DataProviderConstructor { return this.dataAccessor.read({ entityName: this.entityName, id: key.getId() }); } + /** + * + * @param entity + */ public write(entity: ApiHubSettings): Promise { return this.dataAccessor.write({ entityName: this.entityName, @@ -31,6 +44,10 @@ export const ApiHubSettingsProvider: DataProviderConstructor { return this.dataAccessor.del({ entityName: this.entityName, @@ -38,6 +55,9 @@ export const ApiHubSettingsProvider: DataProviderConstructor { return this.dataAccessor.getAll({ entityName: this.entityName }); } diff --git a/packages/store/src/data-provider/backend-system.ts b/packages/store/src/data-provider/backend-system.ts index 0285440fcf0..7dd2feee1cf 100644 --- a/packages/store/src/data-provider/backend-system.ts +++ b/packages/store/src/data-provider/backend-system.ts @@ -15,15 +15,28 @@ export const SystemDataProvider: DataProviderConstructor { return this.dataAccessor.read({ entityName: this.entityName, id: key.getId() }); } + /** + * + * @param entity + */ public async write(entity: BackendSystem): Promise { let e: BackendSystem; if (!(entity instanceof BackendSystem)) { @@ -39,6 +52,10 @@ export const SystemDataProvider: DataProviderConstructor { return this.dataAccessor.del({ entityName: this.entityName, @@ -46,6 +63,11 @@ export const SystemDataProvider: DataProviderConstructor): Promise { let allSystemsHaveType = true; diff --git a/packages/store/src/data-provider/index.ts b/packages/store/src/data-provider/index.ts index c5a69614679..4d5d2c67fa7 100644 --- a/packages/store/src/data-provider/index.ts +++ b/packages/store/src/data-provider/index.ts @@ -8,13 +8,23 @@ import type { ServiceOptions } from '../types'; * could be written to the filesystem/OS secure store/network share, the client does not need to know this. */ export interface DataProvider { + /** + * + */ read(key: K): Promise; + /** + * + */ write(entity: E): Promise; + /** + * + */ delete(entity: E): Promise; /** * Returns the data as an array related to the entity. * - * @param includeSensitiveData If true and relevant for the entity, sensitive data will be returned - defaults to true. + * @param options If true and relevant for the entity, sensitive data will be returned - defaults to true. + * @param options.includeSensitiveData If set to true, sensitive data will be included in the result. */ getAll(options?: { includeSensitiveData?: boolean }): Promise; } diff --git a/packages/store/src/data-provider/system-migration.ts b/packages/store/src/data-provider/system-migration.ts index 6170713adfd..ac8b66a0391 100644 --- a/packages/store/src/data-provider/system-migration.ts +++ b/packages/store/src/data-provider/system-migration.ts @@ -14,15 +14,27 @@ export const SystemMigrationStatusDataProvider: DataProviderConstructor< private readonly entityName = Entities.SystemMigrationStatus; private readonly logger: Logger; + /** + * + * @param logger + */ constructor(logger: Logger) { this.logger = logger; this.dataAccessor = getFilesystemStore(this.logger); } + /** + * + * @param key + */ public read(key: SystemMigrationStatusKey): Promise { return this.dataAccessor.read({ entityName: this.entityName, id: key.getId() }); } + /** + * + * @param entity + */ public write(entity: SystemMigrationStatus): Promise { return this.dataAccessor.write({ entityName: this.entityName, @@ -31,6 +43,10 @@ export const SystemMigrationStatusDataProvider: DataProviderConstructor< }); } + /** + * + * @param _entity + */ public delete(_entity: SystemMigrationStatus): Promise { return this.dataAccessor.del({ entityName: this.entityName, @@ -38,6 +54,9 @@ export const SystemMigrationStatusDataProvider: DataProviderConstructor< }); } + /** + * + */ public getAll(): Promise { return this.dataAccessor.getAll({ entityName: this.entityName }); } diff --git a/packages/store/src/data-provider/telemetry-setting.ts b/packages/store/src/data-provider/telemetry-setting.ts index 07f2c608c4e..5f354407460 100644 --- a/packages/store/src/data-provider/telemetry-setting.ts +++ b/packages/store/src/data-provider/telemetry-setting.ts @@ -13,15 +13,27 @@ export const TelemetryDataProvider: DataProviderConstructor { return this.dataAccessor.read({ entityName: this.entityName, id: key.getId() }); } + /** + * + * @param entity + */ public write(entity: TelemetrySetting): Promise { return this.dataAccessor.write({ entityName: this.entityName, @@ -30,6 +42,10 @@ export const TelemetryDataProvider: DataProviderConstructor { return this.dataAccessor.del({ entityName: this.entityName, @@ -37,6 +53,9 @@ export const TelemetryDataProvider: DataProviderConstructor { return this.dataAccessor.getAll({ entityName: this.entityName }); } diff --git a/packages/store/src/decorators/index.ts b/packages/store/src/decorators/index.ts index aeeb24408f5..625e807684e 100644 --- a/packages/store/src/decorators/index.ts +++ b/packages/store/src/decorators/index.ts @@ -2,11 +2,20 @@ import 'reflect-metadata'; const SERIALIZABLE = Symbol('serializable'); +/** + * + * @param target + * @param key + */ export function serializable(target: T, key: string): void { const serializableProperties: Set = Reflect.getOwnMetadata(SERIALIZABLE, target.constructor) || new Set(); Reflect.defineMetadata(SERIALIZABLE, serializableProperties.add(key), target.constructor); } +/** + * + * @param target + */ export function getSerializableProperties(target: T): Array { const props: Set = Reflect.getOwnMetadata(SERIALIZABLE, target.constructor); return (props && Array.from(props.values())) || []; @@ -14,11 +23,20 @@ export function getSerializableProperties(target: T): Array(target: T, key: string): void { const sensitiveProperties: Set = Reflect.getOwnMetadata(SENSITIVE, target.constructor) || new Set(); Reflect.defineMetadata(SENSITIVE, sensitiveProperties.add(key), target.constructor); } +/** + * + * @param target + */ export function getSensitiveDataProperties(target: T): Array { const props: Set = Reflect.getOwnMetadata(SENSITIVE, target.constructor); return (props && Array.from(props.values())) || []; diff --git a/packages/store/src/entities/api-hub.ts b/packages/store/src/entities/api-hub.ts index 770075c2705..61dce22bfd6 100644 --- a/packages/store/src/entities/api-hub.ts +++ b/packages/store/src/entities/api-hub.ts @@ -1,17 +1,31 @@ import type { EntityKey } from '.'; import { sensitiveData } from '../decorators'; +/** + * + */ export class ApiHubSettings { @sensitiveData public readonly apiKey?: string; + /** + * + * @param root0 + * @param root0.apiKey + */ constructor({ apiKey }: { apiKey: string }) { this.apiKey = apiKey; } } +/** + * + */ export class ApiHubSettingsKey implements EntityKey { static SINGLETON: string = 'API_HUB_API_KEY'; + /** + * + */ public getId(): string { return ApiHubSettingsKey.SINGLETON; } diff --git a/packages/store/src/entities/backend-system.ts b/packages/store/src/entities/backend-system.ts index 68d632623eb..f24a42af788 100644 --- a/packages/store/src/entities/backend-system.ts +++ b/packages/store/src/entities/backend-system.ts @@ -10,6 +10,9 @@ export const AuthenticationType = { export type AuthenticationType = (typeof AuthenticationType)[keyof typeof AuthenticationType]; +/** + * + */ export class BackendSystem { @serializable public readonly name: string; @serializable public readonly url: string; @@ -22,6 +25,20 @@ export class BackendSystem { @sensitiveData public readonly password?: string; @sensitiveData public readonly authenticationType?: string; + /** + * + * @param root0 + * @param root0.name + * @param root0.url + * @param root0.client + * @param root0.serviceKeys + * @param root0.refreshToken + * @param root0.username + * @param root0.password + * @param root0.userDisplayName + * @param root0.authenticationType + * @param root0.systemType + */ constructor({ name, url, @@ -57,19 +74,35 @@ export class BackendSystem { this.authenticationType = authenticationType; } } +/** + * + */ export class BackendSystemKey implements EntityKey { private url: string; private client?: string; + /** + * + * @param system + */ public static from(system: BackendSystem): BackendSystemKey { return new BackendSystemKey({ url: system.url, client: system.client }); } + /** + * + * @param root0 + * @param root0.url + * @param root0.client + */ constructor({ url, client }: { url: string; client?: string }) { this.url = url.trim().replace(/\/$/, ''); this.client = client?.trim(); } + /** + * + */ public getId(): string { return this.url + `${this.client ? '/' + this.client : ''}`; } diff --git a/packages/store/src/entities/system-migration-status.ts b/packages/store/src/entities/system-migration-status.ts index 0fffb94efa9..1a0eaa72223 100644 --- a/packages/store/src/entities/system-migration-status.ts +++ b/packages/store/src/entities/system-migration-status.ts @@ -1,7 +1,8 @@ import type { EntityKey } from '.'; import { serializable } from '../decorators'; -/** This represents the migration status of the systems from pure secure store +/** + * This represents the migration status of the systems from pure secure store * the hybrid filesystem/secure store */ export class SystemMigrationStatus { @@ -9,6 +10,13 @@ export class SystemMigrationStatus { @serializable public readonly authTypeMigrated: boolean; @serializable public readonly migrationLogs: string[]; + /** + * + * @param root0 + * @param root0.authTypeMigrated + * @param root0.migrationDone + * @param root0.migrationLogs + */ constructor({ authTypeMigrated, migrationDone, @@ -24,7 +32,13 @@ export class SystemMigrationStatus { } } +/** + * + */ export class SystemMigrationStatusKey implements EntityKey { + /** + * + */ public getId(): string { return 'systemMigration'; // A singleton } diff --git a/packages/store/src/entities/telemetry-setting.ts b/packages/store/src/entities/telemetry-setting.ts index edaefffd963..3e70a997501 100644 --- a/packages/store/src/entities/telemetry-setting.ts +++ b/packages/store/src/entities/telemetry-setting.ts @@ -8,12 +8,23 @@ import { serializable } from '../decorators'; export class TelemetrySetting { @serializable public readonly enableTelemetry: boolean; + /** + * + * @param root0 + * @param root0.enableTelemetry + */ constructor({ enableTelemetry }: { enableTelemetry: boolean }) { this.enableTelemetry = enableTelemetry; } } +/** + * + */ export class TelemetrySettingKey implements EntityKey { + /** + * + */ public getId(): string { return 'telemetrySetting'; // A singleton } diff --git a/packages/store/src/i18n.ts b/packages/store/src/i18n.ts index ce1826a79e6..e24e4b96020 100644 --- a/packages/store/src/i18n.ts +++ b/packages/store/src/i18n.ts @@ -23,6 +23,11 @@ export async function initI18n(): Promise { } type StringMap = { [key: string]: unknown }; +/** + * + * @param key + * @param options + */ export function text(key: string, options?: string | TOptions): string { return i18nInstance.t(key, typeof options === 'string' ? { defaultValue: options } : options); } diff --git a/packages/store/src/index.ts b/packages/store/src/index.ts index 35f791b8b21..2cb0c653b32 100644 --- a/packages/store/src/index.ts +++ b/packages/store/src/index.ts @@ -18,6 +18,13 @@ const services: { 'api-hub': getApiHubSettingsService }; +/** + * + * @param root0 + * @param root0.logger + * @param root0.entityName + * @param root0.options + */ export async function getService({ logger = getDefaultLogger(), entityName, diff --git a/packages/store/src/secure-store/dummy-store.ts b/packages/store/src/secure-store/dummy-store.ts index 9e19a742138..97ef4ce8a5f 100644 --- a/packages/store/src/secure-store/dummy-store.ts +++ b/packages/store/src/secure-store/dummy-store.ts @@ -1,28 +1,55 @@ import type { SecureStore } from './types'; import type { Logger } from '@sap-ux/logger'; +/** + * + */ export class DummyStore implements SecureStore { private readonly log: Logger; + /** + * + * @param log + */ constructor(log: Logger) { this.log = log; } + /** + * + * @param service + * @param key + * @param _value + */ public async save(service: string, key: string, _value: T): Promise { this.log.warn(`Dummy store. Trying to save for service: ${service}, key: ${key}`); return Promise.resolve(true); } + /** + * + * @param service + * @param key + */ public async retrieve(service: string, key: string): Promise { this.log.warn(`Dummy store. Trying to retrieve for service: ${service}, key: ${key}`); return Promise.resolve(undefined); } + /** + * + * @param service + * @param key + */ public async delete(service: string, key: string): Promise { this.log.warn(`Dummy store. Trying to delete for service: ${service}, key: ${key}`); return Promise.resolve(true); } + /** + * + * @param service + */ public async getAll(service: string): Promise<{ [key: string]: T }> { this.log.warn(`Dummy store. Trying to get all values for service: [${service}]`); return Promise.resolve({}); diff --git a/packages/store/src/secure-store/index.ts b/packages/store/src/secure-store/index.ts index 72f98b5307a..9ecc2711938 100644 --- a/packages/store/src/secure-store/index.ts +++ b/packages/store/src/secure-store/index.ts @@ -62,7 +62,8 @@ function loadZoweSecretSdk(log: Logger): typeof zoweKeyring | undefined { log.info(`Attempting to load Zowe secrets SDK from: ${path}`); return typeof __non_webpack_require__ === 'function' ? __non_webpack_require__(path) - : require(path); + : // eslint-disable-next-line @typescript-eslint/no-require-imports + require(path); } catch (fallbackError) { log.warn(`Failed to load Zowe secrets SDK from ${path}: ${errorString(fallbackError)}`); } diff --git a/packages/store/src/secure-store/key-store.ts b/packages/store/src/secure-store/key-store.ts index 0a993fce3e1..c23dae28be6 100644 --- a/packages/store/src/secure-store/key-store.ts +++ b/packages/store/src/secure-store/key-store.ts @@ -4,10 +4,18 @@ import type { SecureStore } from './types'; import type { keyring } from '@zowe/secrets-for-zowe-sdk'; type Entities = { [key: string]: T }; +/** + * + */ export class KeyStoreManager implements SecureStore { private readonly log: Logger; private readonly keyring: typeof keyring; + /** + * + * @param log + * @param zoweSecretSdk + */ constructor(log: Logger, zoweSecretSdk: typeof keyring) { this.log = log; this.keyring = zoweSecretSdk; @@ -15,6 +23,8 @@ export class KeyStoreManager implements SecureStore { /** * Helper function for serializing objects + * + * @param value */ private serialize(value: T): string { try { @@ -26,6 +36,8 @@ export class KeyStoreManager implements SecureStore { /** * Helper function for deserializing objects + * + * @param serialized */ private deserialize(serialized: string): T { try { @@ -37,6 +49,9 @@ export class KeyStoreManager implements SecureStore { /** * Validate input parameters for service and key + * + * @param service + * @param key */ private validateInput(service: string, key: string): boolean { if (!service || !key) { @@ -48,6 +63,10 @@ export class KeyStoreManager implements SecureStore { /** * Save credentials to the keyring + * + * @param service + * @param key + * @param value */ public async save(service: string, key: string, value: T): Promise { if (!this.validateInput(service, key)) { @@ -67,6 +86,9 @@ export class KeyStoreManager implements SecureStore { /** * Retrieve credentials from the keyring + * + * @param service + * @param key */ public async retrieve(service: string, key: string): Promise { if (!this.validateInput(service, key)) { @@ -97,6 +119,9 @@ export class KeyStoreManager implements SecureStore { /** * Delete credentials from the keyring + * + * @param service + * @param key */ public async delete(service: string, key: string): Promise { if (!this.validateInput(service, key)) { @@ -121,6 +146,8 @@ export class KeyStoreManager implements SecureStore { /** * Retrieve all credentials for a given service + * + * @param service */ public async getAll(service: string): Promise> { const results: Entities = {}; diff --git a/packages/store/src/secure-store/types.ts b/packages/store/src/secure-store/types.ts index 1f7cb3116e9..be82794a2b0 100644 --- a/packages/store/src/secure-store/types.ts +++ b/packages/store/src/secure-store/types.ts @@ -1,5 +1,6 @@ export interface SecureStore { - /** Save a value in the secure store. Can overwrite previous values + /** + * Save a value in the secure store. Can overwrite previous values * * Returns `true` if successful, `false` if not */ @@ -8,13 +9,16 @@ export interface SecureStore { /** Retrieves a previous stored key. Returns undefined if not found */ retrieve(service: string, key: string): Promise; - /** Delete a previously stored key. + /** + * Delete a previously stored key. * * Returns `true` if successful, `false` if not - * */ + */ delete(service: string, key: string): Promise; - /** Get all the values stored for the service + /** + * Get all the values stored for the service + * * @param service */ getAll(service: string): Promise<{ [key: string]: T }>; diff --git a/packages/store/src/services/api-hub/migration.ts b/packages/store/src/services/api-hub/migration.ts index a9bafa868c5..4ace3787ca8 100644 --- a/packages/store/src/services/api-hub/migration.ts +++ b/packages/store/src/services/api-hub/migration.ts @@ -9,6 +9,11 @@ export const LEGACY_API_HUB_API_KEY = 'API_HUB_API_KEY'; /** * Do NOT export to the outside world + * + * @param root0 + * @param root0.dataProvider + * @param root0.secureStore + * @param root0.logger */ export async function migrateToLatestVersion({ dataProvider, diff --git a/packages/store/src/services/api-hub/service.ts b/packages/store/src/services/api-hub/service.ts index 32158f5013d..3077141665a 100644 --- a/packages/store/src/services/api-hub/service.ts +++ b/packages/store/src/services/api-hub/service.ts @@ -8,6 +8,9 @@ import type { ApiHubSettings } from '../../entities/api-hub'; import { ApiHubSettingsKey } from '../../entities/api-hub'; import { migrateToLatestVersion } from './migration'; +/** + * + */ export class ApiHubSettingsService implements Service { private readonly dataProvider: DataProvider; private readonly logger: Logger; @@ -15,6 +18,10 @@ export class ApiHubSettingsService implements Service { await this.migrate(); return this.dataProvider.read(this.key); } + /** + * + * @param entity + */ public async write(entity: ApiHubSettings): Promise { await this.migrate(); return this.dataProvider.write(entity); } + /** + * + * @param entity + */ public async delete(entity: ApiHubSettings): Promise { await this.migrate(); return this.dataProvider.delete(entity); } + /** + * + */ public async getAll(): Promise { await this.migrate(); return this.dataProvider.getAll(); } } +/** + * + * @param logger + */ export function getInstance(logger: Logger): ApiHubSettingsService { return new ApiHubSettingsService(logger); } diff --git a/packages/store/src/services/backend-system.ts b/packages/store/src/services/backend-system.ts index b741f98370d..a04151325d5 100644 --- a/packages/store/src/services/backend-system.ts +++ b/packages/store/src/services/backend-system.ts @@ -6,14 +6,27 @@ import { BackendSystem, BackendSystemKey } from '../entities/backend-system'; import { text } from '../i18n'; import type { ServiceOptions } from '../types'; +/** + * + */ export class SystemService implements Service { private readonly dataProvider: DataProvider; private readonly logger: Logger; + /** + * + * @param logger + * @param options + */ constructor(logger: Logger, options: ServiceOptions = {}) { this.logger = logger; this.dataProvider = new SystemDataProvider(this.logger, options); } + /** + * + * @param key + * @param entity + */ public async partialUpdate( key: BackendSystemKey, entity: Partial @@ -26,6 +39,11 @@ export class SystemService implements Service { }); } + /** + * + * @param update + * @param existingSystem + */ private mergeProperties(update: Partial, existingSystem: BackendSystem): BackendSystem { const patch = { ...update }; // Make sure we don't mess with key fields @@ -35,6 +53,10 @@ export class SystemService implements Service { return new BackendSystem({ ...updatedEntity }); } + /** + * + * @param key + */ private async readOrThrow(key: BackendSystemKey): Promise { const existingSystem = await this.read(key); if (!existingSystem) { @@ -43,12 +65,20 @@ export class SystemService implements Service { return existingSystem; } + /** + * + * @param entity + */ private validatePartialUpdateInput(entity: Partial): void { if (!entity || !Object.keys(entity).length) { throw new Error(text('error.noPropertiesSpecified')); } } + /** + * + * @param key + */ public async read(key: BackendSystemKey): Promise { return this.dataProvider.read(key); } @@ -72,14 +102,27 @@ export class SystemService implements Service { } return this.dataProvider.write(entity); } + /** + * + * @param entity + */ public async delete(entity: BackendSystem): Promise { return this.dataProvider.delete(entity); } + /** + * + * @param options + */ public async getAll(options: ServiceRetrievalOptions): Promise { return this.dataProvider.getAll(options); } } +/** + * + * @param logger + * @param options + */ export function getInstance(logger: Logger, options: ServiceOptions = {}): SystemService { return new SystemService(logger, options); } diff --git a/packages/store/src/services/index.ts b/packages/store/src/services/index.ts index 5c92742d2e3..bf86d66a9ca 100644 --- a/packages/store/src/services/index.ts +++ b/packages/store/src/services/index.ts @@ -7,10 +7,25 @@ export interface ServiceRetrievalOptions { * auxillary functions (migration/logging/authorization, etc) */ export interface Service { + /** + * + */ read(key: EntityKey): Promise; + /** + * + */ write(entity: Entity, options?: unknown): Promise; + /** + * + */ partialUpdate(key: EntityKey, entity: Partial): Promise; + /** + * + */ delete(entity: Entity): Promise; + /** + * + */ getAll(options?: ServiceRetrievalOptions): Promise; } diff --git a/packages/store/src/services/telemetry-setting.ts b/packages/store/src/services/telemetry-setting.ts index 3078c98f098..bf81cce1a5f 100644 --- a/packages/store/src/services/telemetry-setting.ts +++ b/packages/store/src/services/telemetry-setting.ts @@ -4,10 +4,17 @@ import type { DataProvider } from '../data-provider'; import { TelemetryDataProvider } from '../data-provider/telemetry-setting'; import type { TelemetrySetting, TelemetrySettingKey } from '../entities/telemetry-setting'; +/** + * + */ export class TelemetrySettingService implements Service { private readonly dataProvider: DataProvider; private readonly logger: Logger; + /** + * + * @param logger + */ constructor(logger: Logger) { this.logger = logger; this.dataProvider = new TelemetryDataProvider(this.logger); @@ -17,20 +24,39 @@ export class TelemetrySettingService implements Service { return this.dataProvider.read(key); } + /** + * + * @param entity + */ public async write(entity: TelemetrySetting): Promise { return this.dataProvider.write(entity); } + /** + * + * @param entity + */ public async delete(entity: TelemetrySetting): Promise { return this.dataProvider.delete(entity); } + /** + * + */ public async getAll(): Promise { return this.dataProvider.getAll(); } } +/** + * + * @param logger + */ export function getInstance(logger: Logger): TelemetrySettingService { return new TelemetrySettingService(logger); } diff --git a/packages/store/src/types.ts b/packages/store/src/types.ts index a071a5cbf59..72e4d857f56 100644 --- a/packages/store/src/types.ts +++ b/packages/store/src/types.ts @@ -1,6 +1,8 @@ export interface ServiceOptions { - /** optional `baseDirectory`. Can be an absolute or a relative path. - * Relative paths will be assumed to start in the user's home directory */ + /** + * optional `baseDirectory`. Can be an absolute or a relative path. + * Relative paths will be assumed to start in the user's home directory + */ baseDirectory?: string; [key: string]: unknown; } diff --git a/packages/store/src/utils/app-studio.ts b/packages/store/src/utils/app-studio.ts index 2b94ee11f0a..449fe5aa2f2 100644 --- a/packages/store/src/utils/app-studio.ts +++ b/packages/store/src/utils/app-studio.ts @@ -1,7 +1,4 @@ -/** - * @todo: This needs to be replaced by the functions from `@sap-ux/btp-utils` - */ - +// todo: This needs to be replaced by the functions from `@sap-ux/btp-utils` /** * Enumeration of environment variables used in AppStudio */ @@ -10,6 +7,9 @@ export enum ENV { H2O_URL = 'H2O_URL' } +/** + * + */ export function isAppStudio(): boolean { return !!process.env[ENV.H2O_URL]; } diff --git a/packages/store/src/utils/index.ts b/packages/store/src/utils/index.ts index 737ee68b076..5f01d7dec54 100644 --- a/packages/store/src/utils/index.ts +++ b/packages/store/src/utils/index.ts @@ -1,7 +1,12 @@ import { homedir } from 'node:os'; import path from 'node:path'; -/** Pick the properties listed and return a new object with a shallow-copy */ +/** + * Pick the properties listed and return a new object with a shallow-copy + * + * @param target + * @param {...any} props + */ export const pick = (target: T, ...props: Array): Partial | undefined => { return ( (target && @@ -14,7 +19,11 @@ export const pick = (target: T, ...props: Array): Partial | undef ); }; -/** Given an `Error` or any other object thrown, returns an `Error` instance */ +/** + * Given an `Error` or any other object thrown, returns an `Error` instance + * + * @param e + */ export function errorInstance(e: Error | unknown): NodeJS.ErrnoException { if (e instanceof Error) { return e; @@ -23,8 +32,11 @@ export function errorInstance(e: Error | unknown): NodeJS.ErrnoException { } } -/** If input in an instance of `Error` return the message property, - * otherwise convert the input to its string representation +/** + * If input in an instance of `Error` return the message property, + * otherwise convert the input to its string representation + * + * @param e */ export function errorString(e: Error | unknown): string { return e instanceof Error ? e.message : String(e); diff --git a/packages/store/test/unit/data-access/filesystem.test.ts b/packages/store/test/unit/data-access/filesystem.test.ts index 48124e524f8..f6f962d4223 100644 --- a/packages/store/test/unit/data-access/filesystem.test.ts +++ b/packages/store/test/unit/data-access/filesystem.test.ts @@ -8,6 +8,7 @@ import type { Entity } from '../../../src'; import { ToolsLogger, NullTransport } from '@sap-ux/logger'; jest.mock('fs', () => { + // eslint-disable-next-line @typescript-eslint/no-require-imports return require('memfs'); }); diff --git a/packages/store/test/unit/secure-store/key-store.test.ts b/packages/store/test/unit/secure-store/key-store.test.ts index 801bc4b20f8..d660f8e974d 100644 --- a/packages/store/test/unit/secure-store/key-store.test.ts +++ b/packages/store/test/unit/secure-store/key-store.test.ts @@ -1,7 +1,6 @@ import { KeyStoreManager } from '../../../src/secure-store/key-store'; import { keyring } from '@zowe/secrets-for-zowe-sdk'; import type { Logger } from '@sap-ux/logger'; -import { keyring as zoweKeyring } from '@zowe/secrets-for-zowe-sdk'; jest.mock('@sap-ux/logger', () => ({ Logger: class { @@ -23,7 +22,7 @@ describe('KeyStoreManager', () => { beforeEach(() => { jest.resetModules(); jest.clearAllMocks(); - keyStoreManager = new KeyStoreManager(log, zoweKeyring); + keyStoreManager = new KeyStoreManager(log, keyring); }); afterAll(async () => { diff --git a/packages/store/tsconfig.eslint.json b/packages/store/tsconfig.eslint.json index d5f1aa34747..af8608fd8d9 100644 --- a/packages/store/tsconfig.eslint.json +++ b/packages/store/tsconfig.eslint.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", - "include": ["src", "test", ".eslintrc.js"] + "include": ["src", "test", ".eslintrc.js", "test/manual/system.js"] } diff --git a/packages/system-access/.eslintignore b/packages/system-access/.eslintignore deleted file mode 100644 index cc1f8e004cc..00000000000 --- a/packages/system-access/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test/fixtures -dist diff --git a/packages/system-access/.eslintrc.js b/packages/system-access/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/system-access/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/system-access/eslint.config.js b/packages/system-access/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/system-access/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/telemetry/.eslintignore b/packages/telemetry/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/telemetry/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/telemetry/.eslintrc.js b/packages/telemetry/.eslintrc.js deleted file mode 100644 index 1313f241bb4..00000000000 --- a/packages/telemetry/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - "@typescript-eslint/ban-ts-comment": "off" - } -}; diff --git a/packages/telemetry/eslint.config.js b/packages/telemetry/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/telemetry/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/telemetry/src/base/config-state.ts b/packages/telemetry/src/base/config-state.ts index ea0713fe316..67afe7a5126 100644 --- a/packages/telemetry/src/base/config-state.ts +++ b/packages/telemetry/src/base/config-state.ts @@ -1,4 +1,3 @@ -// @ts-ignore import packageJson from '../../package.json'; /** diff --git a/packages/telemetry/src/base/interceptor/index.ts b/packages/telemetry/src/base/interceptor/index.ts index 2d285788073..127fdd95e29 100644 --- a/packages/telemetry/src/base/interceptor/index.ts +++ b/packages/telemetry/src/base/interceptor/index.ts @@ -42,7 +42,6 @@ export const duration = ( evtName: EventName, sampleRate: SampleRate ): Function => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any return (...args: any[]): Function => { const markName = performance.startMark('mark'); const result = originalFn.apply(target, args); @@ -62,7 +61,6 @@ export const durationAsync = ( evtName: EventName, sampleRate: SampleRate ): Function => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any return async (...args: any[]): Promise => { const markName = performance.startMark('mark'); const result = await originalFn.apply(target, args); @@ -83,7 +81,6 @@ export const captureParam = ( sampleRate: SampleRate, instructions: ParamRecordConfig | ParamRecordConfig[] ): Function => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any return (...args: any[]): Function => { const result = originalFn.apply(target, args); const [customDimensions, customMeasurements] = getParamsData(args, instructions); @@ -101,7 +98,6 @@ export const captureParamAsync = ( sampleRate: SampleRate, instructions: ParamRecordConfig | ParamRecordConfig[] ): Function => { - // eslint-disable-next-line @typescript-eslint/no-explicit-any return async (...args: any[]): Promise => { const result = await originalFn.apply(target, args); const [customDimensions, customMeasurements] = getParamsData(args, instructions); diff --git a/packages/telemetry/src/base/performance/entries.ts b/packages/telemetry/src/base/performance/entries.ts index 47752150c5c..80b668dd73d 100644 --- a/packages/telemetry/src/base/performance/entries.ts +++ b/packages/telemetry/src/base/performance/entries.ts @@ -22,7 +22,11 @@ class Mark implements IMark { * @param type Mark type * @param startTime start time in millieseconds */ - constructor(name: string, type: EntryType, readonly startTime: number) { + constructor( + name: string, + type: EntryType, + readonly startTime: number + ) { this.name = name; this.startTime = startTime; this.type = type; @@ -39,7 +43,11 @@ class Measurement extends Mark implements IMeasurement { * @param startTime start time in millieseconds * @param duration time in millieseconds */ - constructor(name: string, readonly startTime: number, readonly duration: number) { + constructor( + name: string, + readonly startTime: number, + readonly duration: number + ) { super(name, EntryType.MEASUREMENT, startTime); this.duration = duration; } diff --git a/packages/telemetry/src/base/utils/param-processing.ts b/packages/telemetry/src/base/utils/param-processing.ts index 224db0af6d5..c72782a482f 100644 --- a/packages/telemetry/src/base/utils/param-processing.ts +++ b/packages/telemetry/src/base/utils/param-processing.ts @@ -52,7 +52,6 @@ export class ParamRecordConfig { export const wrongPathErr = (field: string, index: number): Error => new Error(`Wrong path for '${field}' field is specified in instructions with index - ${index}`); -// eslint-disable-next-line @typescript-eslint/no-explicit-any export const getValue = (obj: any, path: string, field: string, paramIndex: number): number | string => { const pathArr: string[] = path.split('/'); @@ -69,12 +68,11 @@ export const getValue = (obj: any, path: string, field: string, paramIndex: numb return node; }; -// eslint-disable-next-line @typescript-eslint/no-explicit-any export const paramsProcessing = (params: any, instructions: ParamRecordConfig): [dimensions, measurements] => { const processedDimensions: dimensions = {}; const processedMeasurements: measurements = {}; - let param: any = null; // eslint-disable-line @typescript-eslint/no-explicit-any + let param: any = null; if (instructions.paramIndex !== undefined) { param = params[instructions.paramIndex]; } @@ -100,7 +98,7 @@ export const paramsProcessing = (params: any, instructions: ParamRecordConfig): }; export const getParamsData = ( - params: any, // eslint-disable-line @typescript-eslint/no-explicit-any + params: any, instructions: ParamRecordConfig[] | ParamRecordConfig ): [dimensions, measurements] => { let processedDimensions, processedMeasurements; diff --git a/packages/telemetry/test/jest.setup.ts b/packages/telemetry/test/jest.setup.ts index 6766ab2752d..896f6b8b09f 100644 --- a/packages/telemetry/test/jest.setup.ts +++ b/packages/telemetry/test/jest.setup.ts @@ -4,4 +4,4 @@ * module imports with the vscode extension instance from the test runner's * environment. */ -jest.mock('vscode', () => (global as any).vscode, { virtual: true }); // eslint-disable-line @typescript-eslint/no-explicit-any +jest.mock('vscode', () => (global as any).vscode, { virtual: true }); diff --git a/packages/telemetry/test/telemetrySettings/init-settings.test.ts b/packages/telemetry/test/telemetrySettings/init-settings.test.ts index 9c7df252b87..b4730eb24d4 100644 --- a/packages/telemetry/test/telemetrySettings/init-settings.test.ts +++ b/packages/telemetry/test/telemetrySettings/init-settings.test.ts @@ -6,7 +6,6 @@ import * as storeMock from '@sap-ux/store'; const isAppStudioMock = jest.fn(); jest.mock('@sap-ux/btp-utils', () => { return { - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/btp-utils') as {}), isAppStudio: (): boolean => isAppStudioMock() }; diff --git a/packages/telemetry/test/tools-suite-telemetry/index.test.ts b/packages/telemetry/test/tools-suite-telemetry/index.test.ts index 332caee9e8c..7a4ddc7f546 100644 --- a/packages/telemetry/test/tools-suite-telemetry/index.test.ts +++ b/packages/telemetry/test/tools-suite-telemetry/index.test.ts @@ -8,9 +8,9 @@ import { CommandRunner } from '@sap-ux/nodejs-utils'; jest.mock('fs', () => { const fs1 = jest.requireActual('fs'); - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const Union = require('unionfs').Union; - // eslint-disable-next-line @typescript-eslint/no-var-requires + // eslint-disable-next-line @typescript-eslint/no-require-imports const vol = require('memfs').vol; const memfs = new Union().use(fs1).use(vol as unknown as typeof fs); memfs.realpath = fs1.realpath; diff --git a/packages/telemetry/test/util/paramProcessing.test.ts b/packages/telemetry/test/util/paramProcessing.test.ts index 2e8423c5f7e..bad8b9c4552 100644 --- a/packages/telemetry/test/util/paramProcessing.test.ts +++ b/packages/telemetry/test/util/paramProcessing.test.ts @@ -30,12 +30,12 @@ describe('Parameter processing Tests', () => { test('getValue returns correct value', () => { let path = 'path/to/value'; let result = getValue(mockParams[0], path, 'test', 0); - let expected = (mockParams[0] as any).path.to.value; // eslint-disable-line @typescript-eslint/no-explicit-any + let expected = (mockParams[0] as any).path.to.value; expect(result).toEqual(expected); path = 'path/to'; result = getValue(mockParams[0], path, 'test', 0); - expected = (mockParams[0] as any).path.to; // eslint-disable-line @typescript-eslint/no-explicit-any + expected = (mockParams[0] as any).path.to; expect(result).toEqual(expected); }); diff --git a/packages/text-document-utils/.eslintignore b/packages/text-document-utils/.eslintignore deleted file mode 100644 index 53c37a16608..00000000000 --- a/packages/text-document-utils/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -dist \ No newline at end of file diff --git a/packages/text-document-utils/.eslintrc.js b/packages/text-document-utils/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/text-document-utils/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/text-document-utils/eslint.config.js b/packages/text-document-utils/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/text-document-utils/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui-components/.eslintignore b/packages/ui-components/.eslintignore deleted file mode 100644 index 017cd8bbd3a..00000000000 --- a/packages/ui-components/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -stories diff --git a/packages/ui-components/.eslintrc.js b/packages/ui-components/.eslintrc.js deleted file mode 100644 index 3a82a63cdb8..00000000000 --- a/packages/ui-components/.eslintrc.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc', 'plugin:react/recommended', 'plugin:storybook/recommended'], - parserOptions: { - 'EXPERIMENTAL_useSourceOfProjectReferenceRedirect': true, - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - overrides: [ - { - 'parser': '@typescript-eslint/parser', - 'files': ['./test/**/*.tsx'], - 'rules': { - 'no-loop-func': 'off' - } - }, - { - 'parser': '@typescript-eslint/parser', - 'files': ['./src/**/*.tsx'], - 'rules': { - '@typescript-eslint/no-unused-vars': [ - 'error', - { 'varsIgnorePattern': '^_', 'argsIgnorePattern': '^_', 'ignoreRestSiblings': true } - ] - } - } - ], - rules: { - 'react/no-unknown-property': ['error', { 'ignore': ['onFocusCapture'] }], - 'jsdoc/require-param-description': 'off', - 'jsdoc/require-returns-description': 'off', - 'jsdoc/no-undefined-types': 'off' - }, - settings: { - 'react': { - 'version': 'detect' - } - } -}; diff --git a/packages/ui-components/eslint.config.js b/packages/ui-components/eslint.config.js new file mode 100644 index 00000000000..43f1a5831d7 --- /dev/null +++ b/packages/ui-components/eslint.config.js @@ -0,0 +1,52 @@ +const base = require('../../eslint.config.js'); +const reactPlugin = require('eslint-plugin-react'); +const globals = require('globals'); +const storybook = require('eslint-plugin-storybook/dist/configs/flat/recommended'); + +module.exports = [ + { ignores: ['stories', 'storybook', 'test'] }, + ...base, + reactPlugin.configs.flat.recommended, + ...storybook, + { + ignores: ['stories', './test/**/*.tsx'], + plugins: { + reactPlugin + }, + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigRootDir: __dirname + }, + globals: { + ...globals.browser + } + }, + rules: { + 'react/no-unknown-property': ['error', { 'ignore': ['onFocusCapture'] }], + 'jsdoc/require-param-description': 'off', + 'jsdoc/require-returns-description': 'off', + 'jsdoc/no-undefined-types': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { 'varsIgnorePattern': '^_', 'argsIgnorePattern': '^_', 'ignoreRestSiblings': true } + ] + }, + settings: { + 'react': { + 'version': 'detect' + } + } + }, + { + languageOptions: { + 'parser': '@typescript-eslint/parser', + project: './tsconfig.eslint.json', + tsconfigRootDir: __dirname + }, + files: ['./test/**/*.tsx'], + rules: { + 'no-loop-func': 'off' + } + } +]; diff --git a/packages/ui-components/package.json b/packages/ui-components/package.json index 07f364d27a9..bfe5fb7d289 100644 --- a/packages/ui-components/package.json +++ b/packages/ui-components/package.json @@ -23,7 +23,7 @@ "build": "npm-run-all -l -p build:extension build:copyfiles build:storybook", "build:extension": "tsc --build --pretty", "build:copyfiles": "copyfiles --up 1 \"./src/**/*.scss\" ./dist/", - "lint": "eslint . --ext .ts,.tsx", + "lint": "eslint . ", "lint:fix": "eslint . --ext .ts,.tsx --fix", "format:fix": "prettier --write --ignore-path ../../.prettierignore", "format:fix:all": "prettier --write '**/*.{css,scss,html,js,json,ts,tsx,yaml,yml}' '!**/{out,dist,typings,node_modules}/**' '!**/*.{svg,png,xml}' --ignore-path ../../.prettierignore", @@ -67,7 +67,8 @@ "css-loader": "6.8.1", "enzyme": "3.11.0", "enzyme-adapter-react-16": "1.15.7", - "eslint-plugin-react": "7.33.2", + "eslint": "9.29.0", + "eslint-plugin-react": "7.37.4", "eslint-plugin-storybook": "0.6.15", "jest-environment-jsdom": "29.7.0", "jest-scss-transform": "1.0.4", diff --git a/packages/ui-components/src/components/UIActionCallout/UIActionCallout.tsx b/packages/ui-components/src/components/UIActionCallout/UIActionCallout.tsx index a60cf55d79c..1e24634a8a5 100644 --- a/packages/ui-components/src/components/UIActionCallout/UIActionCallout.tsx +++ b/packages/ui-components/src/components/UIActionCallout/UIActionCallout.tsx @@ -33,7 +33,7 @@ export interface IActionCalloutDetail { */ command?: { id: string; - params: Object | string; + params: object | string; }; /** * A http url string, command takes precedence if provided diff --git a/packages/ui-components/src/components/UIQuickNavigation/UIQuickNavigation.tsx b/packages/ui-components/src/components/UIQuickNavigation/UIQuickNavigation.tsx index 2352e6a41e7..6a25555b82a 100644 --- a/packages/ui-components/src/components/UIQuickNavigation/UIQuickNavigation.tsx +++ b/packages/ui-components/src/components/UIQuickNavigation/UIQuickNavigation.tsx @@ -169,7 +169,6 @@ function stopEventBubling(event: KeyboardEvent | FocusEvent): void { event.preventDefault(); } -// eslint-disable-next-line @typescript-eslint/naming-convention export const UIQuickNavigation: React.FC = (props: UIQuickNavigationProps) => { const { className, children, inline, offset } = props; const [enabled, setEnabled] = useState(false); diff --git a/packages/ui-components/src/components/UISection/UISections.tsx b/packages/ui-components/src/components/UISection/UISections.tsx index 36572789562..218ada05487 100644 --- a/packages/ui-components/src/components/UISection/UISections.tsx +++ b/packages/ui-components/src/components/UISection/UISections.tsx @@ -336,7 +336,7 @@ export class UISections extends React.Component { // inputs visible only in "edit mode" (after cell click) const editedCell = this.state.editedCell; - const itsThisRow = editedCell && editedCell.rowIndex === rowIndex; + const itsThisRow = editedCell?.rowIndex === rowIndex; const itsThisCol = editedCell && editedCell.column?.key === column?.key; const isCellInEditMode = itsThisRow && itsThisCol; diff --git a/packages/ui-components/tsconfig.eslint.json b/packages/ui-components/tsconfig.eslint.json index d5f1aa34747..d90a5a445f0 100644 --- a/packages/ui-components/tsconfig.eslint.json +++ b/packages/ui-components/tsconfig.eslint.json @@ -1,4 +1,4 @@ { "extends": "./tsconfig.json", - "include": ["src", "test", ".eslintrc.js"] + "include": ["src", "test", "eslint.config.js"] } diff --git a/packages/ui-prompting/.eslintignore b/packages/ui-prompting/.eslintignore deleted file mode 100644 index 017cd8bbd3a..00000000000 --- a/packages/ui-prompting/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -stories diff --git a/packages/ui-prompting/.eslintrc.js b/packages/ui-prompting/.eslintrc.js deleted file mode 100644 index 3a82a63cdb8..00000000000 --- a/packages/ui-prompting/.eslintrc.js +++ /dev/null @@ -1,38 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc', 'plugin:react/recommended', 'plugin:storybook/recommended'], - parserOptions: { - 'EXPERIMENTAL_useSourceOfProjectReferenceRedirect': true, - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - overrides: [ - { - 'parser': '@typescript-eslint/parser', - 'files': ['./test/**/*.tsx'], - 'rules': { - 'no-loop-func': 'off' - } - }, - { - 'parser': '@typescript-eslint/parser', - 'files': ['./src/**/*.tsx'], - 'rules': { - '@typescript-eslint/no-unused-vars': [ - 'error', - { 'varsIgnorePattern': '^_', 'argsIgnorePattern': '^_', 'ignoreRestSiblings': true } - ] - } - } - ], - rules: { - 'react/no-unknown-property': ['error', { 'ignore': ['onFocusCapture'] }], - 'jsdoc/require-param-description': 'off', - 'jsdoc/require-returns-description': 'off', - 'jsdoc/no-undefined-types': 'off' - }, - settings: { - 'react': { - 'version': 'detect' - } - } -}; diff --git a/packages/ui-prompting/eslint.config.js b/packages/ui-prompting/eslint.config.js new file mode 100644 index 00000000000..dfcd89d1b1f --- /dev/null +++ b/packages/ui-prompting/eslint.config.js @@ -0,0 +1,52 @@ +const base = require('../../eslint.config.js'); +const reactPlugin = require('eslint-plugin-react'); +const globals = require('globals'); +const storybook = require('eslint-plugin-storybook/dist/configs/flat/recommended'); + +module.exports = [ + { ignores: ['stories', 'storybook', 'test'] }, + ...base, + reactPlugin.configs.flat.recommended, + ...storybook, + { + ignores: ['stories', './test/**/*.tsx'], + plugins: { + reactPlugin + }, + languageOptions: { + parserOptions: { + project: './tsconfig.eslint.json', + tsconfigRootDir: __dirname + }, + globals: { + ...globals.browser + } + }, + rules: { + 'react/no-unknown-property': ['error', { 'ignore': ['onFocusCapture'] }], + 'jsdoc/require-param-description': 'off', + 'jsdoc/require-returns-description': 'off', + 'jsdoc/no-undefined-types': 'off', + '@typescript-eslint/no-unused-vars': [ + 'error', + { 'varsIgnorePattern': '^_', 'argsIgnorePattern': '^_', 'ignoreRestSiblings': true } + ] + }, + settings: { + 'react': { + 'version': 'detect' + } + } + }, + { + languageOptions: { + 'parser': '@typescript-eslint/parser', + project: './tsconfig.eslint.json', + tsconfigRootDir: __dirname + }, + files: ['./test/**/*.tsx'], + rules: { + 'no-loop-func': 'off' + } + } +]; \ No newline at end of file diff --git a/packages/ui-prompting/package.json b/packages/ui-prompting/package.json index b7f9bb86389..69433ce9bf5 100644 --- a/packages/ui-prompting/package.json +++ b/packages/ui-prompting/package.json @@ -61,7 +61,8 @@ "babel-loader": "9.1.3", "copyfiles": "2.4.1", "css-loader": "6.8.1", - "eslint-plugin-react": "7.33.2", + "eslint": "9.29.0", + "eslint-plugin-react": "7.37.4", "eslint-plugin-storybook": "0.6.15", "jest-environment-jsdom": "29.7.0", "jest-scss-transform": "1.0.4", diff --git a/packages/ui-prompting/src/utilities/utils.ts b/packages/ui-prompting/src/utilities/utils.ts index fc8f60a6246..56c6d8f51bc 100644 --- a/packages/ui-prompting/src/utilities/utils.ts +++ b/packages/ui-prompting/src/utilities/utils.ts @@ -58,6 +58,8 @@ export function updateAnswers( ): Answers { let updatedAnswers = setAnswer(structuredClone(answers), name, value); const dependantPromptNames = getDependantQuestions(questions, name); + // TODO: check this code logic + // eslint-disable-next-line @typescript-eslint/no-unused-expressions dependantPromptNames?.length && dependantPromptNames.forEach((dependantName) => { updatedAnswers = setAnswer(updatedAnswers, dependantName, undefined); diff --git a/packages/ui-service-inquirer/.eslintignore b/packages/ui-service-inquirer/.eslintignore deleted file mode 100644 index 4c6181d7707..00000000000 --- a/packages/ui-service-inquirer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -/test/unit/expected-output/ -dist diff --git a/packages/ui-service-inquirer/.eslintrc.js b/packages/ui-service-inquirer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui-service-inquirer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui-service-inquirer/eslint.config.js b/packages/ui-service-inquirer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui-service-inquirer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui-service-inquirer/test/prompt-helper.test.ts b/packages/ui-service-inquirer/test/prompt-helper.test.ts index 411827718ef..608b5f55491 100644 --- a/packages/ui-service-inquirer/test/prompt-helper.test.ts +++ b/packages/ui-service-inquirer/test/prompt-helper.test.ts @@ -2,7 +2,6 @@ import * as promptHelper from '../src/prompts'; const mockIsAppStudio = jest.fn(); jest.mock('@sap-ux/btp-utils', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/btp-utils') as {}), isAppStudio: () => mockIsAppStudio() })); diff --git a/packages/ui-service-sub-generator/.eslintignore b/packages/ui-service-sub-generator/.eslintignore deleted file mode 100644 index 09379ed8fa5..00000000000 --- a/packages/ui-service-sub-generator/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -/test/unit/expected-output/ -generators diff --git a/packages/ui-service-sub-generator/.eslintrc.js b/packages/ui-service-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui-service-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui-service-sub-generator/eslint.config.js b/packages/ui-service-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui-service-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui-service-sub-generator/test/utils.test.ts b/packages/ui-service-sub-generator/test/utils.test.ts index 7b6f2d515e6..c7c4157ca4d 100644 --- a/packages/ui-service-sub-generator/test/utils.test.ts +++ b/packages/ui-service-sub-generator/test/utils.test.ts @@ -9,7 +9,6 @@ import type { Destination } from '@sap-ux/btp-utils'; const mockIsAppStudio = jest.fn(); jest.mock('@sap-ux/btp-utils', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/btp-utils') as {}), isAppStudio: () => mockIsAppStudio() })); diff --git a/packages/ui5-application-inquirer/.eslintignore b/packages/ui5-application-inquirer/.eslintignore deleted file mode 100644 index 9be6e1b137f..00000000000 --- a/packages/ui5-application-inquirer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -dist -templates \ No newline at end of file diff --git a/packages/ui5-application-inquirer/.eslintrc.js b/packages/ui5-application-inquirer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-application-inquirer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-application-inquirer/eslint.config.js b/packages/ui5-application-inquirer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-application-inquirer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-application-inquirer/src/prompts/index.ts b/packages/ui5-application-inquirer/src/prompts/index.ts index afdd5bcc054..85e4f61e441 100644 --- a/packages/ui5-application-inquirer/src/prompts/index.ts +++ b/packages/ui5-application-inquirer/src/prompts/index.ts @@ -1,4 +1,3 @@ -/* eslint-disable @typescript-eslint/prefer-nullish-coalescing */ // Nullish coalescing operator lint warnings disabled as its not appropriate in most cases where empty strings are not considered valid import os from 'node:os'; import { join } from 'node:path'; @@ -53,7 +52,7 @@ export async function getQuestions( let targetDir = typeof promptOptions?.[promptNames.targetFolder]?.default === 'string' ? promptOptions[promptNames.targetFolder].default // Default functions will be applied later, these replace the existing defaults - : promptOptions?.[promptNames.targetFolder]?.defaultValue ?? process.cwd(); + : (promptOptions?.[promptNames.targetFolder]?.defaultValue ?? process.cwd()); const shouldValidateFioriAppFolder = promptOptions?.[promptNames.targetFolder]?.validateFioriAppFolder; if (shouldValidateFioriAppFolder) { diff --git a/packages/ui5-application-inquirer/src/prompts/prompt-helpers.ts b/packages/ui5-application-inquirer/src/prompts/prompt-helpers.ts index 259a862dba6..fe859052f18 100644 --- a/packages/ui5-application-inquirer/src/prompts/prompt-helpers.ts +++ b/packages/ui5-application-inquirer/src/prompts/prompt-helpers.ts @@ -82,7 +82,7 @@ export function hidePrompts( const promptOpt = promptOptions?.[promptKey] as UI5ApplicationCommonPromptOptions | AddDeployPromptOptions; const hidePrompt = - typeof promptOpt?.hide === 'function' ? promptOpt.hide(isCapProject) : promptOpt?.hide ?? false; + typeof promptOpt?.hide === 'function' ? promptOpt.hide(isCapProject) : (promptOpt?.hide ?? false); if ( !hidePrompt && // Target directory is determined by the CAP project. `enableEsLint` and `targetFolder` are not available for CAP projects diff --git a/packages/ui5-application-writer/.eslintignore b/packages/ui5-application-writer/.eslintignore deleted file mode 100644 index 2b81aee6d5c..00000000000 --- a/packages/ui5-application-writer/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -test/test-output -test/test-input -dist -templates \ No newline at end of file diff --git a/packages/ui5-application-writer/.eslintrc.js b/packages/ui5-application-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-application-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-application-writer/eslint.config.js b/packages/ui5-application-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-application-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-application-writer/templates/optional/eslint/package.json b/packages/ui5-application-writer/templates/optional/eslint/package.json index 6356f30fe11..a02204975b5 100644 --- a/packages/ui5-application-writer/templates/optional/eslint/package.json +++ b/packages/ui5-application-writer/templates/optional/eslint/package.json @@ -3,9 +3,9 @@ "lint": "eslint ./" }, "devDependencies": { - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0", - "eslint": "8.57.0", + "@sap-ux/eslint-plugin-fiori-tools": "^0.5.0", + "eslint": "^9", "eslint-plugin-fiori-custom": "2.6.7", - "@babel/eslint-parser": "7.14.7" + "@babel/eslint-parser": "^7.27.0" } } diff --git a/packages/ui5-application-writer/templates/optional/typescript/package.json b/packages/ui5-application-writer/templates/optional/typescript/package.json index d9e3c4c9e8e..d13aa1d9873 100644 --- a/packages/ui5-application-writer/templates/optional/typescript/package.json +++ b/packages/ui5-application-writer/templates/optional/typescript/package.json @@ -9,8 +9,8 @@ "<%- ui5.typesPackage %>": "<%- ui5.typesVersion %>", "ui5-tooling-transpile": "^3.3.7", "typescript": "^5.1.6", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0" + "@eslint": "^9.38.0", + "@typescript-eslint": "^8.27.0", + "@sap-ux/eslint-plugin-fiori-tools": "^9.0.0" } } diff --git a/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap b/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap index 1d47f4c3843..8622e21107f 100644 --- a/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap +++ b/packages/ui5-application-writer/test/__snapshots__/options.test.ts.snap @@ -41,12 +41,12 @@ archive.zip \\"devDependencies\\": { \\"@ui5/cli\\": \\"^4.0.16\\", \\"@sap/ux-ui5-tooling\\": \\"1\\", - \\"eslint\\": \\"8.57.0\\", + \\"eslint\\": \\"^9\\", \\"@sap/eslint-plugin-ui5-jsdocs\\": \\"2.0.5\\", \\"@sapui5/ts-types\\": \\"~1.76.0\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.5.0\\", \\"eslint-plugin-fiori-custom\\": \\"2.6.7\\", - \\"@babel/eslint-parser\\": \\"7.14.7\\" + \\"@babel/eslint-parser\\": \\"^7.27.0\\" }, \\"scripts\\": { \\"start\\": \\"ui5 serve --config=ui5.yaml --open index.html\\", @@ -1836,9 +1836,9 @@ exports[`UI5 templates option: \`typescript and code assist\` to check for confl \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\" + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\" }, \\"scripts\\": { \\"start\\": \\"ui5 serve --config=ui5.yaml --open index.html\\", @@ -1931,9 +1931,9 @@ archive.zip \\"@sapui5/ts-types-esm\\": \\"~1.94.0\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", \\"typescript\\": \\"^5.1.6\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\", \\"ui5-tooling-modules\\": \\"^0.6.0\\" }, \\"scripts\\": { diff --git a/packages/ui5-config/.eslintignore b/packages/ui5-config/.eslintignore deleted file mode 100644 index 2b81aee6d5c..00000000000 --- a/packages/ui5-config/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -test/test-output -test/test-input -dist -templates \ No newline at end of file diff --git a/packages/ui5-config/.eslintrc.js b/packages/ui5-config/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-config/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-config/eslint.config.js b/packages/ui5-config/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-config/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-config/src/defaults.ts b/packages/ui5-config/src/defaults.ts index 534f7cee5a9..8a236f269d1 100644 --- a/packages/ui5-config/src/defaults.ts +++ b/packages/ui5-config/src/defaults.ts @@ -6,7 +6,7 @@ export const enum UI5_DEFAULT { MIN_LOCAL_OPENUI5_VERSION = '1.52.5', SAPUI5_CDN = 'https://ui5.sap.com', OPENUI5_CDN = 'https://sdk.openui5.org', - TYPES_VERSION_SINCE = '1.76.0', // eslint-disable-line @typescript-eslint/no-duplicate-enum-values + TYPES_VERSION_SINCE = '1.76.0', ESM_TYPES_VERSION_SINCE = '1.94.0', TYPES_VERSION_BEST = '1.136.0', NEW_TYPES_PACKAGE_SINCE = '1.113.0', diff --git a/packages/ui5-config/src/ui5config.ts b/packages/ui5-config/src/ui5config.ts index 4deec37c6b5..2f5b5d1279f 100644 --- a/packages/ui5-config/src/ui5config.ts +++ b/packages/ui5-config/src/ui5config.ts @@ -103,7 +103,7 @@ export class UI5Config { let resources: Resources; try { resources = this.document.getMap({ path: 'resources' }).toJSON(); - } catch (error) { + } catch { resources = {}; } return resources.configuration ?? {}; @@ -171,7 +171,7 @@ export class UI5Config { try { const configNode = this.document.getMap({ path: 'customConfiguration' }); configNode.setIn([key], value); - } catch (_error) { + } catch { this.document.setIn({ path: 'customConfiguration', value: { diff --git a/packages/ui5-info/.eslintignore b/packages/ui5-info/.eslintignore deleted file mode 100644 index 888dfe02509..00000000000 --- a/packages/ui5-info/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -dist -templates diff --git a/packages/ui5-info/.eslintrc.js b/packages/ui5-info/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-info/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-info/eslint.config.js b/packages/ui5-info/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-info/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-info/test/commands.test.ts b/packages/ui5-info/test/commands.test.ts index e664c2ea3de..eca2f1d5908 100644 --- a/packages/ui5-info/test/commands.test.ts +++ b/packages/ui5-info/test/commands.test.ts @@ -214,7 +214,7 @@ describe('Retrieve NPM UI5 mocking spawn process', () => { }); }); -// eslint-disable-next-line @typescript-eslint/no-var-requires +// eslint-disable-next-line @typescript-eslint/no-require-imports const mockSpawn = require('mock-spawn'); import childProcess from 'child_process'; diff --git a/packages/ui5-library-inquirer/.eslintignore b/packages/ui5-library-inquirer/.eslintignore deleted file mode 100644 index 9be6e1b137f..00000000000 --- a/packages/ui5-library-inquirer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -dist -templates \ No newline at end of file diff --git a/packages/ui5-library-inquirer/.eslintrc.js b/packages/ui5-library-inquirer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-library-inquirer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-library-inquirer/eslint.config.js b/packages/ui5-library-inquirer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-library-inquirer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-library-reference-inquirer/.eslintignore b/packages/ui5-library-reference-inquirer/.eslintignore deleted file mode 100644 index 0fc18a40e56..00000000000 --- a/packages/ui5-library-reference-inquirer/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test -dist diff --git a/packages/ui5-library-reference-inquirer/.eslintrc.js b/packages/ui5-library-reference-inquirer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-library-reference-inquirer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-library-reference-inquirer/eslint.config.js b/packages/ui5-library-reference-inquirer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-library-reference-inquirer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-library-reference-inquirer/test/unit/choices.test.ts b/packages/ui5-library-reference-inquirer/test/unit/choices.test.ts index 75baf339952..f45bdc7ab35 100644 --- a/packages/ui5-library-reference-inquirer/test/unit/choices.test.ts +++ b/packages/ui5-library-reference-inquirer/test/unit/choices.test.ts @@ -1,6 +1,7 @@ import { join } from 'node:path'; import { getLibraryChoices, getProjectChoices } from '../../src/choices'; -import { Manifest, ReuseLibType } from '@sap-ux/project-access'; +import type { Manifest } from '@sap-ux/project-access'; +import { ReuseLibType } from '@sap-ux/project-access'; describe('choices utils', () => { test('should return project choices', async () => { diff --git a/packages/ui5-library-reference-inquirer/test/unit/prompts/helpers.test.ts b/packages/ui5-library-reference-inquirer/test/unit/prompts/helpers.test.ts index 1f1cf84714c..bc556c9701d 100644 --- a/packages/ui5-library-reference-inquirer/test/unit/prompts/helpers.test.ts +++ b/packages/ui5-library-reference-inquirer/test/unit/prompts/helpers.test.ts @@ -1,4 +1,3 @@ - import { extendWithOptions } from '@sap-ux/inquirer-common'; import { promptNames, type UI5LibraryReferencePromptOptions } from '../../../src/types'; diff --git a/packages/ui5-library-reference-sub-generator/.eslintignore b/packages/ui5-library-reference-sub-generator/.eslintignore deleted file mode 100644 index 09379ed8fa5..00000000000 --- a/packages/ui5-library-reference-sub-generator/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -/test/unit/expected-output/ -generators diff --git a/packages/ui5-library-reference-sub-generator/.eslintrc.js b/packages/ui5-library-reference-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-library-reference-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-library-reference-sub-generator/eslint.config.js b/packages/ui5-library-reference-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-library-reference-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-library-reference-sub-generator/test/unit/app.test.ts b/packages/ui5-library-reference-sub-generator/test/unit/app.test.ts index bba1dfe014e..4cb976bc5f1 100644 --- a/packages/ui5-library-reference-sub-generator/test/unit/app.test.ts +++ b/packages/ui5-library-reference-sub-generator/test/unit/app.test.ts @@ -19,7 +19,6 @@ const refLibGenPath = path.join(__dirname, '../../src/app'); let yoEnv4 = false; jest.mock('@sap-ux/fiori-generator-shared', () => ({ - // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion ...(jest.requireActual('@sap-ux/fiori-generator-shared') as {}), TelemetryHelper: { initTelemetrySettings: jest.fn(), diff --git a/packages/ui5-library-reference-sub-generator/test/unit/sample/test_project_lrop_v2/webapp/Component.js b/packages/ui5-library-reference-sub-generator/test/unit/sample/test_project_lrop_v2/webapp/Component.js index abcce9ca239..a446ffbf582 100755 --- a/packages/ui5-library-reference-sub-generator/test/unit/sample/test_project_lrop_v2/webapp/Component.js +++ b/packages/ui5-library-reference-sub-generator/test/unit/sample/test_project_lrop_v2/webapp/Component.js @@ -1,4 +1,4 @@ -sap.ui.define(['sap/suite/ui/generic/template/lib/AppComponent'], function(AppComponent) { +sap.ui.define(['sap/suite/ui/generic/template/lib/AppComponent'], function (AppComponent) { return AppComponent.extend('testNameSpace.testprojectlropv2.Component', { metadata: { manifest: 'json' diff --git a/packages/ui5-library-reference-sub-generator/test/unit/sample/test_project_lrop_v2_custom_webapp_path/src/main/webapp/Component.js b/packages/ui5-library-reference-sub-generator/test/unit/sample/test_project_lrop_v2_custom_webapp_path/src/main/webapp/Component.js index abcce9ca239..a446ffbf582 100755 --- a/packages/ui5-library-reference-sub-generator/test/unit/sample/test_project_lrop_v2_custom_webapp_path/src/main/webapp/Component.js +++ b/packages/ui5-library-reference-sub-generator/test/unit/sample/test_project_lrop_v2_custom_webapp_path/src/main/webapp/Component.js @@ -1,4 +1,4 @@ -sap.ui.define(['sap/suite/ui/generic/template/lib/AppComponent'], function(AppComponent) { +sap.ui.define(['sap/suite/ui/generic/template/lib/AppComponent'], function (AppComponent) { return AppComponent.extend('testNameSpace.testprojectlropv2.Component', { metadata: { manifest: 'json' diff --git a/packages/ui5-library-reference-writer/.eslintignore b/packages/ui5-library-reference-writer/.eslintignore deleted file mode 100644 index 20304bf3427..00000000000 --- a/packages/ui5-library-reference-writer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -test/test-input -dist \ No newline at end of file diff --git a/packages/ui5-library-reference-writer/.eslintrc.js b/packages/ui5-library-reference-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-library-reference-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-library-reference-writer/eslint.config.js b/packages/ui5-library-reference-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-library-reference-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-library-sub-generator/.eslintignore b/packages/ui5-library-sub-generator/.eslintignore deleted file mode 100644 index 09379ed8fa5..00000000000 --- a/packages/ui5-library-sub-generator/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -/test/test-output/ -/test/unit/expected-output/ -generators diff --git a/packages/ui5-library-sub-generator/.eslintrc.js b/packages/ui5-library-sub-generator/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-library-sub-generator/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-library-sub-generator/eslint.config.js b/packages/ui5-library-sub-generator/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-library-sub-generator/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-library-writer/.eslintignore b/packages/ui5-library-writer/.eslintignore deleted file mode 100644 index 2b81aee6d5c..00000000000 --- a/packages/ui5-library-writer/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -test/test-output -test/test-input -dist -templates \ No newline at end of file diff --git a/packages/ui5-library-writer/.eslintrc.js b/packages/ui5-library-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-library-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-library-writer/eslint.config.js b/packages/ui5-library-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-library-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-library-writer/templates/optional/typescript/package.json b/packages/ui5-library-writer/templates/optional/typescript/package.json index 74ca99a08b5..54c0d73aa19 100644 --- a/packages/ui5-library-writer/templates/optional/typescript/package.json +++ b/packages/ui5-library-writer/templates/optional/typescript/package.json @@ -3,11 +3,10 @@ "version": "1.0.0", "devDependencies": { "<%= tsTypes %>": "<%= tsTypesVersion %>", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", - "@ui5/cli": "^3.9.1", + "@eslint": "^9.38.0", + "@typescript-eslint": "^8.27.0", + "@ui5/cli": "^4.0.0", "@ui5/ts-interface-generator": "^0.8.1", - "eslint": "^8.57.0", "karma": "^6.3.17", "karma-chrome-launcher": "^3.1.1", "karma-cli": "^2.0.0", @@ -16,7 +15,7 @@ "typescript": "^5.1.6", "@sap/ux-ui5-tooling": "1", "ui5-tooling-transpile": "^3.3.7", - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0" + "@sap-ux/eslint-plugin-fiori-tools": "^9.0.0" }, "scripts": { "build": "run-p -l build-app build-interface", diff --git a/packages/ui5-proxy-middleware/.eslintignore b/packages/ui5-proxy-middleware/.eslintignore deleted file mode 100644 index d58f18d6887..00000000000 --- a/packages/ui5-proxy-middleware/.eslintignore +++ /dev/null @@ -1,4 +0,0 @@ -test/test-output -test/test-input -dist -test diff --git a/packages/ui5-proxy-middleware/.eslintrc.js b/packages/ui5-proxy-middleware/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-proxy-middleware/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-proxy-middleware/eslint.config.js b/packages/ui5-proxy-middleware/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-proxy-middleware/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/ui5-proxy-middleware/src/base/utils.ts b/packages/ui5-proxy-middleware/src/base/utils.ts index 2ee74a22a9a..28d0c4310a8 100644 --- a/packages/ui5-proxy-middleware/src/base/utils.ts +++ b/packages/ui5-proxy-middleware/src/base/utils.ts @@ -15,6 +15,7 @@ import { } from './constants'; import type { Url } from 'node:url'; import { t } from '../i18n'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection } from '@ui5/fs'; import type { Socket } from 'node:net'; diff --git a/packages/ui5-proxy-middleware/src/ui5/middleware.ts b/packages/ui5-proxy-middleware/src/ui5/middleware.ts index c6aaff0c306..530e615a77f 100644 --- a/packages/ui5-proxy-middleware/src/ui5/middleware.ts +++ b/packages/ui5-proxy-middleware/src/ui5/middleware.ts @@ -7,7 +7,9 @@ import { getCorporateProxyServer, directLoadProxy, ui5Proxy, resolveUI5Version, import dotenv from 'dotenv'; import type { UI5ProxyConfig } from '@sap-ux/ui5-config'; import type { Manifest } from '@sap-ux/project-access'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { MiddlewareParameters } from '@ui5/server'; +// eslint-disable-next-line sonarjs/no-implicit-dependencies import type { ReaderCollection } from '@ui5/fs'; /** diff --git a/packages/ui5-proxy-middleware/test/base/proxy.test.ts b/packages/ui5-proxy-middleware/test/base/proxy.test.ts index 5c137c24215..a36f6604756 100644 --- a/packages/ui5-proxy-middleware/test/base/proxy.test.ts +++ b/packages/ui5-proxy-middleware/test/base/proxy.test.ts @@ -1,5 +1,5 @@ import { ui5Proxy } from '../../src'; -import * as hpm from 'http-proxy-middleware'; +import type * as hpm from 'http-proxy-middleware'; import * as utils from '../../src/base/utils'; import { ToolsLogger } from '@sap-ux/logger'; diff --git a/packages/ui5-proxy-middleware/test/base/utils.test.ts b/packages/ui5-proxy-middleware/test/base/utils.test.ts index a67be90c5e0..25308f77b45 100644 --- a/packages/ui5-proxy-middleware/test/base/utils.test.ts +++ b/packages/ui5-proxy-middleware/test/base/utils.test.ts @@ -19,7 +19,7 @@ import type { ProxyConfig } from '../../src/base/types'; import type { IncomingMessage } from 'http'; import { NullTransport, ToolsLogger } from '@sap-ux/logger'; import type { Manifest } from '@sap-ux/project-access'; -import type { ReaderCollection } from '@ui5/fs'; +import type { ReaderCollection } from '@ui5/fs'; // eslint-disable-line sonarjs/no-implicit-dependencies describe('utils', () => { beforeEach(() => { @@ -597,7 +597,9 @@ describe('utils', () => { }; const ui5Ver = ''; const rewrite = getPathRewrite(config, ui5Ver); - expect((rewrite as Function)('/chicken.js')).toEqual('this/path/should/rewrite/mypath/resources/chicken.js'); + expect((rewrite as Function)('/chicken.js')).toEqual( + 'this/path/should/rewrite/mypath/resources/chicken.js' + ); }); }); }); diff --git a/packages/ui5-proxy-middleware/test/ui5/middleware.test.ts b/packages/ui5-proxy-middleware/test/ui5/middleware.test.ts index 3ee1e796e70..9615d06c697 100644 --- a/packages/ui5-proxy-middleware/test/ui5/middleware.test.ts +++ b/packages/ui5-proxy-middleware/test/ui5/middleware.test.ts @@ -6,7 +6,7 @@ import express from 'express'; import supertest from 'supertest'; import nock from 'nock'; import type { UI5ProxyConfig } from '@sap-ux/ui5-config'; -import {ToolsLogger} from "@sap-ux/logger"; +import { ToolsLogger } from '@sap-ux/logger'; // spy on ui5Proxy and injectScripts to verify calls const ui5ProxySpy = jest.spyOn(proxy, 'ui5Proxy'); @@ -181,7 +181,7 @@ describe('middleware', () => { }); expect(ui5ProxySpy).toHaveBeenCalledWith( expect.objectContaining({}), - expect.objectContaining({ logger: expect.objectContaining({})}), + expect.objectContaining({ logger: expect.objectContaining({}) }), undefined, expect.any(ToolsLogger) ); diff --git a/packages/ui5-test-writer/.eslintignore b/packages/ui5-test-writer/.eslintignore deleted file mode 100644 index 9e4857e13ae..00000000000 --- a/packages/ui5-test-writer/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -test/test-output -dist -templates \ No newline at end of file diff --git a/packages/ui5-test-writer/.eslintrc.js b/packages/ui5-test-writer/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/ui5-test-writer/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/ui5-test-writer/eslint.config.js b/packages/ui5-test-writer/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/ui5-test-writer/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/xml-odata-annotation-converter/.eslintignore b/packages/xml-odata-annotation-converter/.eslintignore deleted file mode 100644 index 781ebfaa480..00000000000 --- a/packages/xml-odata-annotation-converter/.eslintignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -out -reports diff --git a/packages/xml-odata-annotation-converter/.eslintrc b/packages/xml-odata-annotation-converter/.eslintrc deleted file mode 100644 index 5e6f65be0b4..00000000000 --- a/packages/xml-odata-annotation-converter/.eslintrc +++ /dev/null @@ -1,12 +0,0 @@ -{ - "extends": ["../../.eslintrc"], - "parserOptions": { - "EXPERIMENTAL_useSourceOfProjectReferenceRedirect": true, - "project": "./tsconfig.eslint.json" - }, - "rules": { - "@typescript-eslint/no-use-before-define": [ - "off" - ] - } -} diff --git a/packages/xml-odata-annotation-converter/eslint.config.js b/packages/xml-odata-annotation-converter/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/xml-odata-annotation-converter/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/packages/xml-odata-annotation-converter/src/printer/csdl-to-xml.ts b/packages/xml-odata-annotation-converter/src/printer/csdl-to-xml.ts index 0e4ae5afd96..8f6e07dea6d 100644 --- a/packages/xml-odata-annotation-converter/src/printer/csdl-to-xml.ts +++ b/packages/xml-odata-annotation-converter/src/printer/csdl-to-xml.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-use-before-define */ import type { Attributes, Element, ODataNamespaceAlias, TextNode } from '@sap-ux/odata-annotation-core'; import { ELEMENT_TYPE, TEXT_TYPE, EDM_NAMESPACE_ALIAS, EDMX_NAMESPACE_ALIAS, Edm } from '@sap-ux/odata-annotation-core'; @@ -39,14 +40,14 @@ export const escapeText = (input: string): string => { if (!input || typeof input !== 'string') { return input; } - return input.replace(/([<&])/g, (_str, item: '<' | '&') => ({ '<': '<', '&': '&' }[item])); + return input.replace(/([<&])/g, (_str, item: '<' | '&') => ({ '<': '<', '&': '&' })[item]); }; export const unescapeText = (input: string) => { if (!input || typeof input !== 'string') { return input; } - return input.replace(/(<|&)/g, (_str, item: '<' | '&') => ({ '<': '<', '&': '&' }[item])); + return input.replace(/(<|&)/g, (_str, item: '<' | '&') => ({ '<': '<', '&': '&' })[item]); }; export const escapeAttribute = (input: string): string => { @@ -55,7 +56,7 @@ export const escapeAttribute = (input: string): string => { } return input.replace( /([<&"])/g, - (_str, item: '<' | '&' | '"') => ({ '<': '<', '&': '&', '"': '"' }[item]) + (_str, item: '<' | '&' | '"') => ({ '<': '<', '&': '&', '"': '"' })[item] ); }; @@ -65,7 +66,7 @@ export const unescapeAttribute = (input: string) => { } return input.replace( /(<|&|")/g, - (_str, item: '<' | '&' | '"') => ({ '<': '<', '&': '&', '"': '"' }[item]) + (_str, item: '<' | '&' | '"') => ({ '<': '<', '&': '&', '"': '"' })[item] ); }; diff --git a/packages/xml-odata-annotation-converter/src/printer/document-modifier.ts b/packages/xml-odata-annotation-converter/src/printer/document-modifier.ts index 0671ae994d8..3e739a0bc64 100644 --- a/packages/xml-odata-annotation-converter/src/printer/document-modifier.ts +++ b/packages/xml-odata-annotation-converter/src/printer/document-modifier.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-use-before-define */ import type { XMLElement } from '@xml-tools/ast'; import type { Element, FormatterOptions } from '@sap-ux/odata-annotation-core'; import { EDMX_NAMESPACE_ALIAS, EDM_NAMESPACE_ALIAS, TextEdit, Position } from '@sap-ux/odata-annotation-core'; diff --git a/packages/yaml/.eslintignore b/packages/yaml/.eslintignore deleted file mode 100644 index 0d842b9e041..00000000000 --- a/packages/yaml/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -dist -templates diff --git a/packages/yaml/.eslintrc.js b/packages/yaml/.eslintrc.js deleted file mode 100644 index b717f83ae98..00000000000 --- a/packages/yaml/.eslintrc.js +++ /dev/null @@ -1,7 +0,0 @@ -module.exports = { - extends: ['../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - } -}; diff --git a/packages/yaml/eslint.config.js b/packages/yaml/eslint.config.js new file mode 100644 index 00000000000..6eac0da3eb2 --- /dev/null +++ b/packages/yaml/eslint.config.js @@ -0,0 +1,13 @@ +const base = require('../../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, +]; \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index d221c83e12a..5f651503fe9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -16,8 +16,14 @@ importers: .: devDependencies: '@changesets/cli': - specifier: 2.29.7 - version: 2.29.7(@types/node@18.19.130) + specifier: 2.27.10 + version: 2.27.10 + '@eslint/eslintrc': + specifier: 3.3.0 + version: 3.3.0 + '@eslint/js': + specifier: 9.22.0 + version: 9.22.0 '@playwright/test': specifier: 1.56.1 version: 1.56.1 @@ -27,12 +33,6 @@ importers: '@types/node': specifier: 18.19.130 version: 18.19.130 - '@typescript-eslint/eslint-plugin': - specifier: ^7.18.0 - version: 7.18.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.1)(typescript@5.9.3) - '@typescript-eslint/parser': - specifier: ^7.18.0 - version: 7.18.0(eslint@8.57.1)(typescript@5.9.3) autoprefixer: specifier: 10.4.21 version: 10.4.21(postcss@8.5.6) @@ -46,29 +46,32 @@ importers: specifier: 3.3.1 version: 3.3.1(esbuild@0.25.11)(sass-embedded@1.93.2) eslint: - specifier: 8.57.1 - version: 8.57.1 + specifier: 9.36.0 + version: 9.36.0 eslint-config-prettier: - specifier: 8.10.2 - version: 8.10.2(eslint@8.57.1) + specifier: 10.1.1 + version: 10.1.1(eslint@9.36.0) eslint-import-resolver-typescript: - specifier: 3.10.1 - version: 3.10.1(eslint-plugin-import@2.32.0)(eslint@8.57.1) + specifier: 4.2.2 + version: 4.2.2(eslint-plugin-import@2.31.0)(eslint@9.36.0) eslint-plugin-import: - specifier: 2.32.0 - version: 2.32.0(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1) + specifier: 2.31.0 + version: 2.31.0(@typescript-eslint/parser@8.46.2)(eslint-import-resolver-typescript@4.2.2)(eslint@9.36.0) eslint-plugin-jsdoc: - specifier: 46.10.1 - version: 46.10.1(eslint@8.57.1) + specifier: 50.6.8 + version: 50.6.8(eslint@9.36.0) eslint-plugin-prettier: - specifier: 4.2.5 - version: 4.2.5(eslint-config-prettier@8.10.2)(eslint@8.57.1)(prettier@2.8.8) + specifier: 5.2.3 + version: 5.2.3(eslint-config-prettier@10.1.1)(eslint@9.36.0)(prettier@3.6.2) eslint-plugin-promise: - specifier: 6.6.0 - version: 6.6.0(eslint@8.57.1) + specifier: 7.2.1 + version: 7.2.1(eslint@9.36.0) eslint-plugin-sonarjs: - specifier: 0.25.1 - version: 0.25.1(eslint@8.57.1) + specifier: 3.0.2 + version: 3.0.2(eslint@9.36.0) + globals: + specifier: 16.0.0 + version: 16.0.0 husky: specifier: 8.0.3 version: 8.0.3 @@ -91,11 +94,11 @@ importers: specifier: ^7.1.3 version: 7.1.3 prettier: - specifier: 2.8.8 - version: 2.8.8 + specifier: 3.6.2 + version: 3.6.2 pretty-quick: specifier: 3.3.1 - version: 3.3.1(prettier@2.8.8) + version: 3.3.1(prettier@3.6.2) react-select: specifier: 5.10.2 version: 5.10.2(react-dom@16.14.0)(react@16.14.0) @@ -111,6 +114,9 @@ importers: typescript: specifier: 5.9.3 version: 5.9.3 + typescript-eslint: + specifier: 8.46.2 + version: 8.46.2(eslint@9.36.0)(typescript@5.9.3) update-ts-references: specifier: 3.6.2 version: 3.6.2 @@ -145,12 +151,9 @@ importers: '@types/vinyl': specifier: 2.0.7 version: 2.0.7 - '@typescript-eslint/eslint-plugin': - specifier: ^5.59.0 - version: 5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@5.9.3) - '@typescript-eslint/parser': - specifier: ^5.59.0 - version: 5.62.0(eslint@8.57.1)(typescript@5.9.3) + typescript-eslint: + specifier: ^8.46.2 + version: 8.46.2(eslint@9.36.0)(typescript@5.9.3) examples/odata-cli: dependencies: @@ -295,11 +298,11 @@ importers: specifier: 6.8.1 version: 6.8.1(webpack@5.102.1) eslint-plugin-react: - specifier: 7.33.2 - version: 7.33.2(eslint@8.57.1) + specifier: 7.37.4 + version: 7.37.4(eslint@9.36.0) eslint-plugin-storybook: - specifier: 0.6.15 - version: 0.6.15(eslint@8.57.1)(typescript@5.9.3) + specifier: 0.12.0 + version: 0.12.0(eslint@9.36.0)(typescript@5.9.3) mem-fs: specifier: 2.1.0 version: 2.1.0 @@ -323,7 +326,7 @@ importers: version: 13.3.2(sass-embedded@1.93.2)(sass@1.66.1)(webpack@5.102.1) storybook: specifier: 8.4.2 - version: 8.4.2(prettier@2.8.8) + version: 8.4.2(prettier@3.6.2) storybook-addon-turbo-build: specifier: 2.0.1 version: 2.0.1(webpack@5.102.1) @@ -1322,8 +1325,8 @@ importers: specifier: 2.1.1 version: 2.1.1(esbuild@0.25.11) eslint-plugin-react: - specifier: 7.33.2 - version: 7.33.2(eslint@8.57.1) + specifier: 7.37.4 + version: 7.37.4(eslint@9.36.0) http-proxy-middleware: specifier: 2.0.9 version: 2.0.9 @@ -1734,22 +1737,25 @@ importers: packages/eslint-plugin-fiori-tools: dependencies: - '@typescript-eslint/eslint-plugin': - specifier: '>=7.1.1' - version: 7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@5.9.3) - '@typescript-eslint/parser': - specifier: '>=5.62.0' - version: 7.2.0(eslint@8.57.0)(typescript@5.9.3) + '@eslint/eslintrc': + specifier: ^3.3.1 + version: 3.3.1 + '@eslint/js': + specifier: ^9 + version: 9.22.0 eslint-plugin-fiori-custom: specifier: ^2.6.7 - version: 2.6.7(eslint@8.57.0) + version: 2.6.7(eslint@9.36.0) + typescript-eslint: + specifier: ^8.46.2 + version: 8.46.2(eslint@9.36.0)(typescript@5.9.3) yaml: specifier: 2.2.2 version: 2.2.2 devDependencies: eslint: - specifier: 8.57.0 - version: 8.57.0 + specifier: ^9 + version: 9.36.0 packages/fe-fpm-writer: dependencies: @@ -3265,6 +3271,9 @@ importers: '@ui5/cli': specifier: 3.8.0 version: 3.8.0 + eslint-plugin-jsdoc: + specifier: ^50.6.9 + version: 50.8.0(eslint@9.36.0) npm-run-all2: specifier: 6.2.0 version: 6.2.0 @@ -3764,12 +3773,15 @@ importers: enzyme-adapter-react-16: specifier: 1.15.7 version: 1.15.7(enzyme@3.11.0)(react-dom@16.14.0)(react@16.14.0) + eslint: + specifier: 9.29.0 + version: 9.29.0 eslint-plugin-react: - specifier: 7.33.2 - version: 7.33.2(eslint@8.57.1) + specifier: 7.37.4 + version: 7.37.4(eslint@9.29.0) eslint-plugin-storybook: specifier: 0.6.15 - version: 0.6.15(eslint@8.57.1)(typescript@5.9.3) + version: 0.6.15(eslint@9.29.0)(typescript@5.9.3) jest-environment-jsdom: specifier: 29.7.0 version: 29.7.0 @@ -3796,7 +3808,7 @@ importers: version: 13.3.2(sass-embedded@1.93.2)(sass@1.66.1)(webpack@5.102.1) storybook: specifier: 8.4.2 - version: 8.4.2(prettier@2.8.8) + version: 8.4.2(prettier@3.6.2) storybook-addon-turbo-build: specifier: 2.0.1 version: 2.0.1(webpack@5.102.1) @@ -3876,12 +3888,15 @@ importers: css-loader: specifier: 6.8.1 version: 6.8.1(webpack@5.102.1) + eslint: + specifier: 9.29.0 + version: 9.29.0 eslint-plugin-react: - specifier: 7.33.2 - version: 7.33.2(eslint@8.57.1) + specifier: 7.37.4 + version: 7.37.4(eslint@9.29.0) eslint-plugin-storybook: specifier: 0.6.15 - version: 0.6.15(eslint@8.57.1)(typescript@5.9.3) + version: 0.6.15(eslint@9.29.0)(typescript@5.9.3) jest-environment-jsdom: specifier: 29.7.0 version: 29.7.0 @@ -3905,7 +3920,7 @@ importers: version: 13.3.2(sass-embedded@1.93.2)(sass@1.66.1)(webpack@5.102.1) storybook: specifier: 8.4.2 - version: 8.4.2(prettier@2.8.8) + version: 8.4.2(prettier@3.6.2) storybook-addon-turbo-build: specifier: 2.0.1 version: 2.0.1(webpack@5.102.1) @@ -4672,6 +4687,9 @@ importers: tests/integration/adaptation-editor: dependencies: + '@playwright/test': + specifier: 1.56.1 + version: 1.56.1 '@sap-ux-private/playwright': specifier: workspace:* version: link:../../../packages/playwright @@ -4727,10 +4745,6 @@ importers: packages: - /@aashutoshrathi/word-wrap@1.2.6: - resolution: {integrity: sha512-1Yjs2SvM8TflER/OD3cOjhWWOZb58A2t7wpE2S9XfBYTiIl+XFhQG2bjy4Pu1I+EAlCNUzRDYDdFwFYUKvXcIA==} - engines: {node: '>=0.10.0'} - /@adobe/css-tools@4.3.2: resolution: {integrity: sha512-DA5a1C0gD/pLOvhv33YMrbf2FK3oUzwNl9oOJqE4XVjuEtt6XIakRcsd7eLiOSPkp1kTRQGICTA8cKra/vFbjw==} dev: true @@ -4897,7 +4911,7 @@ packages: - supports-color dev: true - /@babel/eslint-parser@7.19.1(@babel/core@7.20.12)(eslint@8.57.0): + /@babel/eslint-parser@7.19.1(@babel/core@7.20.12)(eslint@9.36.0): resolution: {integrity: sha512-AqNf2QWt1rtu2/1rLswy6CDP7H9Oh3mMhk177Y67Rg8d7RD9WfOLLv8CGn6tisFvS2htm86yIe1yLF6I1UDaGQ==} engines: {node: ^10.13.0 || ^12.13.0 || >=14.0.0} peerDependencies: @@ -4906,7 +4920,7 @@ packages: dependencies: '@babel/core': 7.20.12 '@nicolo-ribaudo/eslint-scope-5-internals': 5.1.1-v1 - eslint: 8.57.0 + eslint: 9.36.0 eslint-visitor-keys: 2.1.0 semver: 6.3.1 dev: false @@ -5005,7 +5019,7 @@ packages: '@babel/helper-plugin-utils': 7.27.1 debug: 4.4.1 lodash.debounce: 4.0.8 - resolve: 1.22.10 + resolve: 1.22.11 transitivePeerDependencies: - supports-color dev: true @@ -6298,8 +6312,9 @@ packages: /@buxlabs/amd-to-es6@0.16.3: resolution: {integrity: sha512-HnMXHl++7W1taB0LEie0MDYOZiXGC9QbPIpD5qfzLQOrqCHhyiyC4S/Dp7Zq1Mcu1Ej5rwpYoAA4Xeze3vdX5w==} engines: {node: '>=14.15.0'} + hasBin: true dependencies: - abstract-syntax-tree: 2.21.0 + abstract-syntax-tree: 2.22.0 commander: 8.3.0 glob: 7.2.0 mkdirp: 1.0.4 @@ -6341,8 +6356,8 @@ packages: '@changesets/types': 6.1.0 dev: true - /@changesets/cli@2.29.7(@types/node@18.19.130): - resolution: {integrity: sha512-R7RqWoaksyyKXbKXBTbT4REdy22yH81mcFK6sWtqSanxUCbUi9Uf+6aqxZtDQouIqPdem2W56CdxXgsxdq7FLQ==} + /@changesets/cli@2.27.10: + resolution: {integrity: sha512-PfeXjvs9OfQJV8QSFFHjwHX3QnUL9elPEQ47SgkiwzLgtKGyuikWjrdM+lO9MXzOE22FO9jEGkcs4b+B6D6X0Q==} hasBin: true dependencies: '@changesets/apply-release-plan': 7.0.13 @@ -6358,12 +6373,12 @@ packages: '@changesets/read': 0.6.5 '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 - '@changesets/write': 0.4.0 - '@inquirer/external-editor': 1.0.2(@types/node@18.19.130) + '@changesets/write': 0.3.2 '@manypkg/get-packages': 1.1.3 ansi-colors: 4.1.3 ci-info: 3.9.0 enquirer: 2.4.1 + external-editor: 3.1.0 fs-extra: 7.0.1 mri: 1.2.0 p-limit: 2.3.0 @@ -6373,8 +6388,6 @@ packages: semver: 7.7.1 spawndamnit: 3.0.1 term-size: 2.2.1 - transitivePeerDependencies: - - '@types/node' dev: true /@changesets/config@3.1.1: @@ -6478,12 +6491,12 @@ packages: resolution: {integrity: sha512-rKQcJ+o1nKNgeoYRHKOS07tAMNd3YSN0uHaJOZYjBAgxfV7TUE7JE+z4BzZdQwb5hKaYbayKN5KrYV7ODb2rAA==} dev: true - /@changesets/write@0.4.0: - resolution: {integrity: sha512-CdTLvIOPiCNuH71pyDu3rA+Q0n65cmAbXnwWH84rKGiFumFzkmHNT8KHTMEchcxN+Kl8I54xGUhJ7l3E7X396Q==} + /@changesets/write@0.3.2: + resolution: {integrity: sha512-kDxDrPNpUgsjDbWBvUo27PzKX4gqeKOlhibaOXDJA6kuBisGqNHv/HwGJrAu8U/dSf8ZEFIeHIPtvSlZI1kULw==} dependencies: '@changesets/types': 6.1.0 fs-extra: 7.0.1 - human-id: 4.1.2 + human-id: 1.0.2 prettier: 2.8.8 dev: true @@ -6622,13 +6635,24 @@ packages: /@emotion/weak-memoize@0.3.1: resolution: {integrity: sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==} - /@es-joy/jsdoccomment@0.41.0: - resolution: {integrity: sha512-aKUhyn1QI5Ksbqcr3fFJj16p99QdjUxXAEuFst1Z47DRyoiMwivIH9MV/ARcJOCXVjPfjITciej8ZD2O/6qUmw==} + /@es-joy/jsdoccomment@0.49.0: + resolution: {integrity: sha512-xjZTSFgECpb9Ohuk5yMX5RhUEbfeQcuOp8IF60e+wyzWEF0M5xeSgqsfLtvPEX8BIyOX9saZqzuGPmZ8oWc+5Q==} engines: {node: '>=16'} dependencies: comment-parser: 1.4.1 esquery: 1.6.0 - jsdoc-type-pratt-parser: 4.0.0 + jsdoc-type-pratt-parser: 4.1.0 + dev: true + + /@es-joy/jsdoccomment@0.50.2: + resolution: {integrity: sha512-YAdE/IJSpwbOTiaURNCKECdAwqrJuFiZhylmesBcIRawtYKnBR2wxPhoIewMg+Yu+QuYvHfJNReWpoxGBKOChA==} + engines: {node: '>=18'} + dependencies: + '@types/estree': 1.0.8 + '@typescript-eslint/types': 8.46.2 + comment-parser: 1.4.1 + esquery: 1.6.0 + jsdoc-type-pratt-parser: 4.1.0 dev: true /@esbuild-plugins/node-modules-polyfill@0.2.2(esbuild@0.25.11): @@ -7307,42 +7331,105 @@ packages: dev: true optional: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.57.0): + /@eslint-community/eslint-utils@4.4.0(eslint@9.29.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.57.0 + eslint: 9.29.0 eslint-visitor-keys: 3.4.3 + dev: true - /@eslint-community/eslint-utils@4.4.0(eslint@8.57.1): + /@eslint-community/eslint-utils@4.4.0(eslint@9.36.0): resolution: {integrity: sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 dependencies: - eslint: 8.57.1 + eslint: 9.36.0 + eslint-visitor-keys: 3.4.3 + dev: true + + /@eslint-community/eslint-utils@4.9.0(eslint@9.29.0): + resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 9.29.0 eslint-visitor-keys: 3.4.3 dev: true - /@eslint-community/regexpp@4.11.0: - resolution: {integrity: sha512-G/M/tIiMrTAxEWRfLfQJMmGNX28IxBg4PBz8XqQhqUHLFI6TL2htpIB1iQCj144V5ee/JaKyT9/WZ0MGZWfA7A==} + /@eslint-community/eslint-utils@4.9.0(eslint@9.36.0): + resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} + engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + peerDependencies: + eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 + dependencies: + eslint: 9.36.0 + eslint-visitor-keys: 3.4.3 + + /@eslint-community/regexpp@4.12.1: + resolution: {integrity: sha512-CCZCDJuduB9OUkFkY2IgppNZMi2lBQgD2qzwXkEia16cge2pijY/aXi96CJMquDMn3nJdlPV1A5KrJEXwfLNzQ==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} dev: true - /@eslint-community/regexpp@4.8.1: - resolution: {integrity: sha512-PWiOzLIUAjN/w5K17PoF4n6sKBw0gqLHPhywmYHP4t1VFQQVYeb1yWsJwnMVEMl3tUHME7X/SJPZLmtG7XBDxQ==} + /@eslint-community/regexpp@4.12.2: + resolution: {integrity: sha512-EriSTlt5OC9/7SXkRSCAhfSxxoSUgBm33OH+IkwbdpgoqsSsUg7y3uh+IICI/Qg4BBWr3U2i39RpmycbxMq4ew==} engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} - /@eslint/eslintrc@2.1.4: - resolution: {integrity: sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@eslint/config-array@0.20.1: + resolution: {integrity: sha512-OL0RJzC/CBzli0DrrR31qzj6d6i6Mm3HByuhflhl4LOBiWxN+3i6/t/ZQQNii4tjksXi8r2CRW1wMpWA2ULUEw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@eslint/object-schema': 2.1.7 + debug: 4.4.1 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + dev: true + + /@eslint/config-array@0.21.1: + resolution: {integrity: sha512-aw1gNayWpdI/jSYVgzN5pL0cfzU02GT3NBpeT/DXbx1/1x7ZKxFPd9bwrzygx/qiwIQiJ1sw/zD8qY/kRvlGHA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@eslint/object-schema': 2.1.7 + debug: 4.4.1 + minimatch: 3.1.2 + transitivePeerDependencies: + - supports-color + + /@eslint/config-helpers@0.2.3: + resolution: {integrity: sha512-u180qk2Um1le4yf0ruXH3PYFeEZeYC3p/4wCTKrr2U1CmGdzGi3KtY0nuPDH48UJxlKCC5RDzbcbh4X0XlqgHg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dev: true + + /@eslint/config-helpers@0.3.1: + resolution: {integrity: sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + /@eslint/core@0.14.0: + resolution: {integrity: sha512-qIbV0/JZr7iSDjqAc60IqbLdsj9GDt16xQtWD+B78d/HAlvysGdZZ6rpJHGAc2T0FQx1X6thsSPdnoiGKdNtdg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@types/json-schema': 7.0.15 + dev: true + + /@eslint/core@0.15.2: + resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@types/json-schema': 7.0.15 + + /@eslint/eslintrc@3.3.0: + resolution: {integrity: sha512-yaVPAiNAalnCZedKLdR21GOGILMLKPyqSLWaAjQFvYA2i/ciDi8ArYVr69Anohb6cH2Ukhqti4aFnYyPm8wdwQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: ajv: 6.12.6 debug: 4.4.1 - espree: 9.6.1 - globals: 13.24.0 + espree: 10.4.0 + globals: 14.0.0 ignore: 5.2.4 import-fresh: 3.3.0 js-yaml: 4.1.0 @@ -7350,16 +7437,48 @@ packages: strip-json-comments: 3.1.1 transitivePeerDependencies: - supports-color + dev: true - /@eslint/js@8.57.0: - resolution: {integrity: sha512-Ys+3g2TaW7gADOJzPt83SJtCDhMjndcDMFVQ/Tj9iA1BfJzFKD9mAUXT3OenpuPHbI6P/myECxRJrofUsDx/5g==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@eslint/eslintrc@3.3.1: + resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + ajv: 6.12.6 + debug: 4.4.1 + espree: 10.4.0 + globals: 14.0.0 + ignore: 5.2.4 + import-fresh: 3.3.0 + js-yaml: 4.1.0 + minimatch: 3.1.2 + strip-json-comments: 3.1.1 + transitivePeerDependencies: + - supports-color - /@eslint/js@8.57.1: - resolution: {integrity: sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /@eslint/js@9.22.0: + resolution: {integrity: sha512-vLFajx9o8d1/oL2ZkpMYbkLv8nDB6yaIwFNt7nI4+I80U/z03SxmfOMsLbvWr3p7C+Wnoh//aOu2pQW8cS0HCQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + /@eslint/js@9.29.0: + resolution: {integrity: sha512-3PIF4cBw/y+1u2EazflInpV+lYsSG0aByVIQzAgb1m1MhHFSbqTyNqtBKHgWf/9Ykud+DhILS9EGkmekVhbKoQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dev: true + /@eslint/js@9.36.0: + resolution: {integrity: sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + /@eslint/object-schema@2.1.7: + resolution: {integrity: sha512-VtAOaymWVfZcmZbp6E2mympDIHvyjXs/12LqWYjVw6qjrfF+VK+fyG33kChz3nnK+SU5/NeHOqrTEHS8sXO3OA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + /@eslint/plugin-kit@0.3.5: + resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + '@eslint/core': 0.15.2 + levn: 0.4.1 + /@floating-ui/core@1.4.1: resolution: {integrity: sha512-jk3WqquEJRlcyu7997NtR5PibI+y5bi+LS3hPmguVClypenMsCY3CBa3LAQnozRCtCrYWSEtAdiskpamuJRFOQ==} dependencies: @@ -7620,41 +7739,24 @@ packages: resolution: {integrity: sha512-/KPde26khDUIPkTGU82jdtTW9UAuvUTumCAbFs/7giR0SxsvZC4hru51PBvpijH6BVkHcROcvZM/lpy5h1jRRA==} engines: {node: '>=18'} - /@humanwhocodes/config-array@0.11.14: - resolution: {integrity: sha512-3T8LkOmg45BV5FICb15QQMsyUSWrQ8AygVfC7ZG32zOalnqrilm018ZVCw0eapXux8FtA33q8PSRSstjee3jSg==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead - dependencies: - '@humanwhocodes/object-schema': 2.0.2 - debug: 4.4.1 - minimatch: 3.0.5 - transitivePeerDependencies: - - supports-color + /@humanfs/core@0.19.1: + resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} + engines: {node: '>=18.18.0'} - /@humanwhocodes/config-array@0.13.0: - resolution: {integrity: sha512-DZLEEqFWQFiyK6h5YIeynKx7JlvCYWL0cImfSRXZ9l4Sg2efkFGTuFf6vzXjK1cq6IYkU+Eg/JizXw+TD2vRNw==} - engines: {node: '>=10.10.0'} - deprecated: Use @eslint/config-array instead + /@humanfs/node@0.16.7: + resolution: {integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==} + engines: {node: '>=18.18.0'} dependencies: - '@humanwhocodes/object-schema': 2.0.3 - debug: 4.4.1 - minimatch: 3.0.5 - transitivePeerDependencies: - - supports-color - dev: true + '@humanfs/core': 0.19.1 + '@humanwhocodes/retry': 0.4.3 /@humanwhocodes/module-importer@1.0.1: resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - /@humanwhocodes/object-schema@2.0.2: - resolution: {integrity: sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==} - deprecated: Use @eslint/object-schema instead - - /@humanwhocodes/object-schema@2.0.3: - resolution: {integrity: sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==} - deprecated: Use @eslint/object-schema instead - dev: true + /@humanwhocodes/retry@0.4.3: + resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} + engines: {node: '>=18.18'} /@inquirer/external-editor@1.0.2(@types/node@18.19.130): resolution: {integrity: sha512-yy9cOoBnx58TlsPrIxauKIFQTiyH+0MK4e97y4sV9ERbI+zDxw7i2hxHLCIEGIE/8PPvDxGhgzIOTSOWcs6/MQ==} @@ -8323,11 +8425,6 @@ packages: '@nodelib/fs.scandir': 2.1.5 fastq: 1.17.1 - /@nolyfill/is-core-module@1.0.39: - resolution: {integrity: sha512-nn5ozdjYQpUCZlWGuxcJY/KpxkWQs4DcbMCmKojjyrYDEAGy4Ce19NN4v5MduafTwJlbKc99UA8YhSVqq9yPZA==} - engines: {node: '>=12.4.0'} - dev: true - /@npmcli/agent@2.2.0: resolution: {integrity: sha512-2yThA1Es98orMkpSLVqlDZAMPK3jHJhifP2gnNUdk1754uZ8yI5c+ulCoVG+WlntQA6MzhrURMXjSd9Z7dJ2/Q==} engines: {node: ^16.14.0 || >=18.0.0} @@ -8986,6 +9083,11 @@ packages: requiresBuild: true optional: true + /@pkgr/core@0.1.2: + resolution: {integrity: sha512-fdDH1LSGfZdTH2sxdpVMw31BanV28K/Gry0cVFxaNP77neJSkd82mM8ErPNYs9e+0O7SdHBLTDzDgwUuy18RnQ==} + engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} + dev: true + /@pkgr/core@0.2.9: resolution: {integrity: sha512-QNqXyfVS2wm9hweSYD2O7F0G06uurj9kZ96TRQE5Y9hU7+tgdZwIkbAKc5Ocy1HxEY2kuDQa6cQ1WRs/O5LFKA==} engines: {node: ^12.20.0 || ^14.18.0 || >=16.0.0} @@ -9098,7 +9200,7 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) + '@rollup/pluginutils': 5.3.0(rollup@3.29.5) commondir: 1.0.1 estree-walker: 2.0.2 glob: 8.1.0 @@ -9116,7 +9218,7 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) + '@rollup/pluginutils': 5.3.0(rollup@3.29.5) estree-walker: 2.0.2 magic-string: 0.30.11 rollup: 3.29.5 @@ -9131,12 +9233,12 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) + '@rollup/pluginutils': 5.3.0(rollup@3.29.5) rollup: 3.29.5 dev: true - /@rollup/plugin-node-resolve@15.3.0(rollup@3.29.5): - resolution: {integrity: sha512-9eO5McEICxMzJpDW9OnMYSv4Sta3hmt7VtBFz5zR9273suNOydOyq/FrGeGy+KsTRFm8w0SLVhzig2ILFT63Ag==} + /@rollup/plugin-node-resolve@15.3.1(rollup@3.29.5): + resolution: {integrity: sha512-tgg6b91pAybXHJQMAAwW9VuWBO6Thi+q7BCNARLwSqlmsHz0XYURtGvh/AuwSADXSI4h/2uHbs7s4FzlZDGSGA==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^2.78.0||^3.0.0||^4.0.0 @@ -9144,11 +9246,11 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) + '@rollup/pluginutils': 5.3.0(rollup@3.29.5) '@types/resolve': 1.20.2 deepmerge: 4.3.1 is-module: 1.0.0 - resolve: 1.22.8 + resolve: 1.22.11 rollup: 3.29.5 dev: true @@ -9161,13 +9263,13 @@ packages: rollup: optional: true dependencies: - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) + '@rollup/pluginutils': 5.3.0(rollup@3.29.5) magic-string: 0.30.11 rollup: 3.29.5 dev: true - /@rollup/pluginutils@5.1.3(rollup@3.29.5): - resolution: {integrity: sha512-Pnsb6f32CD2W3uCaLZIzDmeFyQ2b8UWMFI7xtwUezpcGBDVDW6y9XgAWIlARiGAo6eNF5FK5aQTr0LFyNyqq5A==} + /@rollup/pluginutils@5.3.0(rollup@3.29.5): + resolution: {integrity: sha512-5EdhGZtnu3V88ces7s53hhfK5KSASnJZv8Lulpc04cWO3REESroJXg73DFsOmgbU2BhwV0E20bu2IDZb3VKW4Q==} engines: {node: '>=14.0.0'} peerDependencies: rollup: ^1.20.0||^2.0.0||^3.0.0||^4.0.0 @@ -9175,7 +9277,7 @@ packages: rollup: optional: true dependencies: - '@types/estree': 1.0.6 + '@types/estree': 1.0.8 estree-walker: 2.0.2 picomatch: 4.0.3 rollup: 3.29.5 @@ -9724,7 +9826,7 @@ packages: path-browserify: 1.0.1 process: 0.11.10 semver: 7.7.1 - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) style-loader: 3.3.3(webpack@5.96.1) terser-webpack-plugin: 5.3.10(esbuild@0.19.2)(webpack@5.96.1) ts-dedent: 2.2.0 @@ -9765,7 +9867,7 @@ packages: peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 dependencies: - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) dev: true /@storybook/core-events@7.6.20: @@ -9780,11 +9882,11 @@ packages: storybook: ^8.4.2 dependencies: '@types/node': 22.9.0 - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) ts-dedent: 2.2.0 dev: true - /@storybook/core@8.4.2(prettier@2.8.8): + /@storybook/core@8.4.2(prettier@3.6.2): resolution: {integrity: sha512-hF8GWoUZTjwwuV5j4OLhMHZtZQL/NYcVUBReC2Ba06c8PkFIKqKZwATr1zKd301gQ5Qwcn9WgmZxJTMgdKQtOg==} peerDependencies: prettier: ^2 || ^3 @@ -9798,7 +9900,7 @@ packages: esbuild: 0.19.2 esbuild-register: 3.5.0(esbuild@0.19.2) jsdoc-type-pratt-parser: 4.0.0 - prettier: 2.8.8 + prettier: 3.6.2 process: 0.11.10 recast: 0.23.9 semver: 7.7.1 @@ -9853,7 +9955,7 @@ packages: peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 dependencies: - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) dev: true /@storybook/preset-react-webpack@8.4.2(esbuild@0.19.2)(react-dom@16.14.0)(react@16.14.0)(storybook@8.4.2)(typescript@5.9.3): @@ -9878,9 +9980,9 @@ packages: react: 16.14.0 react-docgen: 7.0.3 react-dom: 16.14.0(react@16.14.0) - resolve: 1.22.8 + resolve: 1.22.11 semver: 7.7.1 - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) tsconfig-paths: 4.2.0 typescript: 5.9.3 webpack: 5.96.1(esbuild@0.19.2) @@ -9917,7 +10019,7 @@ packages: peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 dependencies: - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) dev: true /@storybook/react-docgen-typescript-plugin@1.0.6--canary.9.0c3f3b7.0(typescript@5.9.3)(webpack@5.96.1): @@ -9948,7 +10050,7 @@ packages: dependencies: react: 16.14.0 react-dom: 16.14.0(react@16.14.0) - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) dev: true /@storybook/react-webpack5@8.4.2(esbuild@0.19.2)(react-dom@16.14.0)(react@16.14.0)(storybook@8.4.2)(typescript@5.9.3): @@ -9969,7 +10071,7 @@ packages: '@types/node': 22.9.0 react: 16.14.0 react-dom: 16.14.0(react@16.14.0) - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) typescript: 5.9.3 transitivePeerDependencies: - '@storybook/test' @@ -10003,7 +10105,7 @@ packages: '@storybook/theming': 8.4.2(storybook@8.4.2) react: 16.14.0 react-dom: 16.14.0(react@16.14.0) - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) typescript: 5.9.3 dev: true @@ -10034,7 +10136,7 @@ packages: peerDependencies: storybook: ^8.2.0 || ^8.3.0-0 || ^8.4.0-0 || ^8.5.0-0 || ^8.6.0-0 dependencies: - storybook: 8.4.2(prettier@2.8.8) + storybook: 8.4.2(prettier@3.6.2) dev: true /@storybook/types@7.6.20: @@ -10323,23 +10425,18 @@ packages: resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==} dependencies: '@types/eslint': 9.6.1 - '@types/estree': 1.0.6 + '@types/estree': 1.0.8 dev: true /@types/eslint@9.6.1: resolution: {integrity: sha512-FXx2pKgId/WyYo2jXw63kk7/+TY7u7AziEJxJAnSFzHlqTAS3Ync6SvgYAN/k4/PQpnnVuzoMuVnByKK2qp0ag==} dependencies: - '@types/estree': 1.0.6 + '@types/estree': 1.0.8 '@types/json-schema': 7.0.5 dev: true - /@types/estree@1.0.6: - resolution: {integrity: sha512-AYnb1nQyY49te+VRAVgmzfcgjYS91mY5P0TKUDCLEM+gNnA+3T6rWITXRLYCpahpqSQbN5cE+gHpnPyXjHWxcw==} - dev: true - /@types/estree@1.0.8: resolution: {integrity: sha512-dWHzHa2WqEXI/O1E9OjrocMTKJl2mSrEolh1Iomrv6U+JuNwaHXsXx9bLu5gG7BUWFIN0skIQJQ/L1rIex4X6w==} - dev: true /@types/expect@1.20.4: resolution: {integrity: sha512-Q5Vn3yjTDyCMV50TB6VRIbQNxSE4OmZR86VSbGaNpfUolm0iePBB4KdEEHmxoY5sT2+2DIvXW0rvMDP2nHZ4Mg==} @@ -10507,8 +10604,8 @@ packages: '@types/node': 20.0.0 dev: false - /@types/linkify-it@3.0.3: - resolution: {integrity: sha512-pTjcqY9E4nOI55Wgpz7eiI8+LzdYnw3qxXCfHyBDdPbYvbyLgWLJGh8EdPvqawwMK1Uo1794AUkkR38Fr0g+2g==} + /@types/linkify-it@5.0.0: + resolution: {integrity: sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==} dev: true /@types/livereload@0.9.5: @@ -10524,11 +10621,11 @@ packages: /@types/long@4.0.2: resolution: {integrity: sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==} - /@types/markdown-it@12.2.3: - resolution: {integrity: sha512-GKMHFfv3458yYy+v/N8gjufHO6MSZKCOXpZc5GXIWWy8uldwfmPn98vp81gZ5f9SVw8YYBctgfJ22a2d7AOMeQ==} + /@types/markdown-it@14.1.2: + resolution: {integrity: sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==} dependencies: - '@types/linkify-it': 3.0.3 - '@types/mdurl': 1.0.2 + '@types/linkify-it': 5.0.0 + '@types/mdurl': 2.0.0 dev: true /@types/mdast@3.0.15: @@ -10537,8 +10634,8 @@ packages: '@types/unist': 2.0.10 dev: false - /@types/mdurl@1.0.2: - resolution: {integrity: sha512-eC4U9MlIcu2q0KQmXszyn5Akca/0jrQmwDRgpAMJai7qBWq4amIQhZyNau4VYGtCeALvW1/NtjzJJ567aZxfKA==} + /@types/mdurl@2.0.0: + resolution: {integrity: sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==} dev: true /@types/mem-fs-editor@7.0.1: @@ -10546,9 +10643,9 @@ packages: dependencies: '@types/ejs': 3.1.2 '@types/glob': 8.1.0 - '@types/json-schema': 7.0.15 + '@types/json-schema': 7.0.5 '@types/mem-fs': 1.1.2 - '@types/node': 18.11.9 + '@types/node': 20.0.0 '@types/vinyl': 2.0.7 dev: true @@ -10747,6 +10844,7 @@ packages: /@types/semver@7.7.0: resolution: {integrity: sha512-k107IF4+Xr7UHjwDc7Cfd6PRQfbdkiRabXGRjo07b4WyPahFBZCZ1sE+BNxYIJPPg73UkfOsVOLwqVc/6ETrIA==} + dev: true /@types/send@0.17.1: resolution: {integrity: sha512-Cwo8LE/0rnvX7kIIa3QHCkcuF21c05Ayb0ZfxPiv0W8VRiZiNW/WuRupHKpqqGVGf7SUA44QSOUKaEd9lIrd/Q==} @@ -10931,151 +11029,58 @@ packages: '@types/yeoman-generator': 5.2.14 dev: true - /@typescript-eslint/eslint-plugin@5.62.0(@typescript-eslint/parser@5.62.0)(eslint@8.57.1)(typescript@5.9.3): - resolution: {integrity: sha512-TiZzBSJja/LbhNPvk6yc0JrX9XqhQ0hdh6M2svYfsHGejaKFIAGd9MQ+ERIMzLGlN/kZoYIgdxFV0PuljTKXag==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - '@typescript-eslint/parser': ^5.0.0 - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.8.1 - '@typescript-eslint/parser': 5.62.0(eslint@8.57.1)(typescript@5.9.3) - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/type-utils': 5.62.0(eslint@8.57.1)(typescript@5.9.3) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.9.3) - debug: 4.3.5 - eslint: 8.57.1 - graphemer: 1.4.0 - ignore: 5.2.4 - natural-compare-lite: 1.4.0 - semver: 7.5.4 - tsutils: 3.21.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/eslint-plugin@7.18.0(@typescript-eslint/parser@7.18.0)(eslint@8.57.1)(typescript@5.9.3): - resolution: {integrity: sha512-94EQTWZ40mzBc42ATNIBimBEDltSJ9RQHCC8vc/PDbxi4k8dVwUAv4o98dk50M1zB+JGFxp43FP7f8+FP8R6Sw==} - engines: {node: ^18.18.0 || >=20.0.0} - peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@eslint-community/regexpp': 4.11.0 - '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.9.3) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/type-utils': 7.18.0(eslint@8.57.1)(typescript@5.9.3) - '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 7.18.0 - eslint: 8.57.1 - graphemer: 1.4.0 - ignore: 5.3.2 - natural-compare: 1.4.0 - ts-api-utils: 1.3.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/eslint-plugin@7.2.0(@typescript-eslint/parser@7.2.0)(eslint@8.57.0)(typescript@5.9.3): - resolution: {integrity: sha512-mdekAHOqS9UjlmyF/LSs6AIEvfceV749GFxoBAjwAv0nkevfKHWQFDMcBZWUiIC5ft6ePWivXoS36aKQ0Cy3sw==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/eslint-plugin@8.46.2(@typescript-eslint/parser@8.46.2)(eslint@9.36.0)(typescript@5.9.3): + resolution: {integrity: sha512-ZGBMToy857/NIPaaCucIUQgqueOiq7HeAKkhlvqVV4lm089zUFW6ikRySx2v+cAhKeUCPuWVHeimyk6Dw1iY3w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^7.0.0 - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + '@typescript-eslint/parser': ^8.46.2 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' dependencies: - '@eslint-community/regexpp': 4.8.1 - '@typescript-eslint/parser': 7.2.0(eslint@8.57.0)(typescript@5.9.3) - '@typescript-eslint/scope-manager': 7.2.0 - '@typescript-eslint/type-utils': 7.2.0(eslint@8.57.0)(typescript@5.9.3) - '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 7.2.0 - debug: 4.3.4 - eslint: 8.57.0 + '@eslint-community/regexpp': 4.12.2 + '@typescript-eslint/parser': 8.46.2(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/scope-manager': 8.46.2 + '@typescript-eslint/type-utils': 8.46.2(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/utils': 8.46.2(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.46.2 + eslint: 9.36.0 graphemer: 1.4.0 - ignore: 5.2.4 + ignore: 7.0.3 natural-compare: 1.4.0 - semver: 7.6.3 - ts-api-utils: 1.2.1(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - dev: false - - /@typescript-eslint/parser@5.62.0(eslint@8.57.1)(typescript@5.9.3): - resolution: {integrity: sha512-VlJEV0fOQ7BExOsHYAGrgbEiZoi8D+Bl2+f6V2RrXerRSylnp+ZBHmPvaIa8cz0Ajx7WO7Z5RqfgYg7ED1nRhA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/scope-manager': 5.62.0 - '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.3) - debug: 4.3.5 - eslint: 8.57.1 + ts-api-utils: 2.1.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color - dev: true - /@typescript-eslint/parser@7.18.0(eslint@8.57.1)(typescript@5.9.3): - resolution: {integrity: sha512-4Z+L8I2OqhZV8qA132M4wNL30ypZGYOQVBfMgxDH/K5UX0PNqTu1c6za9ST5r9+tavvHiTWmBnKzpCJ/GlVFtg==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/parser@8.46.2(eslint@9.36.0)(typescript@5.9.3): + resolution: {integrity: sha512-BnOroVl1SgrPLywqxyqdJ4l3S2MsKVLDVxZvjI1Eoe8ev2r3kGDo+PcMihNmDE+6/KjkTubSJnmqGZZjQSBq/g==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' dependencies: - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 7.18.0 - debug: 4.3.6 - eslint: 8.57.1 + '@typescript-eslint/scope-manager': 8.46.2 + '@typescript-eslint/types': 8.46.2 + '@typescript-eslint/typescript-estree': 8.46.2(typescript@5.9.3) + '@typescript-eslint/visitor-keys': 8.46.2 + debug: 4.4.1 + eslint: 9.36.0 typescript: 5.9.3 transitivePeerDependencies: - supports-color - dev: true - /@typescript-eslint/parser@7.2.0(eslint@8.57.0)(typescript@5.9.3): - resolution: {integrity: sha512-5FKsVcHTk6TafQKQbuIVkXq58Fnbkd2wDL4LB7AURN7RUOu1utVP+G8+6u3ZhEroW3DF6hyo3ZEXxgKgp4KeCg==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/project-service@8.46.2(typescript@5.9.3): + resolution: {integrity: sha512-PULOLZ9iqwI7hXcmL4fVfIsBi6AN9YxRc0frbvmg8f+4hQAjQ5GYNKK0DIArNo+rOKmR/iBYwkpBmnIwin4wBg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <6.0.0' dependencies: - '@typescript-eslint/scope-manager': 7.2.0 - '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.9.3) - '@typescript-eslint/visitor-keys': 7.2.0 - debug: 4.3.4 - eslint: 8.57.0 + '@typescript-eslint/tsconfig-utils': 8.46.2(typescript@5.9.3) + '@typescript-eslint/types': 8.46.2 + debug: 4.4.1 typescript: 5.9.3 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/scope-manager@5.62.0: resolution: {integrity: sha512-VXuvVvZeQCQb5Zgf4HAxc04q5j+WrNAtNh9OwCsCgpKqESMTu3tF/jhZ3xG6T4NZwWl65Bg8KuS2uEvhSfLl0w==} @@ -11085,96 +11090,46 @@ packages: '@typescript-eslint/visitor-keys': 5.62.0 dev: true - /@typescript-eslint/scope-manager@7.18.0: - resolution: {integrity: sha512-jjhdIE/FPF2B7Z1uzc6i3oWKbGcHb87Qw7AWj6jmEqNOfDFbJWtjt/XfwCpvNkpGWlcJaog5vTR+VV8+w9JflA==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/scope-manager@8.46.2: + resolution: {integrity: sha512-LF4b/NmGvdWEHD2H4MsHD8ny6JpiVNDzrSZr3CsckEgCbAGZbYM4Cqxvi9L+WqDMT+51Ozy7lt2M+d0JLEuBqA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 - dev: true - - /@typescript-eslint/scope-manager@7.2.0: - resolution: {integrity: sha512-Qh976RbQM/fYtjx9hs4XkayYujB/aPwglw2choHmf3zBjB4qOywWSdt9+KLRdHubGcoSwBnXUH2sR3hkyaERRg==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/visitor-keys': 7.2.0 - dev: false - - /@typescript-eslint/type-utils@5.62.0(eslint@8.57.1)(typescript@5.9.3): - resolution: {integrity: sha512-xsSQreu+VnfbqQpW5vnCJdq1Z3Q0U31qiWmRhr98ONQmcp/yhiPJFPq8MXiJVLiksmOKSjIldZzkebzHuCGzew==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - peerDependencies: - eslint: '*' - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.3) - '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.9.3) - debug: 4.4.1 - eslint: 8.57.1 - tsutils: 3.21.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - dev: true + '@typescript-eslint/types': 8.46.2 + '@typescript-eslint/visitor-keys': 8.46.2 - /@typescript-eslint/type-utils@7.18.0(eslint@8.57.1)(typescript@5.9.3): - resolution: {integrity: sha512-XL0FJXuCLaDuX2sYqZUUSOJ2sG5/i1AAze+axqmLnSkNEVMVYLF+cbwlB2w8D1tinFuSikHmFta+P+HOofrLeA==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/tsconfig-utils@8.46.2(typescript@5.9.3): + resolution: {integrity: sha512-a7QH6fw4S57+F5y2FIxxSDyi5M4UfGF+Jl1bCGd7+L4KsaUY80GsiF/t0UoRFDHAguKlBaACWJRmdrc6Xfkkag==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <6.0.0' dependencies: - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3) - '@typescript-eslint/utils': 7.18.0(eslint@8.57.1)(typescript@5.9.3) - debug: 4.4.1 - eslint: 8.57.1 - ts-api-utils: 1.3.0(typescript@5.9.3) typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - dev: true - /@typescript-eslint/type-utils@7.2.0(eslint@8.57.0)(typescript@5.9.3): - resolution: {integrity: sha512-xHi51adBHo9O9330J8GQYQwrKBqbIPJGZZVQTHHmy200hvkLZFWJIFtAG/7IYTWUyun6DE6w5InDReePJYJlJA==} - engines: {node: ^16.0.0 || >=18.0.0} + /@typescript-eslint/type-utils@8.46.2(eslint@9.36.0)(typescript@5.9.3): + resolution: {integrity: sha512-HbPM4LbaAAt/DjxXaG9yiS9brOOz6fabal4uvUmaUYe6l3K1phQDMQKBRUrr06BQkxkvIZVVHttqiybM9nJsLA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' dependencies: - '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.9.3) - '@typescript-eslint/utils': 7.2.0(eslint@8.57.0)(typescript@5.9.3) + '@typescript-eslint/types': 8.46.2 + '@typescript-eslint/typescript-estree': 8.46.2(typescript@5.9.3) + '@typescript-eslint/utils': 8.46.2(eslint@9.36.0)(typescript@5.9.3) debug: 4.4.1 - eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.9.3) + eslint: 9.36.0 + ts-api-utils: 2.1.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color - dev: false /@typescript-eslint/types@5.62.0: resolution: {integrity: sha512-87NVngcbVXUahrRTqIK27gD2t5Cu1yuCXxbLcFtCzZGlfyVWWh8mLHkoxzjsB6DDNnvdL+fW8MiwPEJyGJQDgQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dev: true - /@typescript-eslint/types@7.18.0: - resolution: {integrity: sha512-iZqi+Ds1y4EDYUtlOOC+aUmxnE9xS/yCigkjA7XpTKV6nCBd3Hp/PRGGmdwnfkV2ThMyYldP1wRpm/id99spTQ==} - engines: {node: ^18.18.0 || >=20.0.0} - dev: true - - /@typescript-eslint/types@7.2.0: - resolution: {integrity: sha512-XFtUHPI/abFhm4cbCDc5Ykc8npOKBSJePY3a3s+lwumt7XWJuzP5cZcfZ610MIPHjQjNsOLlYK8ASPaNG8UiyA==} - engines: {node: ^16.0.0 || >=18.0.0} - dev: false + /@typescript-eslint/types@8.46.2: + resolution: {integrity: sha512-lNCWCbq7rpg7qDsQrd3D6NyWYu+gkTENkG5IKYhUIcxSb59SQC/hEQ+MrG4sTgBVghTonNWq42bA/d4yYumldQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} /@typescript-eslint/typescript-estree@5.62.0(typescript@5.9.3): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} @@ -11197,63 +11152,39 @@ packages: - supports-color dev: true - /@typescript-eslint/typescript-estree@7.18.0(typescript@5.9.3): - resolution: {integrity: sha512-aP1v/BSPnnyhMHts8cf1qQ6Q1IFwwRvAQGRvBFkWlo3/lH29OXA3Pts+c10nxRxIBrDnoMqzhgdwVe5f2D6OzA==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/typescript-estree@8.46.2(typescript@5.9.3): + resolution: {integrity: sha512-f7rW7LJ2b7Uh2EiQ+7sza6RDZnajbNbemn54Ob6fRwQbgcIn+GWfyuHDHRYgRoZu1P4AayVScrRW+YfbTvPQoQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true + typescript: '>=4.8.4 <6.0.0' dependencies: - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/visitor-keys': 7.18.0 + '@typescript-eslint/project-service': 8.46.2(typescript@5.9.3) + '@typescript-eslint/tsconfig-utils': 8.46.2(typescript@5.9.3) + '@typescript-eslint/types': 8.46.2 + '@typescript-eslint/visitor-keys': 8.46.2 debug: 4.4.1 - globby: 11.1.0 + fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 semver: 7.7.1 - ts-api-utils: 1.3.0(typescript@5.9.3) - typescript: 5.9.3 - transitivePeerDependencies: - - supports-color - dev: true - - /@typescript-eslint/typescript-estree@7.2.0(typescript@5.9.3): - resolution: {integrity: sha512-cyxS5WQQCoBwSakpMrvMXuMDEbhOo9bNHHrNcEWis6XHx6KF518tkF1wBvKIn/tpq5ZpUYK7Bdklu8qY0MsFIA==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - typescript: '*' - peerDependenciesMeta: - typescript: - optional: true - dependencies: - '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/visitor-keys': 7.2.0 - debug: 4.4.1 - globby: 11.1.0 - is-glob: 4.0.3 - minimatch: 9.0.3 - semver: 7.7.1 - ts-api-utils: 1.3.0(typescript@5.9.3) + ts-api-utils: 2.1.0(typescript@5.9.3) typescript: 5.9.3 transitivePeerDependencies: - supports-color - dev: false - /@typescript-eslint/utils@5.62.0(eslint@8.57.1)(typescript@5.9.3): + /@typescript-eslint/utils@5.62.0(eslint@9.29.0)(typescript@5.9.3): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.29.0) '@types/json-schema': 7.0.15 '@types/semver': 7.7.0 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.9.3) - eslint: 8.57.1 + eslint: 9.29.0 eslint-scope: 5.1.1 semver: 7.7.1 transitivePeerDependencies: @@ -11261,40 +11192,21 @@ packages: - typescript dev: true - /@typescript-eslint/utils@7.18.0(eslint@8.57.1)(typescript@5.9.3): - resolution: {integrity: sha512-kK0/rNa2j74XuHVcoCZxdFBMF+aq/vH83CXAOHieC+2Gis4mF8jJXT5eAfyD3K0sAxtPuwxaIOIOvhwzVDt/kw==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/utils@8.46.2(eslint@9.36.0)(typescript@5.9.3): + resolution: {integrity: sha512-sExxzucx0Tud5tE0XqR0lT0psBQvEpnpiul9XbGUB1QwpWJJAps1O/Z7hJxLGiZLBKMCutjTzDgmd1muEhBnVg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - eslint: ^8.56.0 + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) - '@typescript-eslint/scope-manager': 7.18.0 - '@typescript-eslint/types': 7.18.0 - '@typescript-eslint/typescript-estree': 7.18.0(typescript@5.9.3) - eslint: 8.57.1 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0) + '@typescript-eslint/scope-manager': 8.46.2 + '@typescript-eslint/types': 8.46.2 + '@typescript-eslint/typescript-estree': 8.46.2(typescript@5.9.3) + eslint: 9.36.0 + typescript: 5.9.3 transitivePeerDependencies: - supports-color - - typescript - dev: true - - /@typescript-eslint/utils@7.2.0(eslint@8.57.0)(typescript@5.9.3): - resolution: {integrity: sha512-YfHpnMAGb1Eekpm3XRK8hcMwGLGsnT6L+7b2XyRv6ouDuJU1tZir1GS2i0+VXRatMwSI1/UfcyPe53ADkU+IuA==} - engines: {node: ^16.0.0 || >=18.0.0} - peerDependencies: - eslint: ^8.56.0 - dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@types/json-schema': 7.0.15 - '@types/semver': 7.7.0 - '@typescript-eslint/scope-manager': 7.2.0 - '@typescript-eslint/types': 7.2.0 - '@typescript-eslint/typescript-estree': 7.2.0(typescript@5.9.3) - eslint: 8.57.0 - semver: 7.7.1 - transitivePeerDependencies: - - supports-color - - typescript - dev: false /@typescript-eslint/visitor-keys@5.62.0: resolution: {integrity: sha512-07ny+LHRzQXepkGg6w0mFY41fVUNBrL2Roj/++7V1txKugfjm/Ci/qSND03r2RhlJhJYMcTn9AhhSSqQp0Ysyw==} @@ -11304,27 +11216,18 @@ packages: eslint-visitor-keys: 3.4.3 dev: true - /@typescript-eslint/visitor-keys@7.18.0: - resolution: {integrity: sha512-cDF0/Gf81QpY3xYyJKDV14Zwdmid5+uuENhjH2EqFaF0ni+yAyq/LzMaIJdhNJXZI7uLzwIlA+V7oWoyn6Curg==} - engines: {node: ^18.18.0 || >=20.0.0} + /@typescript-eslint/visitor-keys@8.46.2: + resolution: {integrity: sha512-tUFMXI4gxzzMXt4xpGJEsBsTox0XbNQ1y94EwlD/CuZwFcQP79xfQqMhau9HsRc/J0cAPA/HZt1dZPtGn9V/7w==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: - '@typescript-eslint/types': 7.18.0 - eslint-visitor-keys: 3.4.3 - dev: true - - /@typescript-eslint/visitor-keys@7.2.0: - resolution: {integrity: sha512-c6EIQRHhcpl6+tO8EMR+kjkkV+ugUNXOmeASA1rlzkd8EPIriavpWoiEz1HR/VLhbVIdhqnV6E7JZm00cBDx2A==} - engines: {node: ^16.0.0 || >=18.0.0} - dependencies: - '@typescript-eslint/types': 7.2.0 - eslint-visitor-keys: 3.4.3 - dev: false + '@typescript-eslint/types': 8.46.2 + eslint-visitor-keys: 4.2.1 /@ui5/builder@3.2.0: resolution: {integrity: sha512-n6Z34iandeGPUS2x0OM7AdEvmnLbqqk9mfGuismuWx8gov2cawuJ/42B0BLamXRmlTqFPB7eGnaWry9tDK6h3Q==} engines: {node: ^16.18.0 || >=18.12.0, npm: '>= 8'} dependencies: - '@jridgewell/sourcemap-codec': 1.5.0 + '@jridgewell/sourcemap-codec': 1.5.5 '@ui5/fs': 3.0.5 '@ui5/logger': 3.0.0 cheerio: 1.0.0-rc.12 @@ -11332,12 +11235,12 @@ packages: escope: 4.0.0 espree: 9.6.1 graceful-fs: 4.2.11 - jsdoc: 4.0.2 + jsdoc: 4.0.5 less-openui5: 0.11.6 pretty-data: 0.40.0 rimraf: 5.0.10 semver: 7.7.1 - terser: 5.32.0 + terser: 5.44.0 workerpool: 6.5.1 xml2js: 0.6.2 dev: true @@ -11345,13 +11248,14 @@ packages: /@ui5/cli@3.8.0: resolution: {integrity: sha512-WG02WItJBjWya/+6ulcld6eE7Y+QalTNoLZ4uVsD53q9UqImLRVCOa1O9r865EvlmypIjpxkY9s0cDVRy1m8eQ==} engines: {node: ^16.18.0 || >=18.12.0, npm: '>= 8'} + hasBin: true dependencies: '@ui5/builder': 3.2.0 '@ui5/fs': 3.0.5 '@ui5/logger': 3.0.0 '@ui5/project': 3.9.0 '@ui5/server': 3.1.5 - chalk: 5.3.0 + chalk: 5.6.2 data-with-position: 0.5.0 import-local: 3.2.0 js-yaml: 4.1.0 @@ -11392,14 +11296,14 @@ packages: micromatch: 4.0.8 minimatch: 9.0.5 pretty-hrtime: 1.0.3 - random-int: 3.0.0 + random-int: 3.1.0 dev: true /@ui5/logger@3.0.0: resolution: {integrity: sha512-Np9pHhr+dnyL2gDFwIx6c6Xy0yhtpBIqUQM9An8uLX/wIcRjIjBSQ/r16o3YgS9roY59I/uj5ZEbIa1cdS3Dzg==} engines: {node: ^16.18.0 || >=18.12.0, npm: '>= 8'} dependencies: - chalk: 5.3.0 + chalk: 5.6.2 cli-progress: 3.12.0 figures: 5.0.0 dev: true @@ -11447,7 +11351,7 @@ packages: '@ui5/fs': 3.0.5 '@ui5/logger': 3.0.0 body-parser: 1.20.3 - compression: 1.7.4 + compression: 1.8.1 cors: 2.8.5 devcert-sanscache: 0.4.8 escape-html: 1.0.3 @@ -11466,9 +11370,6 @@ packages: - supports-color dev: true - /@ungap/structured-clone@1.2.0: - resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} - /@ungap/structured-clone@1.3.0: resolution: {integrity: sha512-WmoN8qaIAo7WTYWbAZuG8PYEhn5fkz7dZrqTBZ7dtt//lL2Gwms1IcnQ5yHqjDfX8Ft5j4YzDM23f87zBfDe9g==} dev: true @@ -11627,6 +11528,128 @@ packages: dev: true optional: true + /@unrs/rspack-resolver-binding-darwin-arm64@1.3.0: + resolution: {integrity: sha512-EcjI0Hh2HiNOM0B9UuYH1PfLWgE6/SBQ4dKoHXWNloERfveha/n6aUZSBThtPGnJenmdfaJYXXZtqyNbWtJAFw==} + cpu: [arm64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-darwin-x64@1.3.0: + resolution: {integrity: sha512-3CgG+mhfudDfnaDqwEl0W1mcGTto5f5mqPyJSXcWDxrnNc7pr/p01khIgWOoOD1eCwVejmgpYvRKGBwJPwgHOQ==} + cpu: [x64] + os: [darwin] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-freebsd-x64@1.3.0: + resolution: {integrity: sha512-ww8BwryDrpXlSajwSIEUXEv8oKDkw04L2ke3hxjaxWohuBV8pAQie9XBS4yQTyREuL2ypcqbARfoCXJJzVp7ig==} + cpu: [x64] + os: [freebsd] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-linux-arm-gnueabihf@1.3.0: + resolution: {integrity: sha512-WyhonI1mkuAlnG2iaMjk7uy4aWX+FWi2Au8qCCwj57wVHbAEfrN6xN2YhzbrsCC+ciumKhj5c01MqwsnYDNzWQ==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-linux-arm-musleabihf@1.3.0: + resolution: {integrity: sha512-+uCP6hIAMVWHKQnLZHESJ1U1TFVGLR3FTeaS2A4zB0k8w+IbZlWwl9FiBUOwOiqhcCCyKiUEifgnYFNGpxi3pw==} + cpu: [arm] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-linux-arm64-gnu@1.3.0: + resolution: {integrity: sha512-p+s/Wp8rf75Qqs2EPw4HC0xVLLW+/60MlVAsB7TYLoeg1e1CU/QCis36FxpziLS0ZY2+wXdTnPUxr+5kkThzwQ==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-linux-arm64-musl@1.3.0: + resolution: {integrity: sha512-cZEL9jmZ2kAN53MEk+fFCRJM8pRwOEboDn7sTLjZW+hL6a0/8JNfHP20n8+MBDrhyD34BSF4A6wPCj/LNhtOIQ==} + cpu: [arm64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-linux-ppc64-gnu@1.3.0: + resolution: {integrity: sha512-IOeRhcMXTNlk2oApsOozYVcOHu4t1EKYKnTz4huzdPyKNPX0Y9C7X8/6rk4aR3Inb5s4oVMT9IVKdgNXLcpGAQ==} + cpu: [ppc64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-linux-s390x-gnu@1.3.0: + resolution: {integrity: sha512-op54XrlEbhgVRCxzF1pHFcLamdOmHDapwrqJ9xYRB7ZjwP/zQCKzz/uAsSaAlyQmbSi/PXV7lwfca4xkv860/Q==} + cpu: [s390x] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-linux-x64-gnu@1.3.0: + resolution: {integrity: sha512-orbQF7sN02N/b9QF8Xp1RBO5YkfI+AYo9VZw0H2Gh4JYWSuiDHjOPEeFPDIRyWmXbQJuiVNSB+e1pZOjPPKIyg==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-linux-x64-musl@1.3.0: + resolution: {integrity: sha512-kpjqjIAC9MfsjmlgmgeC8U9gZi6g/HTuCqpI7SBMjsa7/9MvBaQ6TJ7dtnsV/+DXvfJ2+L5teBBXG+XxfpvIFA==} + cpu: [x64] + os: [linux] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-wasm32-wasi@1.3.0: + resolution: {integrity: sha512-JAg0hY3kGsCPk7Jgh16yMTBZ6VEnoNR1DFZxiozjKwH+zSCfuDuM5S15gr50ofbwVw9drobIP2TTHdKZ15MJZQ==} + engines: {node: '>=14.0.0'} + cpu: [wasm32] + requiresBuild: true + dependencies: + '@napi-rs/wasm-runtime': 0.2.12 + dev: true + optional: true + + /@unrs/rspack-resolver-binding-win32-arm64-msvc@1.3.0: + resolution: {integrity: sha512-h5N83i407ntS3ndDkhT/3vC3Dj8oP0BIwMtekETNJcxk7IuWccSXifzCEhdxxu/FOX4OICGIHdHrxf5fJuAjfw==} + cpu: [arm64] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-win32-ia32-msvc@1.3.0: + resolution: {integrity: sha512-9QH7Gq3dRL8Q/D6PGS3Dwtjx9yw6kbCEu6iBkAUhFTDAuVUk2L0H/5NekRVA13AQaSc3OsEUKt60EOn/kq5Dug==} + cpu: [ia32] + os: [win32] + requiresBuild: true + dev: true + optional: true + + /@unrs/rspack-resolver-binding-win32-x64-msvc@1.3.0: + resolution: {integrity: sha512-IYuXJCuwBOVV0H73l6auaZwtAPHjCPBJkxd4Co0yO6dSjDM5Na5OceaxhUmJLZ3z8kuEGhTYWIHH7PchGztnlg==} + cpu: [x64] + os: [win32] + requiresBuild: true + dev: true + optional: true + /@vscode-logging/logger@2.0.0: resolution: {integrity: sha512-m5AsHLqNyC8OYmpXf4bA5Hm2gSrJcc2L7KUfA8wMH/GFDexeNSTi/O6rDdWFawxLZg3uQGETDx8xyMfMqCDp+w==} dependencies: @@ -11941,16 +11964,16 @@ packages: event-target-shim: 5.0.1 dev: false - /abstract-syntax-tree@2.21.0: - resolution: {integrity: sha512-YJ+q/DgsNM+cp4vVFr67BhaFtSKeIGzNkH8UZzqOMCl86DZb1QraPVHb99jJFn6CaA3W+yileAkx0s8Xbs0DFg==} - engines: {node: '>=14.0.0'} + /abstract-syntax-tree@2.22.0: + resolution: {integrity: sha512-Px1YA1lvdQN/DGqyZ4rIp6LH8mEtRcyFYZw48cYQ/fK0r7QffIPkEV2ob3g804aS9OjUwuKoqhPTKb3kvZVhug==} + engines: {node: '>=20.11.1'} dependencies: ast-types: 0.14.2 - astring: 1.8.6 + astring: 1.9.0 esquery: 1.6.0 - meriyah: 4.3.7 + meriyah: 4.5.0 pure-conditions: 1.2.1 - source-map: 0.7.4 + source-map: 0.7.6 dev: true /accepts@1.3.8: @@ -11991,12 +12014,12 @@ packages: acorn: 8.15.0 dev: true - /acorn-jsx@5.3.2(acorn@8.14.1): + /acorn-jsx@5.3.2(acorn@8.15.0): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} peerDependencies: acorn: ^6.0.0 || ^7.0.0 || ^8.0.0 dependencies: - acorn: 8.14.1 + acorn: 8.15.0 /acorn-walk@8.2.0: resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} @@ -12065,7 +12088,7 @@ packages: function.prototype.name: 1.1.5 is-regex: 1.1.4 object-is: 1.1.5 - object.assign: 4.1.5 + object.assign: 4.1.7 object.entries: 1.1.6 prop-types: 15.8.1 prop-types-exact: 1.2.0 @@ -12313,18 +12336,10 @@ packages: /array-buffer-byte-length@1.0.0: resolution: {integrity: sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 is-array-buffer: 3.0.2 dev: true - /array-buffer-byte-length@1.0.1: - resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - is-array-buffer: 3.0.4 - dev: true - /array-buffer-byte-length@1.0.2: resolution: {integrity: sha512-LHE+8BuR7RYGDKvnrmcuSq3tDcKv9OFEXQt/HpbZhY7V6h0zlUXutnAD82GiFx9rdieCMjkvtcsPqBwgUl1Iiw==} engines: {node: '>= 0.4'} @@ -12344,18 +12359,6 @@ packages: resolution: {integrity: sha512-zPMVc3ZYlGLNk4mpK1NzP2wg0ml9t7fUgDsayR5Y5rSzxQilzR9FGu/EH2jQOcKSAeAfWeylyW8juy3OkWRvNA==} dev: true - /array-includes@3.1.8: - resolution: {integrity: sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.1.1 - get-intrinsic: 1.3.0 - is-string: 1.0.7 - dev: true - /array-includes@3.1.9: resolution: {integrity: sha512-FmeCCAenzH0KH381SPT5FZmiA/TmpndpcaShhfgEN9eCVjnFBqq3l1xrI42y8+PPLI6hypzou4GXw00WHmPBLQ==} engines: {node: '>= 0.4'} @@ -12391,10 +12394,22 @@ packages: /array.prototype.find@2.2.0: resolution: {integrity: sha512-sn40qmUiLYAcRb/1HsIQjTTZ1kCy8II8VtZJpMn2Aoen9twULhbWXisfh3HimGqMlHGUul0/TfKCnXg42LuPpQ==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + define-properties: 1.2.1 + es-abstract: 1.24.0 + es-shim-unscopables: 1.1.0 + dev: true + + /array.prototype.findlast@1.2.5: + resolution: {integrity: sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==} + engines: {node: '>= 0.4'} + dependencies: + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 + es-abstract: 1.24.0 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 + es-shim-unscopables: 1.1.0 dev: true /array.prototype.findlastindex@1.2.6: @@ -12426,17 +12441,7 @@ packages: call-bind: 1.0.8 define-properties: 1.2.1 es-abstract: 1.24.0 - es-shim-unscopables: 1.0.2 - dev: true - - /array.prototype.flatmap@1.3.2: - resolution: {integrity: sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 + es-shim-unscopables: 1.1.0 dev: true /array.prototype.flatmap@1.3.3: @@ -12446,17 +12451,18 @@ packages: call-bind: 1.0.8 define-properties: 1.2.1 es-abstract: 1.24.0 - es-shim-unscopables: 1.0.2 + es-shim-unscopables: 1.1.0 dev: true - /array.prototype.tosorted@1.1.1: - resolution: {integrity: sha512-pZYPXPRl2PqWcsUs6LOMn+1f1532nEoPTYowBtqLwAW+W8vSVhkIGnmOX1t/UQjD6YGI0vcD2B1U7ZFGQH9jnQ==} + /array.prototype.tosorted@1.1.4: + resolution: {integrity: sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==} + engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 - es-shim-unscopables: 1.0.2 - get-intrinsic: 1.3.0 + es-abstract: 1.24.0 + es-errors: 1.3.0 + es-shim-unscopables: 1.1.0 dev: true /arraybuffer.prototype.slice@1.0.1: @@ -12464,27 +12470,13 @@ packages: engines: {node: '>= 0.4'} dependencies: array-buffer-byte-length: 1.0.0 - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 get-intrinsic: 1.3.0 is-array-buffer: 3.0.2 is-shared-array-buffer: 1.0.2 dev: true - /arraybuffer.prototype.slice@1.0.3: - resolution: {integrity: sha512-bMxMKAjg13EBSVscxTaYA4mRc5t1UAXa2kXiGTNfZ079HIWXEkKmkgFrh/nJqamaLSrXO5H4WFFkPEaLJWbs3A==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.1 - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-errors: 1.3.0 - get-intrinsic: 1.3.0 - is-array-buffer: 3.0.4 - is-shared-array-buffer: 1.0.3 - dev: true - /arraybuffer.prototype.slice@1.0.4: resolution: {integrity: sha512-BNoCY6SXXPQ7gF2opIP4GBE+Xw7U+pHMYKuzjgCN3GwiaIR09UUeKfheyIry77QtrCBlC0KK0q5/TER/tYh3PQ==} engines: {node: '>= 0.4'} @@ -12531,8 +12523,9 @@ packages: engines: {node: '>=8'} dev: true - /astring@1.8.6: - resolution: {integrity: sha512-ISvCdHdlTDlH5IpxQJIex7BWBywFWgjJSVdwst+/iQCoEYnyOaQ95+X1JGshuBjGp6nxKUy1jMgE3zPqN7fQdg==} + /astring@1.9.0: + resolution: {integrity: sha512-LElXdjswlqjWrPpJFg1Fx4wpkOCxj1TDHlSV4PlaRxHGWko024xICaa97ZkMfs6DRKlCguiAI+rbXv5GWwXIkg==} + hasBin: true dev: true /async-hook-jl@1.7.6: @@ -12562,12 +12555,6 @@ packages: /async@3.2.4: resolution: {integrity: sha512-iAB+JbDEGXhyIUavoDl9WP/Jj106Kz9DEn1DPgYw5ruDn0e3Wgi3sKFm55sASdGBNOQB8F59d9qQ7deqrHA8wQ==} - /asynciterator.prototype@1.0.0: - resolution: {integrity: sha512-wwHYEIS0Q80f5mosx3L/dfG5t5rjEa9Ft51GTaNt862EnpyGHpgz2RkZvLPp1oF5TnAiTohkEKVEu8pQPJI7Vg==} - dependencies: - has-symbols: 1.1.0 - dev: true - /asynckit@0.4.0: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} @@ -12684,7 +12671,7 @@ packages: dependencies: '@babel/runtime': 7.27.6 cosmiconfig: 7.0.1 - resolve: 1.22.10 + resolve: 1.22.11 /babel-plugin-polyfill-corejs2@0.4.14(@babel/core@7.28.0): resolution: {integrity: sha512-Co2Y9wX854ts6U8gAAPXfn0GmAyctHuK8n0Yhfjd6t30g7yvKjspvvOo9yG+z52PZRgFErt7Ka2pYnXCjLKEpg==} @@ -12726,10 +12713,13 @@ packages: resolution: {integrity: sha512-WpOrF76nUHijnNn10eBGOHZmXQC8JYRME9rOLxStOga7Av2VO53ehVFvVNImMksVtQuL2/7ZNxEgxnx7oo/3Hw==} dev: true - /babel-plugin-transform-modules-ui5@7.3.0: - resolution: {integrity: sha512-XLzh4S8ZKW5FsOxsMVVyUgrnCRAZ5JcLf78/HPHufi/1feQhn0oMCzIKjORAEIJcqIVYTovy9N7Miek4trbq6A==} + /babel-plugin-transform-modules-ui5@7.8.0(@babel/core@7.28.0): + resolution: {integrity: sha512-iKaJhr7FTYUFc7KHqTaUA1pqNOIXX1KSA935ahO1YIsMTXBBX3enHxydPHF/Iu08F0Xowa/vYyTo/Fvf6G/F2Q==} engines: {node: '>=6'} + peerDependencies: + '@babel/core': '*' dependencies: + '@babel/core': 7.28.0 array-flatten: 3.0.0 doctrine: 3.0.0 ignore-case: 0.1.0 @@ -12774,10 +12764,12 @@ packages: babel-preset-current-node-syntax: 1.2.0(@babel/core@7.28.0) dev: true - /babel-preset-transform-ui5@7.3.0: - resolution: {integrity: sha512-N5eSDHC7GbFdi7qDglt1BUiIKh+Ak6Hlf0Fv9i3lgeysKBgMMN82PW15QUOyNyp2keKBMv2JWUT5yaOd/RpFaQ==} + /babel-preset-transform-ui5@7.8.0(@babel/core@7.28.0): + resolution: {integrity: sha512-6qoDS+wDNjcljcmGlQyYrfUO1RmkEC11n/xAXh3JXuwuXX2WzT86N7meS6n+XWvS7NaC7UvVysrKWIPPBopoyQ==} dependencies: - babel-plugin-transform-modules-ui5: 7.3.0 + babel-plugin-transform-modules-ui5: 7.8.0(@babel/core@7.28.0) + transitivePeerDependencies: + - '@babel/core' dev: true /bail@1.0.5: @@ -12976,7 +12968,7 @@ packages: dependencies: ansi-align: 3.0.1 camelcase: 7.0.1 - chalk: 5.3.0 + chalk: 5.6.2 cli-boxes: 3.0.0 string-width: 5.1.2 type-fest: 2.19.0 @@ -13012,16 +13004,6 @@ packages: resolution: {integrity: sha512-nfulgvOR6S4gt9UKCeGJOuSGBPGiFT6oQ/2UBnvTY/5aQ1PnksW72fhZkM30DzoRRv2WpwZf1vHHEr3mtuXIWQ==} dev: true - /browserslist@4.23.0: - resolution: {integrity: sha512-QW8HiM1shhT2GuzkvklfjcKDiWFXHOeFCIA/huJPwHsslwcydgk7X+z2zXpEijP98UCY7HbubZt5J2Zgvf0CaQ==} - engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} - dependencies: - caniuse-lite: 1.0.30001612 - electron-to-chromium: 1.4.747 - node-releases: 2.0.14 - update-browserslist-db: 1.0.13(browserslist@4.23.0) - dev: true - /browserslist@4.24.4: resolution: {integrity: sha512-KDi1Ny1gSePi1vm0q4oxSF8b4DR44GF4BbmS2YdhPLOEqd8pDviZOGH/GsmRwoWJ2+5Lr085X7naowMwKHDG1A==} engines: {node: ^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7} @@ -13122,11 +13104,6 @@ packages: run-applescript: 5.0.0 dev: true - /bytes@3.0.0: - resolution: {integrity: sha512-pMhOfFDPiv9t5jjIXkHosWmkSyQbvsgEVNkz0ERHbuLh2T/7j4Mqqpz523Fe8MVY89KC6Sh/QfS2sM+SjgFDcw==} - engines: {node: '>= 0.8'} - dev: true - /bytes@3.1.2: resolution: {integrity: sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==} engines: {node: '>= 0.8'} @@ -13293,10 +13270,6 @@ packages: engines: {node: '>=14.16'} dev: true - /caniuse-lite@1.0.30001612: - resolution: {integrity: sha512-lFgnZ07UhaCcsSZgWW0K5j4e69dK1u/ltrL9lTUiFOwNHs12S3UMIEYgBV0Z6C6hRDev7iRnMzzYmKabYdXF9g==} - dev: true - /caniuse-lite@1.0.30001712: resolution: {integrity: sha512-MBqPpGYYdQ7/hfKiet9SCI+nmN5/hp4ZzveOJubl5DTAMa5oggjAuoi0Z4onBpKPFI2ePGnQuQIzF3VxDjDJig==} @@ -13361,6 +13334,11 @@ packages: engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} dev: true + /chalk@5.6.2: + resolution: {integrity: sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==} + engines: {node: ^12.17.0 || ^14.13 || >=16.0.0} + dev: true + /char-regex@1.0.2: resolution: {integrity: sha512-kWWXztvZ5SBQV+eRgKFeh8q5sLuZY2+8WUIzlxWVTg+oGwY14qylx1KbKzHd8P6ZYkAg0xyIDU9JMHhyJMZ1jw==} engines: {node: '>=10'} @@ -13378,6 +13356,10 @@ packages: resolution: {integrity: sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg==} dev: false + /chardet@0.7.0: + resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + dev: true + /chardet@2.1.0: resolution: {integrity: sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==} @@ -13760,17 +13742,6 @@ packages: repeat-string: 1.6.1 dev: false - /comment-json@4.2.3: - resolution: {integrity: sha512-SsxdiOf064DWoZLH799Ata6u7iV658A11PlWtZATDlXPpKGJnbJZ5Z24ybixAi+LUUqJ/GKowAejtC5GFUG7Tw==} - engines: {node: '>= 6'} - dependencies: - array-timsort: 1.0.3 - core-util-is: 1.0.3 - esprima: 4.0.1 - has-own-prop: 2.0.0 - repeat-string: 1.6.1 - dev: true - /comment-json@4.2.5: resolution: {integrity: sha512-bKw/r35jR3HGt5PEPm1ljsQQGyCrR8sFGNiN5L+ykDHdpO8Smxkrkla9Yi6NkQyUrb8V54PGhfMs6NrIwtxtdw==} engines: {node: '>= 6'} @@ -13818,16 +13789,16 @@ packages: mime-db: 1.54.0 dev: true - /compression@1.7.4: - resolution: {integrity: sha512-jaSIDzP9pZVS4ZfQ+TzvtiWhdpFhE2RDHz8QJkpX9SIpLq88VueF5jJw6t+6CUQcAoA6t+x89MLrWAqpfDE8iQ==} + /compression@1.8.1: + resolution: {integrity: sha512-9mAqGPHLakhCLeNyxPkK4xVo746zQ/czLH1Ky+vkitMnWfWZps8r0qXuwhwizagCRttsL4lfG4pIOvaWLpAP0w==} engines: {node: '>= 0.8.0'} dependencies: - accepts: 1.3.8 - bytes: 3.0.0 + bytes: 3.1.2 compressible: 2.0.18 debug: 2.6.9 - on-headers: 1.0.2 - safe-buffer: 5.1.2 + negotiator: 0.6.4 + on-headers: 1.1.0 + safe-buffer: 5.2.1 vary: 1.1.2 transitivePeerDependencies: - supports-color @@ -14125,15 +14096,6 @@ packages: whatwg-mimetype: 3.0.0 whatwg-url: 11.0.0 - /data-view-buffer@1.0.1: - resolution: {integrity: sha512-0lht7OugA5x3iJLOWFhWK/5ehONdprk0ISXqVFn/NFrDu+cuc8iADFrGQz5BnRK7LLU3JmkbXSxaqX+/mXYtUA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - /data-view-buffer@1.0.2: resolution: {integrity: sha512-EmKO5V3OLXh1rtK2wgXRansaK1/mtVdTUEiEI0W8RkvgT05kfxaH29PliLnpLP73yYO6142Q72QNa8Wx/A5CqQ==} engines: {node: '>= 0.4'} @@ -14143,15 +14105,6 @@ packages: is-data-view: 1.0.2 dev: true - /data-view-byte-length@1.0.1: - resolution: {integrity: sha512-4J7wRJD3ABAzr8wP+OcIcqq2dlUKp4DVflx++hs5h5ZKydWMI6/D/fAot+yh6g2tHh8fLFTvNOaVN357NvSrOQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - /data-view-byte-length@1.0.2: resolution: {integrity: sha512-tuhGbE6CfTM9+5ANGf+oQb72Ky/0+s3xKUpHvShfiz2RxMFgFPjsXuRLBVMtvMs15awe45SRb83D6wH4ew6wlQ==} engines: {node: '>= 0.4'} @@ -14161,15 +14114,6 @@ packages: is-data-view: 1.0.2 dev: true - /data-view-byte-offset@1.0.0: - resolution: {integrity: sha512-t/Ygsytq+R995EJ5PZlD4Cu56sWa8InXySaViRzw9apusqsOO2bQP+SbYzAhR0pFKoB+43lYy8rWban9JSuXnA==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-data-view: 1.0.1 - dev: true - /data-view-byte-offset@1.0.1: resolution: {integrity: sha512-BS8PfmtDGnrgYdOonGZQdLZslWIeCGFP9tpan0hi1Co2Zr2NKADsvGYA8XxuG/4UWgJ6Cjtv+YJnB6MM69QGlQ==} engines: {node: '>= 0.4'} @@ -14238,18 +14182,6 @@ packages: dependencies: ms: 2.1.2 - /debug@4.3.6: - resolution: {integrity: sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==} - engines: {node: '>=6.0'} - peerDependencies: - supports-color: '*' - peerDependenciesMeta: - supports-color: - optional: true - dependencies: - ms: 2.1.2 - dev: true - /debug@4.3.7: resolution: {integrity: sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==} engines: {node: '>=6.0'} @@ -14553,6 +14485,7 @@ packages: engines: {node: '>=6.0.0'} dependencies: esutils: 2.0.3 + dev: true /dom-accessibility-api@0.5.14: resolution: {integrity: sha512-NMt+m9zFMPZe0JcY9gN224Qvk6qLIdqex29clBvc/y75ZBX9YA9wNK3frsYvu2DI1xcCIwxwnX+TlsJ2DSOADg==} @@ -14686,10 +14619,6 @@ packages: dependencies: jake: 10.8.5 - /electron-to-chromium@1.4.747: - resolution: {integrity: sha512-+FnSWZIAvFHbsNVmUxhEqWiaOiPMcfum1GQzlWCg/wLigVtshOsjXHyEFfmt6cFK6+HkS3QOJBv6/3OPumbBfw==} - dev: true - /electron-to-chromium@1.5.134: resolution: {integrity: sha512-zSwzrLg3jNP3bwsLqWHmS5z2nIOQ5ngMnfMZOWWtXnqqQkPVyOipxK98w+1beLw1TB+EImPNcG8wVP/cLVs2Og==} @@ -14785,10 +14714,6 @@ packages: strip-ansi: 6.0.1 dev: true - /entities@2.1.0: - resolution: {integrity: sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==} - dev: true - /entities@2.2.0: resolution: {integrity: sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==} dev: true @@ -14840,7 +14765,7 @@ packages: function.prototype.name: 1.1.5 has: 1.0.3 object.assign: 4.1.5 - object.fromentries: 2.0.6 + object.fromentries: 2.0.8 prop-types: 15.8.1 react: 16.14.0 semver: 5.7.2 @@ -14938,7 +14863,7 @@ packages: safe-array-concat: 1.0.0 safe-regex-test: 1.0.0 string.prototype.trim: 1.2.7 - string.prototype.trimend: 1.0.6 + string.prototype.trimend: 1.0.9 string.prototype.trimstart: 1.0.6 typed-array-buffer: 1.0.0 typed-array-byte-length: 1.0.0 @@ -14948,58 +14873,6 @@ packages: which-typed-array: 1.1.15 dev: true - /es-abstract@1.23.3: - resolution: {integrity: sha512-e+HfNH61Bj1X9/jLc5v1owaLYuHdeHHSQlkhCBiTK8rBvKaULl/beGMxwrMXjpYrv4pz22BlY570vVePA2ho4A==} - engines: {node: '>= 0.4'} - dependencies: - array-buffer-byte-length: 1.0.1 - arraybuffer.prototype.slice: 1.0.3 - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - data-view-buffer: 1.0.1 - data-view-byte-length: 1.0.1 - data-view-byte-offset: 1.0.0 - es-define-property: 1.0.1 - es-errors: 1.3.0 - es-object-atoms: 1.1.1 - es-set-tostringtag: 2.1.0 - es-to-primitive: 1.2.1 - function.prototype.name: 1.1.6 - get-intrinsic: 1.3.0 - get-symbol-description: 1.0.2 - globalthis: 1.0.3 - gopd: 1.2.0 - has-property-descriptors: 1.0.2 - has-proto: 1.0.3 - has-symbols: 1.1.0 - hasown: 2.0.2 - internal-slot: 1.0.7 - is-array-buffer: 3.0.4 - is-callable: 1.2.7 - is-data-view: 1.0.1 - is-negative-zero: 2.0.3 - is-regex: 1.1.4 - is-shared-array-buffer: 1.0.3 - is-string: 1.0.7 - is-typed-array: 1.1.13 - is-weakref: 1.0.2 - object-inspect: 1.13.4 - object-keys: 1.1.1 - object.assign: 4.1.5 - regexp.prototype.flags: 1.5.2 - safe-array-concat: 1.1.2 - safe-regex-test: 1.0.3 - string.prototype.trim: 1.2.9 - string.prototype.trimend: 1.0.8 - string.prototype.trimstart: 1.0.8 - typed-array-buffer: 1.0.2 - typed-array-byte-length: 1.0.1 - typed-array-byte-offset: 1.0.2 - typed-array-length: 1.0.6 - unbox-primitive: 1.0.2 - which-typed-array: 1.1.15 - dev: true - /es-abstract@1.24.0: resolution: {integrity: sha512-WSzPgsdLtTcQwm4CROfS5ju2Wa1QQcVeT37jFjYzdFz1r9ahadC8B8/a4qxJxM+09F18iumCdRmlr96ZYkQvEg==} engines: {node: '>= 0.4'} @@ -15075,33 +14948,36 @@ packages: /es-get-iterator@1.1.2: resolution: {integrity: sha512-+DTO8GYwbMCwbywjimwZMHp8AuYXOS2JZFWoi2AlPOS3ebnII9w/NLpNZtA7A0YLaVDw+O7KFCeoIV7OPvM7hQ==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 get-intrinsic: 1.3.0 has-symbols: 1.1.0 is-arguments: 1.1.1 is-map: 2.0.2 is-set: 2.0.2 - is-string: 1.0.7 + is-string: 1.1.1 isarray: 2.0.5 dev: true - /es-iterator-helpers@1.0.14: - resolution: {integrity: sha512-JgtVnwiuoRuzLvqelrvN3Xu7H9bu2ap/kQ2CrM62iidP8SKuD99rWU3CJy++s7IVL2qb/AjXPGR/E7i9ngd/Cw==} + /es-iterator-helpers@1.2.1: + resolution: {integrity: sha512-uDn+FE1yrDzyC0pCo961B2IHbdM8y/ACZsKD4dG6WqrjV53BADjwa7D+1aom2rsNVfLyDgU/eigvlJGJ08OQ4w==} + engines: {node: '>= 0.4'} dependencies: - asynciterator.prototype: 1.0.0 - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.24.0 + es-errors: 1.3.0 es-set-tostringtag: 2.1.0 function-bind: 1.1.2 get-intrinsic: 1.3.0 - globalthis: 1.0.3 + globalthis: 1.0.4 + gopd: 1.2.0 has-property-descriptors: 1.0.2 - has-proto: 1.0.3 + has-proto: 1.2.0 has-symbols: 1.1.0 - internal-slot: 1.0.7 - iterator.prototype: 1.1.0 - safe-array-concat: 1.1.2 + internal-slot: 1.1.0 + iterator.prototype: 1.1.5 + safe-array-concat: 1.1.3 dev: true /es-module-lexer@1.5.4: @@ -15127,12 +15003,6 @@ packages: has-tostringtag: 1.0.2 hasown: 2.0.2 - /es-shim-unscopables@1.0.2: - resolution: {integrity: sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==} - dependencies: - hasown: 2.0.2 - dev: true - /es-shim-unscopables@1.1.0: resolution: {integrity: sha512-d9T8ucsEhh8Bi1woXCf+TIKDIROLG5WCkxg8geBCbvk22kzwC5G2OnXVMO6FUsvQlgUUXQ2itephWDLqDzbeCw==} engines: {node: '>= 0.4'} @@ -15154,8 +15024,8 @@ packages: engines: {node: '>= 0.4'} dependencies: is-callable: 1.2.7 - is-date-object: 1.0.5 - is-symbol: 1.0.4 + is-date-object: 1.1.0 + is-symbol: 1.1.1 dev: true /esbuild-loader@3.2.0(webpack@5.102.1): @@ -15365,13 +15235,13 @@ packages: estraverse: 4.3.0 dev: true - /eslint-config-prettier@8.10.2(eslint@8.57.1): - resolution: {integrity: sha512-/IGJ6+Dka158JnP5n5YFMOszjDWrXggGz1LaK/guZq9vZTmniaKlHcsscvkAhn9y4U+BU3JuUdYvtAMcv30y4A==} + /eslint-config-prettier@10.1.1(eslint@9.36.0): + resolution: {integrity: sha512-4EQQr6wXwS+ZJSzaR5ZCrYgLxqvUjdXctaEtBqHcbkW944B1NQyO4qpdHQbXBONfwxXdkAY81HH4+LUfrg+zPw==} hasBin: true peerDependencies: eslint: '>=7.0.0' dependencies: - eslint: 8.57.1 + eslint: 9.36.0 dev: true /eslint-import-resolver-node@0.3.9: @@ -15379,38 +15249,39 @@ packages: dependencies: debug: 3.2.7 is-core-module: 2.16.1 - resolve: 1.22.10 + resolve: 1.22.11 transitivePeerDependencies: - supports-color dev: true - /eslint-import-resolver-typescript@3.10.1(eslint-plugin-import@2.32.0)(eslint@8.57.1): - resolution: {integrity: sha512-A1rHYb06zjMGAxdLSkN2fXPBwuSaQ0iO5M/hdyS0Ajj1VBaRp0sPD3dn1FhME3c/JluGFbwSxyCfqdSbtQLAHQ==} - engines: {node: ^14.18.0 || >=16.0.0} + /eslint-import-resolver-typescript@4.2.2(eslint-plugin-import@2.31.0)(eslint@9.36.0): + resolution: {integrity: sha512-Rg1YEsb9UKLQ8BOv27cS3TZ6LhEAKQVgVOXArcE/sQrlnX8+FjmJRSC29ij1qrn+eurFuMsCFUcs7/+27T0vqQ==} + engines: {node: ^16.17.0 || >=18.6.0} peerDependencies: eslint: '*' eslint-plugin-import: '*' eslint-plugin-import-x: '*' + is-bun-module: '*' peerDependenciesMeta: eslint-plugin-import: optional: true eslint-plugin-import-x: optional: true + is-bun-module: + optional: true dependencies: - '@nolyfill/is-core-module': 1.0.39 debug: 4.4.1 - eslint: 8.57.1 - eslint-plugin-import: 2.32.0(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1) + eslint: 9.36.0 + eslint-plugin-import: 2.31.0(@typescript-eslint/parser@8.46.2)(eslint-import-resolver-typescript@4.2.2)(eslint@9.36.0) get-tsconfig: 4.13.0 - is-bun-module: 2.0.0 + rspack-resolver: 1.3.0 stable-hash: 0.0.5 tinyglobby: 0.2.15 - unrs-resolver: 1.11.1 transitivePeerDependencies: - supports-color dev: true - /eslint-module-utils@2.12.1(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1): + /eslint-module-utils@2.12.1(@typescript-eslint/parser@8.46.2)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@4.2.2)(eslint@9.36.0): resolution: {integrity: sha512-L8jSWTze7K2mTg0vos/RuLRS5soomksDPoJLXIslC7c8Wmut3bx7CPpJijDcBZtxQ5lrbUdM+s0OlNbz0DCDNw==} engines: {node: '>=4'} peerDependencies: @@ -15431,32 +15302,32 @@ packages: eslint-import-resolver-webpack: optional: true dependencies: - '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.9.3) + '@typescript-eslint/parser': 8.46.2(eslint@9.36.0)(typescript@5.9.3) debug: 3.2.7 - eslint: 8.57.1 + eslint: 9.36.0 eslint-import-resolver-node: 0.3.9 - eslint-import-resolver-typescript: 3.10.1(eslint-plugin-import@2.32.0)(eslint@8.57.1) + eslint-import-resolver-typescript: 4.2.2(eslint-plugin-import@2.31.0)(eslint@9.36.0) transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-fiori-custom@2.6.7(eslint@8.57.0): + /eslint-plugin-fiori-custom@2.6.7(eslint@9.36.0): resolution: {integrity: sha512-mQdL1TA0sk9VprMA8t0bLUuuzcdLq8JLfiCkqcm+eMbUb2zgIIHEGdVxCwdWVY+ZHn99UG1C86GcataX3ShJOg==} engines: {node: '>=14.0.0'} peerDependencies: eslint: '>=7.5' dependencies: '@babel/core': 7.20.12 - '@babel/eslint-parser': 7.19.1(@babel/core@7.20.12)(eslint@8.57.0) - eslint: 8.57.0 + '@babel/eslint-parser': 7.19.1(@babel/core@7.20.12)(eslint@9.36.0) + eslint: 9.36.0 lodash: 4.17.21 requireindex: 1.2.0 transitivePeerDependencies: - supports-color dev: false - /eslint-plugin-import@2.32.0(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1): - resolution: {integrity: sha512-whOE1HFo/qJDyX4SnXzP4N6zOWn79WhnCUY/iDR0mPfQZO8wcYE4JClzI2oZrhBnnMUCBCHZhO6VQyoBU95mZA==} + /eslint-plugin-import@2.31.0(@typescript-eslint/parser@8.46.2)(eslint-import-resolver-typescript@4.2.2)(eslint@9.36.0): + resolution: {integrity: sha512-ixmkI62Rbc2/w8Vfxyh1jQRTdRTF52VxwRVHl/ykPAmqG+Nb7/kNn+byLP0LxPgI7zWA16Jt82SybJInmMia3A==} engines: {node: '>=4'} peerDependencies: '@typescript-eslint/parser': '*' @@ -15466,16 +15337,16 @@ packages: optional: true dependencies: '@rtsao/scc': 1.1.0 - '@typescript-eslint/parser': 7.18.0(eslint@8.57.1)(typescript@5.9.3) + '@typescript-eslint/parser': 8.46.2(eslint@9.36.0)(typescript@5.9.3) array-includes: 3.1.9 array.prototype.findlastindex: 1.2.6 array.prototype.flat: 1.3.3 array.prototype.flatmap: 1.3.3 debug: 3.2.7 doctrine: 2.1.0 - eslint: 8.57.1 + eslint: 9.36.0 eslint-import-resolver-node: 0.3.9 - eslint-module-utils: 2.12.1(@typescript-eslint/parser@7.18.0)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@3.10.1)(eslint@8.57.1) + eslint-module-utils: 2.12.1(@typescript-eslint/parser@8.46.2)(eslint-import-resolver-node@0.3.9)(eslint-import-resolver-typescript@4.2.2)(eslint@9.36.0) hasown: 2.0.2 is-core-module: 2.16.1 is-glob: 4.0.3 @@ -15487,100 +15358,180 @@ packages: string.prototype.trimend: 1.0.9 tsconfig-paths: 3.15.0 transitivePeerDependencies: - - eslint-import-resolver-typescript - - eslint-import-resolver-webpack + - eslint-import-resolver-typescript + - eslint-import-resolver-webpack + - supports-color + dev: true + + /eslint-plugin-jsdoc@50.6.8(eslint@9.36.0): + resolution: {integrity: sha512-PPZVqhoXaalMQwDGzcQrJtPSPIPOYsSMtvkjYAdsIazOW20yhYtVX4+jLL+XznD4zYTXyZbPWPRKkNev4D4lyw==} + engines: {node: '>=18'} + peerDependencies: + eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 + dependencies: + '@es-joy/jsdoccomment': 0.49.0 + are-docs-informative: 0.0.2 + comment-parser: 1.4.1 + debug: 4.4.1 + escape-string-regexp: 4.0.0 + eslint: 9.36.0 + espree: 10.4.0 + esquery: 1.6.0 + parse-imports: 2.2.1 + semver: 7.7.1 + spdx-expression-parse: 4.0.0 + synckit: 0.9.3 + transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-jsdoc@46.10.1(eslint@8.57.1): - resolution: {integrity: sha512-x8wxIpv00Y50NyweDUpa+58ffgSAI5sqe+zcZh33xphD0AVh+1kqr1ombaTRb7Fhpove1zfUuujlX9DWWBP5ag==} - engines: {node: '>=16'} + /eslint-plugin-jsdoc@50.8.0(eslint@9.36.0): + resolution: {integrity: sha512-UyGb5755LMFWPrZTEqqvTJ3urLz1iqj+bYOHFNag+sw3NvaMWP9K2z+uIn37XfNALmQLQyrBlJ5mkiVPL7ADEg==} + engines: {node: '>=18'} peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 dependencies: - '@es-joy/jsdoccomment': 0.41.0 + '@es-joy/jsdoccomment': 0.50.2 are-docs-informative: 0.0.2 comment-parser: 1.4.1 - debug: 4.3.6 + debug: 4.4.1 escape-string-regexp: 4.0.0 - eslint: 8.57.1 + eslint: 9.36.0 + espree: 10.4.0 esquery: 1.6.0 - is-builtin-module: 3.2.1 - semver: 7.7.1 + parse-imports-exports: 0.2.4 + semver: 7.7.3 spdx-expression-parse: 4.0.0 transitivePeerDependencies: - supports-color dev: true - /eslint-plugin-prettier@4.2.5(eslint-config-prettier@8.10.2)(eslint@8.57.1)(prettier@2.8.8): - resolution: {integrity: sha512-9Ni+xgemM2IWLq6aXEpP2+V/V30GeA/46Ar629vcMqVPodFFWC9skHu/D1phvuqtS8bJCFnNf01/qcmqYEwNfg==} - engines: {node: '>=12.0.0'} + /eslint-plugin-prettier@5.2.3(eslint-config-prettier@10.1.1)(eslint@9.36.0)(prettier@3.6.2): + resolution: {integrity: sha512-qJ+y0FfCp/mQYQ/vWQ3s7eUlFEL4PyKfAJxsnYTJ4YT73nsJBWqmEpFryxV9OeUiqmsTsYJ5Y+KDNaeP31wrRw==} + engines: {node: ^14.18.0 || >=16.0.0} peerDependencies: - eslint: '>=7.28.0' + '@types/eslint': '>=8.0.0' + eslint: '>=8.0.0' eslint-config-prettier: '*' - prettier: '>=2.0.0' + prettier: '>=3.0.0' peerDependenciesMeta: + '@types/eslint': + optional: true eslint-config-prettier: optional: true dependencies: - eslint: 8.57.1 - eslint-config-prettier: 8.10.2(eslint@8.57.1) - prettier: 2.8.8 + eslint: 9.36.0 + eslint-config-prettier: 10.1.1(eslint@9.36.0) + prettier: 3.6.2 prettier-linter-helpers: 1.0.0 + synckit: 0.9.3 dev: true - /eslint-plugin-promise@6.6.0(eslint@8.57.1): - resolution: {integrity: sha512-57Zzfw8G6+Gq7axm2Pdo3gW/Rx3h9Yywgn61uE/3elTCOePEHVrn2i5CdfBwA1BLK0Q0WqctICIUSqXZW/VprQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /eslint-plugin-promise@7.2.1(eslint@9.36.0): + resolution: {integrity: sha512-SWKjd+EuvWkYaS+uN2csvj0KoP43YTu7+phKQ5v+xw6+A0gutVX2yqCeCkC3uLCJFiPfR2dD8Es5L7yUsmvEaA==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^7.0.0 || ^8.0.0 || ^9.0.0 dependencies: - eslint: 8.57.1 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.36.0) + eslint: 9.36.0 dev: true - /eslint-plugin-react@7.33.2(eslint@8.57.1): - resolution: {integrity: sha512-73QQMKALArI8/7xGLNI/3LylrEYrlKZSb5C9+q3OtOewTnMQi5cT+aE9E41sLCmli3I9PGGmD1yiZydyo4FEPw==} + /eslint-plugin-react@7.37.4(eslint@9.29.0): + resolution: {integrity: sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ==} engines: {node: '>=4'} peerDependencies: - eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 dependencies: - array-includes: 3.1.8 - array.prototype.flatmap: 1.3.2 - array.prototype.tosorted: 1.1.1 + array-includes: 3.1.9 + array.prototype.findlast: 1.2.5 + array.prototype.flatmap: 1.3.3 + array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 - es-iterator-helpers: 1.0.14 - eslint: 8.57.1 + es-iterator-helpers: 1.2.1 + eslint: 9.29.0 estraverse: 5.3.0 + hasown: 2.0.2 jsx-ast-utils: 3.3.3 minimatch: 3.1.2 - object.entries: 1.1.6 + object.entries: 1.1.9 object.fromentries: 2.0.8 - object.hasown: 1.1.2 - object.values: 1.2.0 + object.values: 1.2.1 prop-types: 15.8.1 - resolve: 2.0.0-next.4 + resolve: 2.0.0-next.5 semver: 6.3.1 - string.prototype.matchall: 4.0.8 + string.prototype.matchall: 4.0.12 + string.prototype.repeat: 1.0.0 dev: true - /eslint-plugin-sonarjs@0.25.1(eslint@8.57.1): - resolution: {integrity: sha512-5IOKvj/GMBNqjxBdItfotfRHo7w48496GOu1hxdeXuD0mB1JBlDCViiLHETDTfA8pDAVSBimBEQoetRXYceQEw==} - engines: {node: '>=16'} + /eslint-plugin-react@7.37.4(eslint@9.36.0): + resolution: {integrity: sha512-BGP0jRmfYyvOyvMoRX/uoUeW+GqNj9y16bPQzqAHf3AYII/tDs+jMN0dBVkl88/OZwNGwrVFxE7riHsXVfy/LQ==} + engines: {node: '>=4'} + peerDependencies: + eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 + dependencies: + array-includes: 3.1.9 + array.prototype.findlast: 1.2.5 + array.prototype.flatmap: 1.3.3 + array.prototype.tosorted: 1.1.4 + doctrine: 2.1.0 + es-iterator-helpers: 1.2.1 + eslint: 9.36.0 + estraverse: 5.3.0 + hasown: 2.0.2 + jsx-ast-utils: 3.3.3 + minimatch: 3.1.2 + object.entries: 1.1.9 + object.fromentries: 2.0.8 + object.values: 1.2.1 + prop-types: 15.8.1 + resolve: 2.0.0-next.5 + semver: 6.3.1 + string.prototype.matchall: 4.0.12 + string.prototype.repeat: 1.0.0 + dev: true + + /eslint-plugin-sonarjs@3.0.2(eslint@9.36.0): + resolution: {integrity: sha512-LxjbfwI7ypENeTmGyKmDyNux3COSkMi7H/6Cal5StSLQ6edf0naP45SZR43OclaNR7WfhVTZdhOn63q3/Y6puQ==} + peerDependencies: + eslint: ^8.0.0 || ^9.0.0 + dependencies: + '@eslint-community/regexpp': 4.12.1 + builtin-modules: 3.3.0 + bytes: 3.1.2 + eslint: 9.36.0 + functional-red-black-tree: 1.0.1 + jsx-ast-utils: 3.3.5 + minimatch: 9.0.5 + scslre: 0.3.0 + semver: 7.7.1 + typescript: 5.9.3 + dev: true + + /eslint-plugin-storybook@0.12.0(eslint@9.36.0)(typescript@5.9.3): + resolution: {integrity: sha512-Lg5I0+npTgiYgZ4KSvGWGDFZi3eOCNJPaWX0c9rTEEXC5wvooOClsP9ZtbI4hhFKyKgYR877KiJxbRTSJq9gWA==} + engines: {node: '>= 18'} peerDependencies: - eslint: ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0 + eslint: '>=8' dependencies: - eslint: 8.57.1 + '@storybook/csf': 0.1.11 + '@typescript-eslint/utils': 8.46.2(eslint@9.36.0)(typescript@5.9.3) + eslint: 9.36.0 + ts-dedent: 2.2.0 + transitivePeerDependencies: + - supports-color + - typescript dev: true - /eslint-plugin-storybook@0.6.15(eslint@8.57.1)(typescript@5.9.3): + /eslint-plugin-storybook@0.6.15(eslint@9.29.0)(typescript@5.9.3): resolution: {integrity: sha512-lAGqVAJGob47Griu29KXYowI4G7KwMoJDOkEip8ujikuDLxU+oWJ1l0WL6F2oDO4QiyUFXvtDkEkISMOPzo+7w==} engines: {node: 12.x || 14.x || >= 16} peerDependencies: eslint: '>=6' dependencies: '@storybook/csf': 0.0.1 - '@typescript-eslint/utils': 5.62.0(eslint@8.57.1)(typescript@5.9.3) - eslint: 8.57.1 + '@typescript-eslint/utils': 5.62.0(eslint@9.29.0)(typescript@5.9.3) + eslint: 9.29.0 requireindex: 1.2.0 ts-dedent: 2.2.0 transitivePeerDependencies: @@ -15595,9 +15546,9 @@ packages: esrecurse: 4.3.0 estraverse: 4.3.0 - /eslint-scope@7.2.2: - resolution: {integrity: sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} + /eslint-scope@8.4.0: + resolution: {integrity: sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} dependencies: esrecurse: 4.3.0 estraverse: 5.3.0 @@ -15611,126 +15562,134 @@ packages: resolution: {integrity: sha512-wpc+LXeiyiisxPlEkUzU6svyS1frIO3Mgxj1fdy7Pm8Ygzguax2N3Fa/D/ag1WqbOprdI+uY6wMUl8/a2G+iag==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - /eslint@8.57.0: - resolution: {integrity: sha512-dZ6+mexnaTIbSBZWgou51U6OmzIhYM2VcNdtiTtI7qPNZm35Akpr0f6vtw3w1Kmn5PYo+tZVfh13WrhpS6oLqQ==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + /eslint-visitor-keys@4.2.1: + resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + + /eslint@9.29.0: + resolution: {integrity: sha512-GsGizj2Y1rCWDu6XoEekL3RLilp0voSePurjZIkxL3wlm5o5EC9VpgaP7lrCvjnkuLvzFBQWB3vWB3K5KQTveQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.0) - '@eslint-community/regexpp': 4.8.1 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.0 - '@humanwhocodes/config-array': 0.11.14 + '@eslint-community/eslint-utils': 4.4.0(eslint@9.29.0) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.20.1 + '@eslint/config-helpers': 0.2.3 + '@eslint/core': 0.14.0 + '@eslint/eslintrc': 3.3.1 + '@eslint/js': 9.29.0 + '@eslint/plugin-kit': 0.3.5 + '@humanfs/node': 0.16.7 '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.2.0 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.8 + '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 - cross-spawn: 7.0.5 - debug: 4.3.4 - doctrine: 3.0.0 + cross-spawn: 7.0.6 + debug: 4.4.1 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 - esquery: 1.5.0 + eslint-scope: 8.4.0 + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 + esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 + file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.20.0 - graphemer: 1.4.0 ignore: 5.2.4 imurmurhash: 0.1.4 is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 - optionator: 0.9.3 - strip-ansi: 6.0.1 - text-table: 0.2.0 + optionator: 0.9.4 transitivePeerDependencies: - supports-color + dev: true - /eslint@8.57.1: - resolution: {integrity: sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==} - engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} - deprecated: This version is no longer supported. Please see https://eslint.org/version-support for other options. + /eslint@9.36.0: + resolution: {integrity: sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true + peerDependencies: + jiti: '*' + peerDependenciesMeta: + jiti: + optional: true dependencies: - '@eslint-community/eslint-utils': 4.4.0(eslint@8.57.1) - '@eslint-community/regexpp': 4.11.0 - '@eslint/eslintrc': 2.1.4 - '@eslint/js': 8.57.1 - '@humanwhocodes/config-array': 0.13.0 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0) + '@eslint-community/regexpp': 4.12.2 + '@eslint/config-array': 0.21.1 + '@eslint/config-helpers': 0.3.1 + '@eslint/core': 0.15.2 + '@eslint/eslintrc': 3.3.1 + '@eslint/js': 9.36.0 + '@eslint/plugin-kit': 0.3.5 + '@humanfs/node': 0.16.7 '@humanwhocodes/module-importer': 1.0.1 - '@nodelib/fs.walk': 1.2.8 - '@ungap/structured-clone': 1.3.0 + '@humanwhocodes/retry': 0.4.3 + '@types/estree': 1.0.8 + '@types/json-schema': 7.0.15 ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 debug: 4.4.1 - doctrine: 3.0.0 escape-string-regexp: 4.0.0 - eslint-scope: 7.2.2 - eslint-visitor-keys: 3.4.3 - espree: 9.6.1 + eslint-scope: 8.4.0 + eslint-visitor-keys: 4.2.1 + espree: 10.4.0 esquery: 1.6.0 esutils: 2.0.3 fast-deep-equal: 3.1.3 - file-entry-cache: 6.0.1 + file-entry-cache: 8.0.0 find-up: 5.0.0 glob-parent: 6.0.2 - globals: 13.24.0 - graphemer: 1.4.0 ignore: 5.2.4 imurmurhash: 0.1.4 is-glob: 4.0.3 - is-path-inside: 3.0.3 - js-yaml: 4.1.0 json-stable-stringify-without-jsonify: 1.0.1 - levn: 0.4.1 lodash.merge: 4.6.2 minimatch: 3.1.2 natural-compare: 1.4.0 optionator: 0.9.4 - strip-ansi: 6.0.1 - text-table: 0.2.0 transitivePeerDependencies: - supports-color - dev: true + + /espree@10.4.0: + resolution: {integrity: sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + dependencies: + acorn: 8.15.0 + acorn-jsx: 5.3.2(acorn@8.15.0) + eslint-visitor-keys: 4.2.1 /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} dependencies: - acorn: 8.14.1 - acorn-jsx: 5.3.2(acorn@8.14.1) + acorn: 8.15.0 + acorn-jsx: 5.3.2(acorn@8.15.0) eslint-visitor-keys: 3.4.3 + dev: true /esprima@4.0.1: resolution: {integrity: sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==} engines: {node: '>=4'} hasBin: true - /esquery@1.5.0: - resolution: {integrity: sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==} - engines: {node: '>=0.10'} - dependencies: - estraverse: 5.3.0 - /esquery@1.6.0: resolution: {integrity: sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==} engines: {node: '>=0.10'} dependencies: estraverse: 5.3.0 - dev: true /esrecurse@4.3.0: resolution: {integrity: sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==} @@ -15969,6 +15928,15 @@ packages: resolution: {integrity: sha512-UOiS2in6/Q0FK0R0q6UY9vYpQ21mr/Qn1KOnte7vsACuNJf514WvCCUHSRCPcgjPT2bAhNIJdlE6bVap1GKmeg==} dev: true + /external-editor@3.1.0: + resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} + engines: {node: '>=4'} + dependencies: + chardet: 0.7.0 + iconv-lite: 0.4.24 + tmp: 0.0.33 + dev: true + /extract-zip@2.0.1: resolution: {integrity: sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==} engines: {node: '>= 10.17.0'} @@ -16018,7 +15986,6 @@ packages: glob-parent: 5.1.2 merge2: 1.4.1 micromatch: 4.0.8 - dev: true /fast-json-parse@1.0.3: resolution: {integrity: sha512-FRWsaZRWEJ1ESVNbDWmsAlqDk96gPQezzLghafp5J4GUKjbCz3OkAHuZs5TuPEtkbVQERysLp9xv6c24fBm8Aw==} @@ -16096,11 +16063,11 @@ packages: is-unicode-supported: 1.3.0 dev: true - /file-entry-cache@6.0.1: - resolution: {integrity: sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==} - engines: {node: ^10.12.0 || >=12.0.0} + /file-entry-cache@8.0.0: + resolution: {integrity: sha512-XXTUwCvisa5oacNGRP9SfNtYBNAMi+RPwBFmblZEF7N7swHYQS6/Zfk7SRwx4D5j3CH211YNRco1DEMNVfZCnQ==} + engines: {node: '>=16.0.0'} dependencies: - flat-cache: 3.2.0 + flat-cache: 4.0.1 /file-system-cache@2.3.0: resolution: {integrity: sha512-l4DMNdsIPsVnKrgEXbJwDJsA5mB8rGwHYERMgqQx/xAUtChPJMre1bXBzDEqqVbWv9AIbFezXMxeEkZDSrXUOQ==} @@ -16282,6 +16249,14 @@ packages: flatted: 3.3.1 keyv: 4.5.4 rimraf: 3.0.2 + dev: true + + /flat-cache@4.0.1: + resolution: {integrity: sha512-f7ccFPK3SXFHpx15UIGyRJ/FJQctuKZ0zVuN3frBo4HnK3cay9VEW0R6yPYFHC0AgqhukPzKjq22t5DmAyqGyw==} + engines: {node: '>=16'} + dependencies: + flatted: 3.3.1 + keyv: 4.5.4 /flat@5.0.2: resolution: {integrity: sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==} @@ -16537,16 +16512,6 @@ packages: functions-have-names: 1.2.3 dev: true - /function.prototype.name@1.1.6: - resolution: {integrity: sha512-Z5kx79swU5P27WEayXM1tBi5Ze/lbIyiNgU3qyXUOf9b2rgXYyF9Dy9Cx+IQv/Lc8WCG6L82zwUPpSS9hGehIg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - functions-have-names: 1.2.3 - dev: true - /function.prototype.name@1.1.8: resolution: {integrity: sha512-e5iwyodOHhbMr/yNrc7fDYG4qlbIvI5gajyzPnb5TCwyhjApznQh1BMFou9b30SevY43gCJKXycoCBjMbsuW0Q==} engines: {node: '>= 0.4'} @@ -16559,6 +16524,10 @@ packages: is-callable: 1.2.7 dev: true + /functional-red-black-tree@1.0.1: + resolution: {integrity: sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==} + dev: true + /functions-have-names@1.2.3: resolution: {integrity: sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==} dev: true @@ -16657,16 +16626,7 @@ packages: resolution: {integrity: sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.3.0 - dev: true - - /get-symbol-description@1.0.2: - resolution: {integrity: sha512-g0QYk1dZBxGwk+Ngc+ltRH2IBp2f7zBkBMBJZCDerh6EhlhSR6+9irMCuT/09zD6qkarHUSn529sK/yL4S27mg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 + call-bind: 1.0.8 get-intrinsic: 1.3.0 dev: true @@ -16821,17 +16781,14 @@ packages: which: 1.3.1 dev: false - /globals@13.20.0: - resolution: {integrity: sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.20.2 + /globals@14.0.0: + resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} + engines: {node: '>=18'} - /globals@13.24.0: - resolution: {integrity: sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==} - engines: {node: '>=8'} - dependencies: - type-fest: 0.20.2 + /globals@16.0.0: + resolution: {integrity: sha512-iInW14XItCXET01CQFqudPOWP2jYMl7T+QRQT+UNcR/iQncN/F0UNpgd76iFkBPgNQb4+X3LV9tLJYzwh+Gl3A==} + engines: {node: '>=18'} + dev: true /globalthis@1.0.3: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} @@ -17271,9 +17228,8 @@ packages: transitivePeerDependencies: - supports-color - /human-id@4.1.2: - resolution: {integrity: sha512-v/J+4Z/1eIJovEBdlV5TYj1IR+ZiohcYGRY+qN/oC9dAfKzVT023N/Bgw37hrKCoVRBvk3bqyzpr2PP5YeTMSg==} - hasBin: true + /human-id@1.0.2: + resolution: {integrity: sha512-UNopramDEhHJD+VR+ehk8rOslwSfByxPIZyJRfV739NDhN5LF1fa1MqnzKm2lGTQRjNrjK19Q5fhkgIfjlVUKw==} dev: true /human-signals@1.1.1: @@ -17383,7 +17339,6 @@ packages: /ignore@7.0.3: resolution: {integrity: sha512-bAH5jbK/F3T3Jls4I0SO1hmPR0dKU0a7+SY6n1yzRtG54FLO8d6w/nxLFX2Nb7dBu6cCWXPaAME6cYqFUMmuCA==} engines: {node: '>= 4'} - dev: true /immer@9.0.21: resolution: {integrity: sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==} @@ -17509,15 +17464,6 @@ packages: side-channel: 1.1.0 dev: true - /internal-slot@1.0.7: - resolution: {integrity: sha512-NGnrKwXzSms2qUUih/ILZ5JBqNTSa1+ZmP6flaIp6KmSElgE9qdndzS3cqjrDovwFdmwsGsLdeFgB6suw+1e9g==} - engines: {node: '>= 0.4'} - dependencies: - es-errors: 1.3.0 - hasown: 2.0.2 - side-channel: 1.1.0 - dev: true - /internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} @@ -17557,26 +17503,18 @@ packages: resolution: {integrity: sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 has-tostringtag: 1.0.2 dev: true /is-array-buffer@3.0.2: resolution: {integrity: sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 get-intrinsic: 1.3.0 is-typed-array: 1.1.13 dev: true - /is-array-buffer@3.0.4: - resolution: {integrity: sha512-wcjaerHw0ydZwfhiKbXJWLDY8A7yV7KhjQOpb83hGgGfId/aQa4TOvwyzn2PuswW2gPCYEL/nEAiSVpdOj1lXw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.3.0 - dev: true - /is-array-buffer@3.0.5: resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} engines: {node: '>= 0.4'} @@ -17639,19 +17577,6 @@ packages: engines: {node: '>=4'} dev: false - /is-builtin-module@3.2.1: - resolution: {integrity: sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==} - engines: {node: '>=6'} - dependencies: - builtin-modules: 3.3.0 - dev: true - - /is-bun-module@2.0.0: - resolution: {integrity: sha512-gNCGbnnnnFAUGKeZ9PdbyeGYJqewpmc2aKHUEMO5nQPWU9lOmv7jcmQIv+qHD8fXW6W7qfuCwX4rY9LNRjXrkQ==} - dependencies: - semver: 7.7.1 - dev: true - /is-callable@1.2.4: resolution: {integrity: sha512-nsuwtxZfMX67Oryl9LCQ+upnC0Z0BgpwntpS89m1H/TLF0zNfzfLMV/9Wa/6MZsj0acpEjAO0KF1xT6ZdLl95w==} engines: {node: '>= 0.4'} @@ -17674,13 +17599,6 @@ packages: dependencies: hasown: 2.0.2 - /is-data-view@1.0.1: - resolution: {integrity: sha512-AHkaJrsUVW6wq6JS8y3JnM/GJF/9cf+k20+iDzlSaJrinEo5+7vRiteOSwBhHRiAyQATN1AmY4hwzxJKPmYf+w==} - engines: {node: '>= 0.4'} - dependencies: - is-typed-array: 1.1.13 - dev: true - /is-data-view@1.0.2: resolution: {integrity: sha512-RKtWF8pGmS87i2D6gqQu/l7EYRlVdfzemCJN/P3UOs//x1QE7mfhvzHIApBTRf7axvT6DMGwSwBXYCT0nfB9xw==} engines: {node: '>= 0.4'} @@ -17727,12 +17645,6 @@ packages: resolution: {integrity: sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==} engines: {node: '>=0.10.0'} - /is-finalizationregistry@1.0.2: - resolution: {integrity: sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==} - dependencies: - call-bind: 1.0.7 - dev: true - /is-finalizationregistry@1.1.1: resolution: {integrity: sha512-1pC6N8qWJbWoPtEjgcL2xyhQOP491EQjeUo3qTKcmV8YSDDJrOepfG8pcC7h/QgnQHYSv0mJ3Z/ZWxmatVrysg==} engines: {node: '>= 0.4'} @@ -17849,6 +17761,7 @@ packages: /is-path-inside@3.0.3: resolution: {integrity: sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==} engines: {node: '>=8'} + dev: true /is-plain-obj@2.1.0: resolution: {integrity: sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==} @@ -17885,7 +17798,7 @@ packages: /is-reference@1.2.1: resolution: {integrity: sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==} dependencies: - '@types/estree': 1.0.6 + '@types/estree': 1.0.8 dev: true /is-regex@1.1.4: @@ -17924,14 +17837,7 @@ packages: /is-shared-array-buffer@1.0.2: resolution: {integrity: sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==} dependencies: - call-bind: 1.0.7 - dev: true - - /is-shared-array-buffer@1.0.3: - resolution: {integrity: sha512-nA2hv5XIhLR3uVzDDfCIknerhx8XUKnstuOERPNNIinXG7v9u+ohXF67vxm4TPTEPU6lm61ZkwP3c9PCB97rhg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 dev: true /is-shared-array-buffer@1.0.4: @@ -17997,7 +17903,7 @@ packages: engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 gopd: 1.2.0 has-tostringtag: 1.0.2 @@ -18045,7 +17951,7 @@ packages: /is-weakref@1.0.2: resolution: {integrity: sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 dev: true /is-weakref@1.1.1: @@ -18058,7 +17964,7 @@ packages: /is-weakset@2.0.2: resolution: {integrity: sha512-t2yVvttHkQktwnNNmBQ98AhENLdPUTDTE21uPqAQ0ARwQfGeQKRVS0NNurH7bTf7RrvcVn1OOge45CnBeHCSmg==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 get-intrinsic: 1.3.0 dev: true @@ -18169,14 +18075,16 @@ packages: resolution: {integrity: sha512-eL23u8oFooYTq6TtJKjp2RYjZnCkUYQvC0T/6fJfWykXJ3quvdDdzKZ3CEjy8b3JGOvLTjDYMEMIp5243R906A==} dev: true - /iterator.prototype@1.1.0: - resolution: {integrity: sha512-rjuhAk1AJ1fssphHD0IFV6TWL40CwRZ53FrztKx43yk2v6rguBYsY4Bj1VU4HmoMmKwZUlx7mfnhDf9cOp4YTw==} + /iterator.prototype@1.1.5: + resolution: {integrity: sha512-H0dkQoCa3b2VEeKQBOxFph+JAbcrQdE7KC0UkqwpLmv2EC4P41QXP+rqo9wYodACiG5/WM5s9oDApTU8utwj9g==} + engines: {node: '>= 0.4'} dependencies: - define-properties: 1.2.1 + define-data-property: 1.1.4 + es-object-atoms: 1.1.1 get-intrinsic: 1.3.0 + get-proto: 1.0.1 has-symbols: 1.1.0 - has-tostringtag: 1.0.2 - reflect.getprototypeof: 1.0.3 + set-function-name: 2.0.2 dev: true /jackspeak@3.4.3: @@ -18195,7 +18103,6 @@ packages: /jake@10.8.5: resolution: {integrity: sha512-sVpxYeuAhWt0OTWITwT98oyV0GsXyMlXCF+3L1SuafBVUIr/uILGRB+NqwkzhgXKvoJpDIpQvqkUALgdmQsQxw==} engines: {node: '>=10'} - hasBin: true dependencies: async: 3.2.4 chalk: 4.1.2 @@ -18745,7 +18652,7 @@ packages: jest-message-util: 30.2.0 jest-util: 30.2.0 pretty-format: 30.2.0 - semver: 7.7.2 + semver: 7.7.3 synckit: 0.11.11 transitivePeerDependencies: - supports-color @@ -18918,20 +18825,26 @@ packages: engines: {node: '>=12.0.0'} dev: true - /jsdoc@4.0.2: - resolution: {integrity: sha512-e8cIg2z62InH7azBBi3EsSEqrKx+nUtAS5bBcYTSpZFA+vhNPyhv8PTFZ0WsjOPDj04/dOLlm08EDcQJDqaGQg==} + /jsdoc-type-pratt-parser@4.1.0: + resolution: {integrity: sha512-Hicd6JK5Njt2QB6XYFS7ok9e37O8AYk3jTcppG4YVQnYjOemymvTcmc7OWsmq/Qqj5TdRFO5/x/tIPmBeRtGHg==} + engines: {node: '>=12.0.0'} + dev: true + + /jsdoc@4.0.5: + resolution: {integrity: sha512-P4C6MWP9yIlMiK8nwoZvxN84vb6MsnXcHuy7XzVOvQoCizWX5JFCBsWIIWKXBltpoRZXddUOVQmCTOZt9yDj9g==} engines: {node: '>=12.0.0'} + hasBin: true dependencies: '@babel/parser': 7.28.0 '@jsdoc/salty': 0.2.5 - '@types/markdown-it': 12.2.3 + '@types/markdown-it': 14.1.2 bluebird: 3.7.2 catharsis: 0.9.0 escape-string-regexp: 2.0.0 js2xmlparser: 4.0.2 klaw: 3.0.0 - markdown-it: 12.3.2 - markdown-it-anchor: 8.6.7(@types/markdown-it@12.2.3)(markdown-it@12.3.2) + markdown-it: 14.1.0 + markdown-it-anchor: 8.6.7(@types/markdown-it@14.1.2)(markdown-it@14.1.0) marked: 4.3.0 mkdirp: 1.0.4 requizzle: 0.2.4 @@ -19062,8 +18975,18 @@ packages: resolution: {integrity: sha512-fYQHZTZ8jSfmWZ0iyzfwiU4WDX4HpHbMCZ3gPlWYiCl3BoeOTsqKBqnTVfH2rYT7eP5c3sVbeSPHnnJOaTrWiw==} engines: {node: '>=4.0'} dependencies: - array-includes: 3.1.8 - object.assign: 4.1.5 + array-includes: 3.1.9 + object.assign: 4.1.7 + dev: true + + /jsx-ast-utils@3.3.5: + resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} + engines: {node: '>=4.0'} + dependencies: + array-includes: 3.1.9 + array.prototype.flat: 1.3.3 + object.assign: 4.1.7 + object.values: 1.2.1 dev: true /just-diff-apply@5.5.0: @@ -19159,10 +19082,10 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dev: true - /linkify-it@3.0.3: - resolution: {integrity: sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==} + /linkify-it@5.0.0: + resolution: {integrity: sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==} dependencies: - uc.micro: 1.0.6 + uc.micro: 2.1.0 dev: true /livereload-js@3.4.1: @@ -19511,24 +19434,26 @@ packages: resolution: {integrity: sha512-0aF7ZmVon1igznGI4VS30yugpduQW3y3GkcgGJOp7d8x8QrizhigUxjI/m2UojsXXto+jLAH3KSz+xOJTiORjg==} dev: true - /markdown-it-anchor@8.6.7(@types/markdown-it@12.2.3)(markdown-it@12.3.2): + /markdown-it-anchor@8.6.7(@types/markdown-it@14.1.2)(markdown-it@14.1.0): resolution: {integrity: sha512-FlCHFwNnutLgVTflOYHPW2pPcl2AACqVzExlkGQNsi4CJgqOHN7YTgDd4LuhgN1BFO3TS0vLAruV1Td6dwWPJA==} peerDependencies: '@types/markdown-it': '*' markdown-it: '*' dependencies: - '@types/markdown-it': 12.2.3 - markdown-it: 12.3.2 + '@types/markdown-it': 14.1.2 + markdown-it: 14.1.0 dev: true - /markdown-it@12.3.2: - resolution: {integrity: sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==} + /markdown-it@14.1.0: + resolution: {integrity: sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==} + hasBin: true dependencies: argparse: 2.0.1 - entities: 2.1.0 - linkify-it: 3.0.3 - mdurl: 1.0.1 - uc.micro: 1.0.6 + entities: 4.5.0 + linkify-it: 5.0.0 + mdurl: 2.0.0 + punycode.js: 2.3.1 + uc.micro: 2.1.0 dev: true /marked@12.0.2: @@ -19569,8 +19494,8 @@ packages: resolution: {integrity: sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w==} dev: false - /mdurl@1.0.1: - resolution: {integrity: sha512-/sKlQJCBYVY9Ers9hqzKou4H6V5UWc/M59TH2dvkt+84itfnq7uFOMLpOiOS4ujvHP4etln18fmIxA5R5fll0g==} + /mdurl@2.0.0: + resolution: {integrity: sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==} dev: true /media-typer@0.3.0: @@ -19652,8 +19577,8 @@ packages: resolution: {integrity: sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==} engines: {node: '>= 8'} - /meriyah@4.3.7: - resolution: {integrity: sha512-JAlSOUqFU/rmLy2CEdZO5hN5E5dyUj1f4AlRR4GCQMjfobvd5lcm9JLkrqq0MgVaLQ/Zur590A+0RyUZhj0b5A==} + /meriyah@4.5.0: + resolution: {integrity: sha512-Rbiu0QPIxTXgOXwiIpRVJfZRQ2FWyfzYrOGBs9SN5RbaXg1CN5ELn/plodwWwluX93yzc4qO/bNIen1ThGFCxw==} engines: {node: '>=10.4.0'} dev: true @@ -19769,6 +19694,7 @@ packages: engines: {node: '>=16 || 14 >=14.17'} dependencies: brace-expansion: 2.0.1 + dev: true /minimatch@9.0.5: resolution: {integrity: sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==} @@ -19966,10 +19892,6 @@ packages: hasBin: true dev: true - /natural-compare-lite@1.4.0: - resolution: {integrity: sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==} - dev: true - /natural-compare@1.4.0: resolution: {integrity: sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==} @@ -20160,10 +20082,6 @@ packages: resolution: {integrity: sha512-QNABxbrPa3qEIfrE6GOJ7BYIuignnJw7iQ2YPbc3Nla1HzRJjXzZOiikfF8m7eAMfichLt3M4VgLOetqgDmgGQ==} dev: true - /node-releases@2.0.14: - resolution: {integrity: sha512-y10wOWt8yZpqXmOgRo77WaHEmhYQYGNA6y421PKsKYWEK8aW+cqAphborZDhqfyKrbZEN92CN1X2KbafY2s7Yw==} - dev: true - /node-releases@2.0.19: resolution: {integrity: sha512-xxOWJsBKtzAq7DY0J+DTzuz58K8e7sJbdgwkbMWQe8UYB6ekmsQ45q0M/tJDsGaZmbC+l7n57UV8Hl5tHxO9uw==} @@ -20209,7 +20127,7 @@ packages: resolution: {integrity: sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==} dependencies: hosted-git-info: 2.8.9 - resolve: 1.22.10 + resolve: 1.22.11 semver: 5.7.2 validate-npm-package-license: 3.0.4 @@ -20618,7 +20536,7 @@ packages: resolution: {integrity: sha512-byy+U7gp+FVwmyzKPYhW2h5l3crpmGsxl7X2s8y43IgxvG4g3QZ6CffDtsNQy1WsmZpQbO+ybo0AlW7TY6DcBQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 has-symbols: 1.1.0 object-keys: 1.1.1 @@ -20649,27 +20567,28 @@ packages: resolution: {integrity: sha512-leTPzo4Zvg3pmbQ3rDK69Rl8GQvIqMWubrkxONG9/ojtFE2rD9fjMKfSI5BxW3osRH1m6VdzmqK8oAY9aT4x5w==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.24.0 dev: true - /object.fromentries@2.0.6: - resolution: {integrity: sha512-VciD13dswC4j1Xt5394WR4MzmAQmlgN72phd/riNp9vtD7tp4QQWJ0R4wvclXcafgcYK8veHRed2W6XeGBvcfg==} + /object.entries@1.1.9: + resolution: {integrity: sha512-8u/hfXFRBD1O0hPUjioLhoWFHRmt6tKA4/vZPyckBr18l1KE9uHrFaFaUi8MDRTpi4uak2goyPTSNJLXX2k2Hw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - es-abstract: 1.22.1 + es-object-atoms: 1.1.1 dev: true /object.fromentries@2.0.8: resolution: {integrity: sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.24.0 es-object-atoms: 1.1.1 dev: true @@ -20677,34 +20596,18 @@ packages: resolution: {integrity: sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - dev: true - - /object.hasown@1.1.2: - resolution: {integrity: sha512-B5UIT3J1W+WuWIU55h0mjlwaqxiE5vYENJXIXZ4VFe05pNYrkKuK0U/6aFcb0pKywYJh7IhfoqUfKVmrJJHZHw==} - dependencies: - define-properties: 1.2.1 - es-abstract: 1.23.3 - dev: true - - /object.values@1.1.5: - resolution: {integrity: sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.22.1 + es-abstract: 1.24.0 dev: true - /object.values@1.2.0: - resolution: {integrity: sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==} + /object.values@1.1.5: + resolution: {integrity: sha512-QUZRW0ilQ3PnPpbNtgdNV1PDbEqLIiSFB3l+EnGtBQ/8SUTLj1PZwtQHABZtLgwpJZTSZhuGLOGk57Drx2IvYg==} engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.7 define-properties: 1.2.1 - es-object-atoms: 1.1.1 + es-abstract: 1.22.1 dev: true /object.values@1.2.1: @@ -20738,8 +20641,8 @@ packages: dependencies: ee-first: 1.1.1 - /on-headers@1.0.2: - resolution: {integrity: sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==} + /on-headers@1.1.0: + resolution: {integrity: sha512-737ZY3yNnXy37FHkQxPzt4UZ2UWPWiCZWLvFZ4fu5cueciegX0zGPnrlY6bwRg4FdQOe9YU8MkmJwGhoMybl8A==} engines: {node: '>= 0.8'} dev: true @@ -20831,17 +20734,6 @@ packages: word-wrap: 1.2.5 dev: true - /optionator@0.9.3: - resolution: {integrity: sha512-JjCoypp+jKn1ttEFExxhetCKeJt9zhAgAve5FXHixTvFDW/5aEktX9bufBKLRRMdU7bNtpLfcGu94B3cdEJgjg==} - engines: {node: '>= 0.8.0'} - dependencies: - '@aashutoshrathi/word-wrap': 1.2.6 - deep-is: 0.1.4 - fast-levenshtein: 2.0.6 - levn: 0.4.1 - prelude-ls: 1.2.1 - type-check: 0.4.0 - /optionator@0.9.4: resolution: {integrity: sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==} engines: {node: '>= 0.8.0'} @@ -20852,7 +20744,6 @@ packages: prelude-ls: 1.2.1 type-check: 0.4.0 word-wrap: 1.2.5 - dev: true /opts@2.0.2: resolution: {integrity: sha512-k41FwbcLnlgnFh69f4qdUfvDQ+5vaSDnVPFI/y5XuhKRq97EnVVneO9F1ESVCdiVu4fCS2L8usX3mU331hB7pg==} @@ -20898,6 +20789,11 @@ packages: macos-release: 2.5.1 windows-release: 4.0.0 + /os-tmpdir@1.0.2: + resolution: {integrity: sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g==} + engines: {node: '>=0.10.0'} + dev: true + /outdent@0.5.0: resolution: {integrity: sha512-/jHxFIzoMXdqPzTaCpFzAAWhpkSjZPF4Vsn6jAfNpmbH/ymsmd7Qc6VE9BGn0L6YMj6uwpQLxCECpus4ukKS9Q==} dev: true @@ -21156,6 +21052,20 @@ packages: is-hexadecimal: 1.0.4 dev: false + /parse-imports-exports@0.2.4: + resolution: {integrity: sha512-4s6vd6dx1AotCx/RCI2m7t7GCh5bDRUtGNvRfHSP2wbBQdMi67pPe7mtzmgwcaQ8VKK/6IB7Glfyu3qdZJPybQ==} + dependencies: + parse-statements: 1.0.11 + dev: true + + /parse-imports@2.2.1: + resolution: {integrity: sha512-OL/zLggRp8mFhKL0rNORUTR4yBYujK/uU+xZL+/0Rgm2QE4nLO9v8PzEweSJEbMGKmDRjJE4R3IMJlL2di4JeQ==} + engines: {node: '>= 18'} + dependencies: + es-module-lexer: 1.7.0 + slashes: 3.0.12 + dev: true + /parse-json@5.2.0: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} @@ -21185,6 +21095,10 @@ packages: resolution: {integrity: sha512-/2qh0lav6CmI15FzA3i/2Bzk2zCgQhGMkvhOhKNcBVQ1ldgpbfiNTVslmooUmWJcADi1f1kIeynbDRVzNlfR6Q==} dev: false + /parse-statements@1.0.11: + resolution: {integrity: sha512-HlsyYdMBnbPQ9Jr/VgJ1YF4scnldvJpJxCVx6KgqPL4dxppsWrJHCIIxQXMJrqGnsRkNPATbeMJ8Yxu7JMsYcA==} + dev: true + /parse5-htmlparser2-tree-adapter@7.0.0: resolution: {integrity: sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==} dependencies: @@ -21584,6 +21498,13 @@ packages: /prettier@2.8.8: resolution: {integrity: sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==} engines: {node: '>=10.13.0'} + hasBin: true + dev: true + + /prettier@3.6.2: + resolution: {integrity: sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==} + engines: {node: '>=14'} + hasBin: true dev: true /prettify-xml@1.2.0: @@ -21644,7 +21565,7 @@ packages: engines: {node: '>= 0.8'} dev: true - /pretty-quick@3.3.1(prettier@2.8.8): + /pretty-quick@3.3.1(prettier@3.6.2): resolution: {integrity: sha512-3b36UXfYQ+IXXqex6mCca89jC8u0mYLqFAN5eTQKoXO6oCQYcIVYZEB/5AlBHI7JPYygReM2Vv6Vom/Gln7fBg==} engines: {node: '>=10.13'} hasBin: true @@ -21657,7 +21578,7 @@ packages: mri: 1.2.0 picocolors: 1.1.1 picomatch: 3.0.1 - prettier: 2.8.8 + prettier: 3.6.2 tslib: 2.8.1 dev: true @@ -21717,7 +21638,7 @@ packages: resolution: {integrity: sha512-K+Tk3Kd9V0odiXFP9fwDHUYRyvK3Nun3GVyPapSIs5OBkITAm15W0CPFD/YKTkMUAbc0b9CUwRQp2ybiBIq+eA==} dependencies: has: 1.0.3 - object.assign: 4.1.5 + object.assign: 4.1.7 reflect.ownkeys: 0.2.0 dev: true @@ -21804,6 +21725,11 @@ packages: end-of-stream: 1.4.4 once: 1.4.0 + /punycode.js@2.3.1: + resolution: {integrity: sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==} + engines: {node: '>=6'} + dev: true + /punycode@1.3.2: resolution: {integrity: sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw==} dev: false @@ -21947,6 +21873,11 @@ packages: engines: {node: '>=12'} dev: true + /random-int@3.1.0: + resolution: {integrity: sha512-h8CRz8cpvzj0hC/iH/1Gapgcl2TQ6xtnCpyOI5WvWfXf/yrDx2DOU+tD9rX23j36IF11xg1KqB9W11Z18JPMdw==} + engines: {node: '>=12'} + dev: true + /randombytes@2.1.0: resolution: {integrity: sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==} dependencies: @@ -22005,7 +21936,7 @@ packages: '@types/doctrine': 0.0.9 '@types/resolve': 1.20.2 doctrine: 3.0.0 - resolve: 1.22.10 + resolve: 1.22.11 strip-indent: 4.0.0 transitivePeerDependencies: - supports-color @@ -22411,7 +22342,7 @@ packages: resolution: {integrity: sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw==} engines: {node: '>= 0.10'} dependencies: - resolve: 1.22.10 + resolve: 1.22.11 /redent@3.0.0: resolution: {integrity: sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==} @@ -22457,6 +22388,13 @@ packages: '@babel/runtime': 7.27.6 dev: true + /refa@0.12.1: + resolution: {integrity: sha512-J8rn6v4DBb2nnFqkqwy6/NnTYMcgLA+sLr0iIO41qpv0n+ngb7ksag2tMRl0inb1bbO/esUwzW1vbJi7K0sI0g==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dependencies: + '@eslint-community/regexpp': 4.12.2 + dev: true + /reflect-metadata@0.1.13: resolution: {integrity: sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==} @@ -22477,18 +22415,6 @@ packages: which-builtin-type: 1.2.1 dev: true - /reflect.getprototypeof@1.0.3: - resolution: {integrity: sha512-TTAOZpkJ2YLxl7mVHWrNo3iDMEkYlva/kgFcXndqMgbo/AZUmmavEkdXV+hXtE4P8xdyEKRzalaFqZVuwIk/Nw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.1 - get-intrinsic: 1.3.0 - globalthis: 1.0.3 - which-builtin-type: 1.1.3 - dev: true - /reflect.ownkeys@0.2.0: resolution: {integrity: sha512-qOLsBKHCpSOFKK1NUOCGC5VyeufB6lEsFe92AL2bhIJsacZS1qdoOZSbPk3MYKuT2cFlRDnulKXuuElIrMjGUg==} dev: true @@ -22515,6 +22441,14 @@ packages: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} dev: true + /regexp-ast-analysis@0.7.1: + resolution: {integrity: sha512-sZuz1dYW/ZsfG17WSAG7eS85r5a0dDsvg+7BiiYR5o6lKCAtUrEwdmRmaGF6rwVj3LcmAeYkOWKEPlbPzN3Y3A==} + engines: {node: ^12.0.0 || ^14.0.0 || >=16.0.0} + dependencies: + '@eslint-community/regexpp': 4.12.2 + refa: 0.12.1 + dev: true + /regexp-to-ast@0.5.0: resolution: {integrity: sha512-tlbJqcMHnPKI9zSrystikWKwHkBqu2a/Sgw01h3zFjvYrMxEDYHzzoMZnUrbIfpTFEsoRnnviOXNCzFiSc54Qw==} @@ -22522,7 +22456,7 @@ packages: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 es-errors: 1.3.0 set-function-name: 2.0.2 @@ -22650,7 +22584,7 @@ packages: dependencies: debug: 4.4.1 module-details-from-path: 1.0.3 - resolve: 1.22.10 + resolve: 1.22.11 transitivePeerDependencies: - supports-color dev: false @@ -22713,8 +22647,8 @@ packages: engines: {node: '>=10'} dev: true - /resolve@1.22.10: - resolution: {integrity: sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==} + /resolve@1.22.11: + resolution: {integrity: sha512-RfqAvLnMl313r7c9oclB1HhUEAezcpLjz95wFH4LVuhk9JF/r22qmVP9AMmOU4vMX7Q8pN8jwNg/CSpdFnMjTQ==} engines: {node: '>= 0.4'} hasBin: true dependencies: @@ -22730,8 +22664,9 @@ packages: supports-preserve-symlinks-flag: 1.0.0 dev: true - /resolve@2.0.0-next.4: - resolution: {integrity: sha512-iMDbmAWtfU+MHpxt/I5iWI7cY6YVEZUQ3MBgPQ++XD1PELuJHIl82xBmObyP2KyQmkNB2dsqF7seoQQiAn5yDQ==} + /resolve@2.0.0-next.5: + resolution: {integrity: sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==} + hasBin: true dependencies: is-core-module: 2.16.1 path-parse: 1.0.7 @@ -22827,6 +22762,7 @@ packages: /rollup@3.29.5: resolution: {integrity: sha512-GVsDdsbJzzy4S/v3dqWPJ7EfvZJfCHiDqe80IyrF59LYuP+e6U1LJoUqeuqRbwAWoMNoXivMNeNAOf5E22VA1w==} engines: {node: '>=14.18.0', npm: '>=8.0.0'} + hasBin: true optionalDependencies: fsevents: 2.3.3 dev: true @@ -22872,6 +22808,27 @@ packages: - supports-color dev: true + /rspack-resolver@1.3.0: + resolution: {integrity: sha512-az/PLDwa1xijNv4bAFBS8mtqqJC1Y3lVyFag4cuyIUOHq/ft5kSZlHbqYaLZLpsQtPWv4ZGDo5ycySKJzUvU/A==} + deprecated: Please migrate to the brand new `@rspack/resolver` or `unrs-resolver` instead + optionalDependencies: + '@unrs/rspack-resolver-binding-darwin-arm64': 1.3.0 + '@unrs/rspack-resolver-binding-darwin-x64': 1.3.0 + '@unrs/rspack-resolver-binding-freebsd-x64': 1.3.0 + '@unrs/rspack-resolver-binding-linux-arm-gnueabihf': 1.3.0 + '@unrs/rspack-resolver-binding-linux-arm-musleabihf': 1.3.0 + '@unrs/rspack-resolver-binding-linux-arm64-gnu': 1.3.0 + '@unrs/rspack-resolver-binding-linux-arm64-musl': 1.3.0 + '@unrs/rspack-resolver-binding-linux-ppc64-gnu': 1.3.0 + '@unrs/rspack-resolver-binding-linux-s390x-gnu': 1.3.0 + '@unrs/rspack-resolver-binding-linux-x64-gnu': 1.3.0 + '@unrs/rspack-resolver-binding-linux-x64-musl': 1.3.0 + '@unrs/rspack-resolver-binding-wasm32-wasi': 1.3.0 + '@unrs/rspack-resolver-binding-win32-arm64-msvc': 1.3.0 + '@unrs/rspack-resolver-binding-win32-ia32-msvc': 1.3.0 + '@unrs/rspack-resolver-binding-win32-x64-msvc': 1.3.0 + dev: true + /rst-selector-parser@2.2.3: resolution: {integrity: sha512-nDG1rZeP6oFTLN6yNDV/uiAvs1+FS/KlrEwh7+y7dpuApDBy6bI2HTBcc0/V8lv9OTqfyD34eF7au2pm8aBbhA==} dependencies: @@ -22916,17 +22873,7 @@ packages: resolution: {integrity: sha512-9dVEFruWIsnie89yym+xWTAYASdpw3CJV7Li/6zBewGf9z2i1j31rP6jnY0pHEO4QZh6N0K11bFjWmdR8UGdPQ==} engines: {node: '>=0.4'} dependencies: - call-bind: 1.0.7 - get-intrinsic: 1.3.0 - has-symbols: 1.1.0 - isarray: 2.0.5 - dev: true - - /safe-array-concat@1.1.2: - resolution: {integrity: sha512-vj6RsCsWBCf19jIeHEfkRMw8DPiBb+DMXklQ/1SGDHOMlHdPUkZXFQ2YdplS23zESTijAcurb1aSgJA3AgMu1Q==} - engines: {node: '>=0.4'} - dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 get-intrinsic: 1.3.0 has-symbols: 1.1.0 isarray: 2.0.5 @@ -22964,20 +22911,11 @@ packages: /safe-regex-test@1.0.0: resolution: {integrity: sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 get-intrinsic: 1.3.0 is-regex: 1.1.4 dev: true - /safe-regex-test@1.0.3: - resolution: {integrity: sha512-CdASjNJPvRa7roO6Ra/gLYBTzYzzPyyBXxIMdGW3USQLyjWEls2RgW5UBTXaQVp+OrpeCK3bLem8smtmheoRuw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-regex: 1.1.4 - dev: true - /safe-regex-test@1.1.0: resolution: {integrity: sha512-x/+Cz4YrimQxQccJf5mKEbIa1NzeCRNI5Ecl/ekmlYaampdNLPalVyIcCZNNH3MvmqBugV5TMYZXv0ljslUlaw==} engines: {node: '>= 0.4'} @@ -23314,6 +23252,15 @@ packages: resolution: {integrity: sha512-g3WxHrqSWCZHGHlSrF51VXFdjImhwvH8ZO/pryFH56Qi0cDsZfylQa/t0jCzVQFNbNvM00HfHjkDPEuarKDSWQ==} engines: {node: '>=8'} + /scslre@0.3.0: + resolution: {integrity: sha512-3A6sD0WYP7+QrjbfNA2FN3FsOaGGFoekCVgTyypy53gPxhbkCIjtO6YWgdrfM+n/8sI8JeXZOIxsHjMTNxQ4nQ==} + engines: {node: ^14.0.0 || >=16.0.0} + dependencies: + '@eslint-community/regexpp': 4.12.2 + refa: 0.12.1 + regexp-ast-analysis: 0.7.1 + dev: true + /section-matter@1.0.0: resolution: {integrity: sha512-vfD3pmTzGpufjScBh50YHKzEu2lxBWhVEHsNGoEXmCmn2hKGfeNLYMzCJpe8cD7gqX7TJluOVpBkAequ6dgMmA==} engines: {node: '>=4'} @@ -23339,6 +23286,7 @@ packages: /semver@6.3.1: resolution: {integrity: sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==} + hasBin: true /semver@7.5.4: resolution: {integrity: sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==} @@ -23355,12 +23303,6 @@ packages: resolution: {integrity: sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==} engines: {node: '>=10'} - /semver@7.7.2: - resolution: {integrity: sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==} - engines: {node: '>=10'} - hasBin: true - dev: true - /semver@7.7.3: resolution: {integrity: sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==} engines: {node: '>=10'} @@ -23637,6 +23579,10 @@ packages: engines: {node: '>=14.16'} dev: true + /slashes@3.0.12: + resolution: {integrity: sha512-Q9VME8WyGkc7pJf6QEkj3wE+2CnvZMI+XJhwdTPR8Z/kWQRXi7boAWLDibRPyHRTUTPx5FaU7MsyrjI3yLB4HA==} + dev: true + /slice-ansi@4.0.0: resolution: {integrity: sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==} engines: {node: '>=10'} @@ -23740,9 +23686,9 @@ packages: resolution: {integrity: sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==} engines: {node: '>=0.10.0'} - /source-map@0.7.4: - resolution: {integrity: sha512-l3BikUxvPOcn5E74dZiq5BGsTb5yEwhaTSzccU6t4sDOH8NWJCstKO5QT2CvtFoK6F0saL7p9xHAqHOlCPJygA==} - engines: {node: '>= 8'} + /source-map@0.7.6: + resolution: {integrity: sha512-i5uvt8C3ikiWeNZSVZNWcfZPItFQOsYTUAOkcUPGd8DqDy1uOUikjt5dG+uRlwyvR108Fb9DOd4GvXfT0N2/uQ==} + engines: {node: '>= 12'} dev: true /sourcemap-codec@1.4.8: @@ -23919,7 +23865,7 @@ packages: - webpack dev: true - /storybook@8.4.2(prettier@2.8.8): + /storybook@8.4.2(prettier@3.6.2): resolution: {integrity: sha512-GMCgyAulmLNrkUtDkCpFO4SB77YrpiIxq6e5tzaQdXEuaDu1mdNwOuP3VG7nE2FzxmqDvagSgriM68YW9iFaZA==} hasBin: true peerDependencies: @@ -23928,8 +23874,8 @@ packages: prettier: optional: true dependencies: - '@storybook/core': 8.4.2(prettier@2.8.8) - prettier: 2.8.8 + '@storybook/core': 8.4.2(prettier@3.6.2) + prettier: 3.6.2 transitivePeerDependencies: - bufferutil - supports-color @@ -24019,19 +23965,32 @@ packages: emoji-regex: 9.2.2 strip-ansi: 7.1.2 - /string.prototype.matchall@4.0.8: - resolution: {integrity: sha512-6zOCOcJ+RJAQshcTvXPHoxoQGONa3e/Lqx90wUA+wEzX78sg5Bo+1tQo4N0pohS0erG9qtCqJDjNCQBjeWVxyg==} + /string.prototype.matchall@4.0.12: + resolution: {integrity: sha512-6CC9uyBL+/48dYizRf7H7VAYCMCNTBeM78x/VTUe9bFEaxBepPJDa1Ow99LqI/1yF7kuy7Q3cQsYMrcjGUcskA==} + engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 + call-bound: 1.0.4 define-properties: 1.2.1 - es-abstract: 1.23.3 + es-abstract: 1.24.0 + es-errors: 1.3.0 + es-object-atoms: 1.1.1 get-intrinsic: 1.3.0 + gopd: 1.2.0 has-symbols: 1.1.0 - internal-slot: 1.0.7 - regexp.prototype.flags: 1.5.2 + internal-slot: 1.1.0 + regexp.prototype.flags: 1.5.4 + set-function-name: 2.0.2 side-channel: 1.1.0 dev: true + /string.prototype.repeat@1.0.0: + resolution: {integrity: sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==} + dependencies: + define-properties: 1.2.1 + es-abstract: 1.24.0 + dev: true + /string.prototype.trim@1.2.10: resolution: {integrity: sha512-Rs66F0P/1kedk5lyYyH9uBzuiI/kNRmwJAR9quK6VOtIpZ2G+hMZd+HQbbv25MgCA6gEffoMZYxlTod4WcdrKA==} engines: {node: '>= 0.4'} @@ -24058,35 +24017,9 @@ packages: resolution: {integrity: sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.1 - dev: true - - /string.prototype.trim@1.2.9: - resolution: {integrity: sha512-klHuCNxiMZ8MlsOihJhJEBJAiMVqU3Z2nEXWfWnIqjN0gEFS9J9+IxKozWWtQGcgoa1WUZzLjKPTr4ZHNFTFxw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.23.3 - es-object-atoms: 1.1.1 - dev: true - - /string.prototype.trimend@1.0.6: - resolution: {integrity: sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==} - dependencies: - call-bind: 1.0.7 - define-properties: 1.2.1 - es-abstract: 1.22.1 - dev: true - - /string.prototype.trimend@1.0.8: - resolution: {integrity: sha512-p73uL5VCHCO2BZZ6krwwQE3kCzM7NKmis8S//xEC6fQonchbum4eP6kR4DLEjQFO3Wnj3Fuo8NM0kOSjVdHjZQ==} - dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-object-atoms: 1.1.1 + es-abstract: 1.24.0 dev: true /string.prototype.trimend@1.0.9: @@ -24102,16 +24035,16 @@ packages: /string.prototype.trimstart@1.0.6: resolution: {integrity: sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 - es-abstract: 1.22.1 + es-abstract: 1.24.0 dev: true /string.prototype.trimstart@1.0.8: resolution: {integrity: sha512-UXSH262CSZY1tfu3G3Secr6uGLCFVPMhIqHjlgCUtCCcgihYc/xKs9djMTMUOb2j1mVSeU8EU6NWc/iQKU6Gfg==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 define-properties: 1.2.1 es-object-atoms: 1.1.1 dev: true @@ -24320,6 +24253,14 @@ packages: '@pkgr/core': 0.2.9 dev: true + /synckit@0.9.3: + resolution: {integrity: sha512-JJoOEKTfL1urb1mDoEblhD9NhEbWmq9jHEMEnxoC4ujUaZ4itA8vKgwkFAyNClgxplLi9tsUKX+EduK0p/l7sg==} + engines: {node: ^14.18.0 || >=16.0.0} + dependencies: + '@pkgr/core': 0.1.2 + tslib: 2.8.1 + dev: true + /table-layout@4.1.1: resolution: {integrity: sha512-iK5/YhZxq5GO5z8wb0bY1317uDF3Zjpha0QFFLA8/trAoiLbQD0HUbMesEaxyzUgDxi2QlcbM8IvqOlEjgoXBA==} engines: {node: '>=12.17'} @@ -24468,7 +24409,7 @@ packages: engines: {node: '>=10'} dependencies: '@jridgewell/source-map': 0.3.6 - acorn: 8.14.1 + acorn: 8.15.0 commander: 2.20.3 source-map-support: 0.5.21 dev: true @@ -24535,6 +24476,13 @@ packages: engines: {node: '>=12'} dev: true + /tmp@0.0.33: + resolution: {integrity: sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==} + engines: {node: '>=0.6.0'} + dependencies: + os-tmpdir: 1.0.2 + dev: true + /tmp@0.2.3: resolution: {integrity: sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==} engines: {node: '>=14.14'} @@ -24611,20 +24559,11 @@ packages: utf8-byte-length: 1.0.4 dev: false - /ts-api-utils@1.2.1(typescript@5.9.3): - resolution: {integrity: sha512-RIYA36cJn2WiH9Hy77hdF9r7oEwxAtB/TS9/S4Qd90Ap4z5FSiin5zEiTL44OII1Y3IIlEvxwxFUVgrHSZ/UpA==} - engines: {node: '>=16'} - peerDependencies: - typescript: '>=4.2.0' - dependencies: - typescript: 5.9.3 - dev: false - - /ts-api-utils@1.3.0(typescript@5.9.3): - resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} - engines: {node: '>=16'} + /ts-api-utils@2.1.0(typescript@5.9.3): + resolution: {integrity: sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==} + engines: {node: '>=18.12'} peerDependencies: - typescript: '>=4.2.0' + typescript: '>=4.8.4' dependencies: typescript: 5.9.3 @@ -24819,10 +24758,6 @@ packages: resolution: {integrity: sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==} engines: {node: '>=4'} - /type-fest@0.20.2: - resolution: {integrity: sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==} - engines: {node: '>=10'} - /type-fest@0.21.3: resolution: {integrity: sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==} engines: {node: '>=10'} @@ -24875,20 +24810,11 @@ packages: resolution: {integrity: sha512-Y8KTSIglk9OZEr8zywiIHG/kmQ7KWyjseXs1CbSo8vC42w7hg2HgYTxSWwP0+is7bWDc1H+Fo026CpHFwm8tkw==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 get-intrinsic: 1.3.0 is-typed-array: 1.1.13 dev: true - /typed-array-buffer@1.0.2: - resolution: {integrity: sha512-gEymJYKZtKXzzBzM4jqa9w6Q1Jjm7x2d+sh19AdsD4wqnMPDYyvwpsIc2Q/835kHuo3BEQ7CjelGhfTsoBb2MQ==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 - es-errors: 1.3.0 - is-typed-array: 1.1.13 - dev: true - /typed-array-buffer@1.0.3: resolution: {integrity: sha512-nAYYwfY3qnzX30IkA6AQZjVbtK6duGontcQm1WSG1MD94YLqK0515GNApXkoxKOWMusVssAHWLh9SeaoefYFGw==} engines: {node: '>= 0.4'} @@ -24902,20 +24828,9 @@ packages: resolution: {integrity: sha512-Or/+kvLxNpeQ9DtSydonMxCx+9ZXOswtwJn17SNLvhptaXYDJvkFFP5zbfU/uLmvnBJlI4yrnXRxpdWH/M5tNA==} engines: {node: '>= 0.4'} dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - dev: true - - /typed-array-byte-length@1.0.1: - resolution: {integrity: sha512-3iMJ9q0ao7WE9tWcaYKIptkNBuOIcZCCT0d4MRvuuH88fEoEH62IuQe0OtraD3ebQEoTRk8XCBoknUNc1Y67pw==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.2.0 - has-proto: 1.0.3 + has-proto: 1.2.0 is-typed-array: 1.1.13 dev: true @@ -24924,7 +24839,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.8 - for-each: 0.3.3 + for-each: 0.3.5 gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 @@ -24935,21 +24850,9 @@ packages: engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 - for-each: 0.3.3 - has-proto: 1.0.3 - is-typed-array: 1.1.13 - dev: true - - /typed-array-byte-offset@1.0.2: - resolution: {integrity: sha512-Ous0vodHa56FviZucS2E63zkgtgrACj7omjwd/8lTEMEPFFyjfixMZ1ZXenpgCFBBt4EC1J2XsyVS2gkG0eTFA==} - engines: {node: '>= 0.4'} - dependencies: - available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.2.0 - has-proto: 1.0.3 + has-proto: 1.2.0 is-typed-array: 1.1.13 dev: true @@ -24959,7 +24862,7 @@ packages: dependencies: available-typed-arrays: 1.0.7 call-bind: 1.0.8 - for-each: 0.3.3 + for-each: 0.3.5 gopd: 1.2.0 has-proto: 1.2.0 is-typed-array: 1.1.15 @@ -24969,21 +24872,9 @@ packages: /typed-array-length@1.0.4: resolution: {integrity: sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==} dependencies: - call-bind: 1.0.7 - for-each: 0.3.3 - is-typed-array: 1.1.13 - dev: true - - /typed-array-length@1.0.6: - resolution: {integrity: sha512-/OxDN6OtAk5KBpGb28T+HZc2M+ADtvRxXrKKbUwtsLgdoxgX13hyy7ek6bFRl5+aBs2yZzB0c4CnQfAtVypW/g==} - engines: {node: '>= 0.4'} - dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 - gopd: 1.2.0 - has-proto: 1.0.3 is-typed-array: 1.1.13 - possible-typed-array-names: 1.0.0 dev: true /typed-array-length@1.0.7: @@ -24991,7 +24882,7 @@ packages: engines: {node: '>= 0.4'} dependencies: call-bind: 1.0.8 - for-each: 0.3.3 + for-each: 0.3.5 gopd: 1.2.0 is-typed-array: 1.1.15 possible-typed-array-names: 1.0.0 @@ -25004,6 +24895,22 @@ packages: is-typedarray: 1.0.0 dev: true + /typescript-eslint@8.46.2(eslint@9.36.0)(typescript@5.9.3): + resolution: {integrity: sha512-vbw8bOmiuYNdzzV3lsiWv6sRwjyuKJMQqWulBOU7M0RrxedXledX8G8kBbQeiOYDnTfiXz0Y4081E1QMNB6iQg==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} + peerDependencies: + eslint: ^8.57.0 || ^9.0.0 + typescript: '>=4.8.4 <6.0.0' + dependencies: + '@typescript-eslint/eslint-plugin': 8.46.2(@typescript-eslint/parser@8.46.2)(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/parser': 8.46.2(eslint@9.36.0)(typescript@5.9.3) + '@typescript-eslint/typescript-estree': 8.46.2(typescript@5.9.3) + '@typescript-eslint/utils': 8.46.2(eslint@9.36.0)(typescript@5.9.3) + eslint: 9.36.0 + typescript: 5.9.3 + transitivePeerDependencies: + - supports-color + /typescript@5.9.3: resolution: {integrity: sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==} engines: {node: '>=14.17'} @@ -25017,8 +24924,8 @@ packages: resolution: {integrity: sha512-ya4mg/30vm+DOWfBg4YK3j2WD6TWtRkCbasOJr40CseYENzCUby/7rIvXA99JGsQHeNxLbnXdyLLxKSv3tauFw==} engines: {node: '>=12.17'} - /uc.micro@1.0.6: - resolution: {integrity: sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==} + /uc.micro@2.1.0: + resolution: {integrity: sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==} dev: true /uglify-js@3.19.3: @@ -25036,9 +24943,9 @@ packages: '@javascript-obfuscator/escodegen': 2.3.0 '@rollup/plugin-commonjs': 25.0.8(rollup@3.29.5) '@rollup/plugin-json': 6.1.0(rollup@3.29.5) - '@rollup/plugin-node-resolve': 15.3.0(rollup@3.29.5) + '@rollup/plugin-node-resolve': 15.3.1(rollup@3.29.5) '@rollup/plugin-replace': 5.0.7(rollup@3.29.5) - '@rollup/pluginutils': 5.1.3(rollup@3.29.5) + '@rollup/pluginutils': 5.3.0(rollup@3.29.5) espree: 9.6.1 estraverse: 5.3.0 fast-xml-parser: 4.4.1 @@ -25061,9 +24968,9 @@ packages: '@babel/preset-typescript': 7.27.1(@babel/core@7.28.0) babel-plugin-transform-async-to-promises: 0.8.18 babel-plugin-transform-remove-console: 6.9.4 - babel-preset-transform-ui5: 7.3.0 - browserslist: 4.23.0 - comment-json: 4.2.3 + babel-preset-transform-ui5: 7.8.0(@babel/core@7.28.0) + browserslist: 4.26.3 + comment-json: 4.2.5 transitivePeerDependencies: - supports-color dev: true @@ -25071,7 +24978,7 @@ packages: /unbox-primitive@1.0.2: resolution: {integrity: sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==} dependencies: - call-bind: 1.0.7 + call-bind: 1.0.8 has-bigints: 1.0.2 has-symbols: 1.1.0 which-boxed-primitive: 1.0.2 @@ -25285,17 +25192,6 @@ packages: mkdirp: 0.5.6 dev: false - /update-browserslist-db@1.0.13(browserslist@4.23.0): - resolution: {integrity: sha512-xebP81SNcPuNpPP3uzeW1NYXxI3rxyJzF3pD6sH4jE7o/IX+WtSpwnVU+qIsDPyk0d3hmFQ7mjqc6AtV604hbg==} - hasBin: true - peerDependencies: - browserslist: '>= 4.21.0' - dependencies: - browserslist: 4.23.0 - escalade: 3.2.0 - picocolors: 1.1.1 - dev: true - /update-browserslist-db@1.1.1(browserslist@4.24.4): resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==} hasBin: true @@ -25333,7 +25229,7 @@ packages: engines: {node: '>=14.16'} dependencies: boxen: 7.1.1 - chalk: 5.3.0 + chalk: 5.6.2 configstore: 6.0.0 has-yarn: 3.0.0 import-lazy: 4.0.0 @@ -25746,7 +25642,7 @@ packages: optional: true dependencies: '@types/eslint-scope': 3.7.7 - '@types/estree': 1.0.6 + '@types/estree': 1.0.8 '@webassemblyjs/ast': 1.12.1 '@webassemblyjs/wasm-edit': 1.12.1 '@webassemblyjs/wasm-parser': 1.12.1 @@ -25803,7 +25699,7 @@ packages: is-bigint: 1.0.4 is-boolean-object: 1.1.2 is-number-object: 1.0.6 - is-string: 1.0.7 + is-string: 1.1.1 is-symbol: 1.0.4 dev: true @@ -25818,24 +25714,6 @@ packages: is-symbol: 1.1.1 dev: true - /which-builtin-type@1.1.3: - resolution: {integrity: sha512-YmjsSMDBYsM1CaFiayOVT06+KJeXf0o5M/CAd4o1lTadFAtacTUM49zoYxr/oroopFDfhvN6iEcBxUyc3gvKmw==} - engines: {node: '>= 0.4'} - dependencies: - function.prototype.name: 1.1.5 - has-tostringtag: 1.0.2 - is-async-function: 2.0.0 - is-date-object: 1.0.5 - is-finalizationregistry: 1.0.2 - is-generator-function: 1.0.10 - is-regex: 1.1.4 - is-weakref: 1.0.2 - isarray: 2.0.5 - which-boxed-primitive: 1.0.2 - which-collection: 1.0.1 - which-typed-array: 1.1.15 - dev: true - /which-builtin-type@1.2.1: resolution: {integrity: sha512-6iBczoX+kDQ7a3+YJBnh3T+KZRxM/iYNPXicqk66/Qfm1b93iu+yOImkg0zHbj5LNOcNv1TEADiZ0xa34B4q6Q==} engines: {node: '>= 0.4'} @@ -25890,7 +25768,7 @@ packages: engines: {node: '>= 0.4'} dependencies: available-typed-arrays: 1.0.7 - call-bind: 1.0.7 + call-bind: 1.0.8 for-each: 0.3.3 gopd: 1.2.0 has-tostringtag: 1.0.2 @@ -25998,7 +25876,6 @@ packages: /word-wrap@1.2.5: resolution: {integrity: sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==} engines: {node: '>=0.10.0'} - dev: true /wordwrap@1.0.0: resolution: {integrity: sha512-gvVzJFlPycKc5dZN4yPkP8w7Dc37BtP1yczEneOb4uq34pXZcvrtRTmWV8W+Ume+XCxKgbjM+nevkyFPMybd4Q==} diff --git a/tests/integration/adaptation-editor/.eslintignore b/tests/integration/adaptation-editor/.eslintignore deleted file mode 100644 index cc1f8e004cc..00000000000 --- a/tests/integration/adaptation-editor/.eslintignore +++ /dev/null @@ -1,2 +0,0 @@ -test/fixtures -dist diff --git a/tests/integration/adaptation-editor/.eslintrc.js b/tests/integration/adaptation-editor/.eslintrc.js deleted file mode 100644 index 7e3ca39d610..00000000000 --- a/tests/integration/adaptation-editor/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - extends: ['../../../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - 'no-console': 'off' - } -}; diff --git a/tests/integration/adaptation-editor/eslint.config.js b/tests/integration/adaptation-editor/eslint.config.js new file mode 100644 index 00000000000..0b30744c7cb --- /dev/null +++ b/tests/integration/adaptation-editor/eslint.config.js @@ -0,0 +1,17 @@ +const base = require('../../../eslint.config.js'); +module.exports = [ + ...base, + { + ignores: ['test/fixtures', 'dist', "version.js"], + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: 'tsconfig.eslint.json', + }, + }, + rules: { + 'no-console': 'off' + } + }, +]; diff --git a/tests/integration/adaptation-editor/manual-test-case-reporter.ts b/tests/integration/adaptation-editor/manual-test-case-reporter.ts index 6a206d38ca8..d1ec0a9f57a 100644 --- a/tests/integration/adaptation-editor/manual-test-case-reporter.ts +++ b/tests/integration/adaptation-editor/manual-test-case-reporter.ts @@ -125,7 +125,7 @@ export default class ManualTestCaseReporter implements Reporter { this.manualTestCases[test.title].steps ??= []; const parsedStep = parseActionStep(step.title); const lastStep = this.manualTestCases[test.title].steps[this.manualTestCases[test.title].steps.length - 1]; - const isDuplicate = lastStep && parsedStep === lastStep.name; + const isDuplicate = parsedStep === lastStep?.name; if (!isDuplicate) { this.manualTestCases[test.title].steps.push({ name: parsedStep }); } diff --git a/tests/integration/adaptation-editor/package.json b/tests/integration/adaptation-editor/package.json index ff5a55f12a0..ba00248db47 100644 --- a/tests/integration/adaptation-editor/package.json +++ b/tests/integration/adaptation-editor/package.json @@ -21,6 +21,7 @@ "@sap-ux-private/playwright": "workspace:*", "@sap-ux/project-access": "workspace:*", "@sap-ux/yaml": "workspace:*", + "@playwright/test": "1.56.1", "adm-zip": "0.5.10", "dotenv": "16.3.1", "express": "4.21.2", diff --git a/tests/integration/adaptation-editor/src/global-setup.ts b/tests/integration/adaptation-editor/src/global-setup.ts index 5b5be96eb63..37afe3b414a 100644 --- a/tests/integration/adaptation-editor/src/global-setup.ts +++ b/tests/integration/adaptation-editor/src/global-setup.ts @@ -1,6 +1,5 @@ import { readFile } from 'fs/promises'; -import { join } from 'node:path'; -import path from 'node:path'; +import path, { join } from 'node:path'; import fs from 'node:fs'; import express from 'express'; @@ -236,35 +235,38 @@ async function globalSetup(): Promise { return; } res.json( - [...Object.keys(mapping), ...variants.values()].reduce((acc, key) => { - acc[key] = { - name: baseAppDirectory, - manifest: `/sap/bc/ui5_ui5/ui5/${baseAppDirectory}/webapp/manifest.json`, - url: `/sap/bc/ui5_ui5/ui5/${baseAppDirectory}/webapp`, - components: [ - { - name: key, - url: { - url: '/', - final: true - }, - lazy: true - } - ], - minUi5Versions: ['1.71.0'], - requests: [ - { - name: 'sap.ui.fl.changes', - reference: key, - preview: { - maxLayer: 'PARTNER', - reference: baseAppDirectory + [...Object.keys(mapping), ...variants.values()].reduce( + (acc, key) => { + acc[key] = { + name: baseAppDirectory, + manifest: `/sap/bc/ui5_ui5/ui5/${baseAppDirectory}/webapp/manifest.json`, + url: `/sap/bc/ui5_ui5/ui5/${baseAppDirectory}/webapp`, + components: [ + { + name: key, + url: { + url: '/', + final: true + }, + lazy: true } - } - ] - }; - return acc; - }, {} as Record) + ], + minUi5Versions: ['1.71.0'], + requests: [ + { + name: 'sap.ui.fl.changes', + reference: key, + preview: { + maxLayer: 'PARTNER', + reference: baseAppDirectory + } + } + ] + }; + return acc; + }, + {} as Record + ) ); }); diff --git a/tests/integration/adaptation-editor/version.js b/tests/integration/adaptation-editor/version.js index deafdba236f..cdea1427a71 100644 --- a/tests/integration/adaptation-editor/version.js +++ b/tests/integration/adaptation-editor/version.js @@ -1,6 +1,6 @@ -const { writeFile } = require('fs/promises'); -const { join } = require('path'); -const { getUI5Versions } = require('@sap-ux/ui5-info'); +import { writeFile } from 'fs/promises'; +import { join } from 'path'; +import { getUI5Versions } from '@sap-ux/ui5-info'; getUI5Versions({ minSupportedUI5Version: '1.71', @@ -10,7 +10,7 @@ getUI5Versions({ .then((versions) => { 'use strict'; const maintenanceVersions = versions.filter((version) => version.maintained).map((version) => version.version); - return writeFile(join(__dirname, 'versions.json'), JSON.stringify(maintenanceVersions)); + return writeFile(join(import.meta.dirname, 'versions.json'), JSON.stringify(maintenanceVersions)); }) .catch((error) => { 'use strict'; diff --git a/types/.eslintrc b/types/.eslintrc deleted file mode 100644 index b52fff8277e..00000000000 --- a/types/.eslintrc +++ /dev/null @@ -1,7 +0,0 @@ -{ - "extends": ["../.eslintrc"], - "parserOptions": { "project": "./tsconfig.eslint.json" }, - "rules": { - "semi": "off" - } -} diff --git a/types/.eslintrc.js b/types/.eslintrc.js deleted file mode 100644 index f50273e4129..00000000000 --- a/types/.eslintrc.js +++ /dev/null @@ -1,10 +0,0 @@ -module.exports = { - extends: ['../.eslintrc'], - parserOptions: { - project: './tsconfig.eslint.json', - tsconfigRootDir: __dirname - }, - rules: { - semi: 'off' - } -}; diff --git a/types/eslint.config.js b/types/eslint.config.js new file mode 100644 index 00000000000..cfcf8c1db79 --- /dev/null +++ b/types/eslint.config.js @@ -0,0 +1,18 @@ +const base = require('../eslint.config.js'); +module.exports = [ + ...base, + { + languageOptions: { + parserOptions: { + parser: '@typescript-eslint/parser', + tsconfigRootDir: __dirname, + project: './tsconfig.eslint.json', + }, + }, + }, + { + rules: { + "semi": "off" + } + } +]; \ No newline at end of file From 374f0b0198a6005afb1c872db478d3591fdb919d Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Tue, 28 Oct 2025 14:06:59 +0000 Subject: [PATCH 002/119] test updates --- .../package.json | 1 + .../tsconfig.json | 3 +++ .../app/alp_v4_cap_typescript/package.json | 6 ++--- .../lrop_v2_eslint/package.json | 6 ++--- .../lrop_v2_typescript/package.json | 6 ++--- .../expected-output/tslibrary1/package.json | 9 +++---- .../test/__snapshots__/index.test.ts.snap | 27 +++++++++---------- pnpm-lock.yaml | 3 +++ 8 files changed, 32 insertions(+), 29 deletions(-) diff --git a/packages/abap-deploy-config-sub-generator/package.json b/packages/abap-deploy-config-sub-generator/package.json index 9c9666f3d49..0aad921ff42 100644 --- a/packages/abap-deploy-config-sub-generator/package.json +++ b/packages/abap-deploy-config-sub-generator/package.json @@ -49,6 +49,7 @@ "@types/yeoman-test": "4.0.6", "@sap-ux/store": "workspace:*", "@sap-ux/system-access": "workspace:*", + "@sap-ux/telemetry": "workspace:*", "memfs": "3.4.13", "mem-fs-editor": "9.4.0", "unionfs": "4.4.0", diff --git a/packages/abap-deploy-config-sub-generator/tsconfig.json b/packages/abap-deploy-config-sub-generator/tsconfig.json index 481cb191b4f..ca4689292ef 100644 --- a/packages/abap-deploy-config-sub-generator/tsconfig.json +++ b/packages/abap-deploy-config-sub-generator/tsconfig.json @@ -39,6 +39,9 @@ { "path": "../system-access" }, + { + "path": "../telemetry" + }, { "path": "../ui5-config" } diff --git a/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/alp_v4_cap_typescript/app/alp_v4_cap_typescript/package.json b/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/alp_v4_cap_typescript/app/alp_v4_cap_typescript/package.json index c8d4e051413..4c3d5e8bf51 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/alp_v4_cap_typescript/app/alp_v4_cap_typescript/package.json +++ b/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/alp_v4_cap_typescript/app/alp_v4_cap_typescript/package.json @@ -15,9 +15,9 @@ "@sapui5/ts-types-esm": "~1.94.0", "ui5-tooling-transpile": "^3.3.7", "typescript": "^5.1.6", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0" + "@eslint": "^9.38.0", + "@typescript-eslint": "^8.27.0", + "@sap-ux/eslint-plugin-fiori-tools": "^9.0.0" }, "scripts": { "deploy-config": "npx -p @sap/ux-ui5-tooling fiori add deploy-config cf" diff --git a/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/lrop_v2_eslint/package.json b/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/lrop_v2_eslint/package.json index 0160e936a31..4799ff9581d 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/lrop_v2_eslint/package.json +++ b/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/lrop_v2_eslint/package.json @@ -12,10 +12,10 @@ "devDependencies": { "@ui5/cli": "^4.0.16", "@sap/ux-ui5-tooling": "1", - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0", - "eslint": "8.57.0", + "@sap-ux/eslint-plugin-fiori-tools": "^0.5.0", + "eslint": "^9", "eslint-plugin-fiori-custom": "2.6.7", - "@babel/eslint-parser": "7.14.7", + "@babel/eslint-parser": "^7.27.0", "@sap-ux/ui5-middleware-fe-mockserver": "2" }, "scripts": { diff --git a/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/lrop_v2_typescript/package.json b/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/lrop_v2_typescript/package.json index cbd66727346..da5e66b6cb2 100644 --- a/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/lrop_v2_typescript/package.json +++ b/packages/fiori-app-sub-generator/test/int/fiori-elements/expected-output/lrop_v2_typescript/package.json @@ -15,9 +15,9 @@ "@sapui5/ts-types-esm": "~1.94.0", "ui5-tooling-transpile": "^3.3.7", "typescript": "^5.1.6", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0", + "@eslint": "^9.38.0", + "@typescript-eslint": "^8.27.0", + "@sap-ux/eslint-plugin-fiori-tools": "^9.0.0", "@sap-ux/ui5-middleware-fe-mockserver": "2" }, "scripts": { diff --git a/packages/ui5-library-sub-generator/test/unit/expected-output/tslibrary1/package.json b/packages/ui5-library-sub-generator/test/unit/expected-output/tslibrary1/package.json index d3a3c7c81a0..d334ece1eea 100644 --- a/packages/ui5-library-sub-generator/test/unit/expected-output/tslibrary1/package.json +++ b/packages/ui5-library-sub-generator/test/unit/expected-output/tslibrary1/package.json @@ -2,21 +2,20 @@ "name": "tslibrary1", "version": "1.0.0", "devDependencies": { - "@ui5/cli": "^3.9.1", + "@ui5/cli": "^4.0.0", "karma": "^6.3.17", "karma-chrome-launcher": "^3.1.1", "karma-cli": "^2.0.0", "karma-ui5": "^3.0.3", "@sap/ux-ui5-tooling": "1", "@sapui5/ts-types-esm": "1.108.0", - "@typescript-eslint/eslint-plugin": "^7.1.1", - "@typescript-eslint/parser": "^7.1.1", + "@eslint": "^9.38.0", + "@typescript-eslint": "^8.27.0", "@ui5/ts-interface-generator": "^0.8.1", - "eslint": "^8.57.0", "npm-run-all": "^4.1.5", "typescript": "^5.1.6", "ui5-tooling-transpile": "^3.3.7", - "@sap-ux/eslint-plugin-fiori-tools": "^0.4.0" + "@sap-ux/eslint-plugin-fiori-tools": "^9.0.0" }, "scripts": { "build": "run-p -l build-app build-interface", diff --git a/packages/ui5-library-writer/test/__snapshots__/index.test.ts.snap b/packages/ui5-library-writer/test/__snapshots__/index.test.ts.snap index 49fd579d614..d03a5534962 100644 --- a/packages/ui5-library-writer/test/__snapshots__/index.test.ts.snap +++ b/packages/ui5-library-writer/test/__snapshots__/index.test.ts.snap @@ -1629,21 +1629,20 @@ module.exports = function (config) { \\"name\\": \\"myui5tslib113\\", \\"version\\": \\"1.0.0\\", \\"devDependencies\\": { - \\"@ui5/cli\\": \\"^3.9.1\\", + \\"@ui5/cli\\": \\"^4.0.0\\", \\"karma\\": \\"^6.3.17\\", \\"karma-chrome-launcher\\": \\"^3.1.1\\", \\"karma-cli\\": \\"^2.0.0\\", \\"karma-ui5\\": \\"^3.0.3\\", \\"@sap/ux-ui5-tooling\\": \\"1\\", \\"@sapui5/types\\": \\"1.113.0\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", \\"@ui5/ts-interface-generator\\": \\"^0.8.1\\", - \\"eslint\\": \\"^8.57.0\\", \\"npm-run-all\\": \\"^4.1.5\\", \\"typescript\\": \\"^5.1.6\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\" + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\" }, \\"scripts\\": { \\"build\\": \\"run-p -l build-app build-interface\\", @@ -2252,21 +2251,20 @@ module.exports = function (config) { \\"name\\": \\"myui5tslib\\", \\"version\\": \\"1.0.0\\", \\"devDependencies\\": { - \\"@ui5/cli\\": \\"^3.9.1\\", + \\"@ui5/cli\\": \\"^4.0.0\\", \\"karma\\": \\"^6.3.17\\", \\"karma-chrome-launcher\\": \\"^3.1.1\\", \\"karma-cli\\": \\"^2.0.0\\", \\"karma-ui5\\": \\"^3.0.3\\", \\"@sap/ux-ui5-tooling\\": \\"1\\", \\"@sapui5/ts-types-esm\\": \\"1.102.19\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", \\"@ui5/ts-interface-generator\\": \\"^0.8.1\\", - \\"eslint\\": \\"^8.57.0\\", \\"npm-run-all\\": \\"^4.1.5\\", \\"typescript\\": \\"^5.1.6\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\" + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\" }, \\"scripts\\": { \\"build\\": \\"run-p -l build-app build-interface\\", @@ -2875,21 +2873,20 @@ module.exports = function (config) { \\"name\\": \\"myui5tslib121\\", \\"version\\": \\"1.0.0\\", \\"devDependencies\\": { - \\"@ui5/cli\\": \\"^3.9.1\\", + \\"@ui5/cli\\": \\"^4.0.0\\", \\"karma\\": \\"^6.3.17\\", \\"karma-chrome-launcher\\": \\"^3.1.1\\", \\"karma-cli\\": \\"^2.0.0\\", \\"karma-ui5\\": \\"^3.0.3\\", \\"@sap/ux-ui5-tooling\\": \\"1\\", \\"@sapui5/types\\": \\"1.121.0\\", - \\"@typescript-eslint/eslint-plugin\\": \\"^7.1.1\\", - \\"@typescript-eslint/parser\\": \\"^7.1.1\\", + \\"@eslint\\": \\"^9.38.0\\", + \\"@typescript-eslint\\": \\"^8.27.0\\", \\"@ui5/ts-interface-generator\\": \\"^0.8.1\\", - \\"eslint\\": \\"^8.57.0\\", \\"npm-run-all\\": \\"^4.1.5\\", \\"typescript\\": \\"^5.1.6\\", \\"ui5-tooling-transpile\\": \\"^3.3.7\\", - \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^0.4.0\\" + \\"@sap-ux/eslint-plugin-fiori-tools\\": \\"^9.0.0\\" }, \\"scripts\\": { \\"build\\": \\"run-p -l build-app build-interface\\", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 5f651503fe9..725177444c4 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -440,6 +440,9 @@ importers: '@sap-ux/system-access': specifier: workspace:* version: link:../system-access + '@sap-ux/telemetry': + specifier: workspace:* + version: link:../telemetry '@types/mem-fs': specifier: 1.1.2 version: 1.1.2 From 1fac68e23b89f66ecf30ba2f42c16e80c184074a Mon Sep 17 00:00:00 2001 From: Austin Devine Date: Thu, 30 Oct 2025 16:15:34 +0000 Subject: [PATCH 003/119] refactor: Update ESLint configurations for ESLint 9 compatibility - Migrate eslint-plugin-fiori-custom from rel-npmjs branch - Convert to TypeScript with passing tests - Update ESLint configurations and improve rule definitions - Change TypeScript ESLint configuration to use recommendedTypeChecked - Enhance rule exports for better compatibility and lazy loading - Remove author information from rule files for consistency - Add fiori-custom plugin for backward compatibility - Fix eslint-plugin-eslint-plugin lint issues - Apply multiple lint fixes throughout the codebase --- package.json | 2 +- .../config/{flat => }/eslintrc-common.js | 0 .../config/eslintrc-prod.js | 81 + .../config/eslintrc-test.js | 22 + .../config/{flat => }/eslintrc-typescript.js | 2 +- .../config/flat/eslintrc-prod.js | 38 - .../config/flat/eslintrc-test.js | 26 - .../config/legacy/eslintrc-common.js | 10 - .../config/legacy/eslintrc-prod.js | 29 - .../config/legacy/eslintrc-test.js | 16 - .../config/legacy/eslintrc-typescript.js | 44 - .../docs/rules/TEMPLATE.md | 68 + .../docs/rules/line-endings.md | 11 + .../docs/rules/sap-bookmark-performance.md | 36 + .../docs/rules/sap-browser-api-error.md | 123 ++ .../docs/rules/sap-browser-api-warning.md | 142 ++ .../rules/sap-cross-application-navigation.md | 44 + .../rules/sap-forbidden-window-property.md | 19 + .../docs/rules/sap-message-toast.md | 28 + .../rules/sap-no-absolute-component-path.md | 41 + .../docs/rules/sap-no-br-on-return.md | 21 + .../docs/rules/sap-no-commons-usage.md | 23 + .../docs/rules/sap-no-dom-access.md | 24 + .../docs/rules/sap-no-dom-insertion.md | 34 + .../rules/sap-no-dynamic-style-insertion.md | 21 + .../docs/rules/sap-no-element-creation.md | 22 + .../docs/rules/sap-no-encode-file-service.md | 22 + .../docs/rules/sap-no-exec-command.md | 24 + .../docs/rules/sap-no-global-define.md | 21 + .../docs/rules/sap-no-global-event.md | 28 + .../docs/rules/sap-no-global-selection.md | 18 + .../docs/rules/sap-no-global-variable.md | 11 + .../docs/rules/sap-no-hardcoded-color.md | 24 + .../docs/rules/sap-no-hardcoded-url.md | 31 + .../docs/rules/sap-no-history-manipulation.md | 43 + .../docs/rules/sap-no-inner-html-access.md | 22 + .../docs/rules/sap-no-inner-html-write.md | 20 + .../docs/rules/sap-no-jquery-device-api.md | 32 + .../docs/rules/sap-no-localhost.md | 26 + .../docs/rules/sap-no-localstorage.md | 15 + .../docs/rules/sap-no-location-reload.md | 21 + .../docs/rules/sap-no-location-usage.md | 39 + .../docs/rules/sap-no-navigator.md | 21 + .../docs/rules/sap-no-override-rendering.md | 21 + .../sap-no-override-storage-prototype.md | 15 + .../rules/sap-no-proprietary-browser-api.md | 32 + .../docs/rules/sap-no-sessionstorage.md | 15 + .../docs/rules/sap-no-ui5-prop-warning.md | 26 + .../docs/rules/sap-no-ui5base-prop.md | 50 + .../docs/rules/sap-no-window-alert.md | 15 + .../docs/rules/sap-opa5-autowait-true.md | 13 + .../docs/rules/sap-timeout-usage.md | 24 + .../docs/rules/sap-ui5-forms.md | 140 ++ .../docs/rules/sap-ui5-global-eval.md | 37 + .../docs/rules/sap-ui5-legacy-factories.md | 101 ++ .../rules/sap-ui5-legacy-jquerysap-usage.md | 34 + .../rules/sap-usage-basemastercontroller.md | 27 + .../eslint.config.js | 5 +- .../eslint-plugin-fiori-tools/package.json | 11 +- .../eslint-plugin-fiori-tools/src/index.ts | 268 ++- .../src/reporter/detailed-multi.ts | 9 + .../src/reporter/detailed.ts | 10 + .../src/reporter/helpers/scripts.html | 91 + .../src/reporter/helpers/styles.html | 345 ++++ .../src/reporter/template-generator.ts | 425 +++++ .../templates/details/code/code-wrapper.html | 11 + .../reporter/templates/details/code/code.html | 4 + .../templates/details/code/issue.html | 7 + .../reporter/templates/details/details.html | 33 + .../reporter/templates/details/result.html | 11 + .../reporter/templates/details/summary.html | 15 + .../src/reporter/templates/main-page.html | 44 + .../src/reporter/templates/summary/files.html | 5 + .../templates/summary/most-problems.html | 14 + .../src/reporter/templates/summary/rules.html | 4 + .../templates/summary/summary-details.html | 11 + .../src/rules/sap-bookmark-performance.ts | 179 ++ .../src/rules/sap-browser-api-error.ts | 412 +++++ .../src/rules/sap-browser-api-warning.ts | 396 ++++ .../rules/sap-cross-application-navigation.ts | 255 +++ .../rules/sap-forbidden-window-property.ts | 164 ++ .../src/rules/sap-message-toast.ts | 270 +++ .../rules/sap-no-absolute-component-path.ts | 161 ++ .../src/rules/sap-no-br-on-return.ts | 208 +++ .../src/rules/sap-no-commons-usage.ts | 148 ++ .../src/rules/sap-no-dom-access.ts | 192 ++ .../src/rules/sap-no-dom-insertion.ts | 209 +++ .../rules/sap-no-dynamic-style-insertion.ts | 202 +++ .../src/rules/sap-no-element-creation.ts | 223 +++ .../src/rules/sap-no-encode-file-service.ts | 63 + .../src/rules/sap-no-event-prop.ts | 76 + .../src/rules/sap-no-exec-command.ts | 182 ++ .../src/rules/sap-no-global-define.ts | 129 ++ .../src/rules/sap-no-global-event.ts | 211 +++ .../src/rules/sap-no-global-selection.ts | 129 ++ .../src/rules/sap-no-global-variable.ts | 73 + .../src/rules/sap-no-hardcoded-color.ts | 77 + .../src/rules/sap-no-hardcoded-url.ts | 97 + .../src/rules/sap-no-history-manipulation.ts | 251 +++ .../src/rules/sap-no-inner-html-access.ts | 92 + .../src/rules/sap-no-inner-html-write.ts | 108 ++ .../src/rules/sap-no-jquery-device-api.ts | 56 + .../src/rules/sap-no-localhost.ts | 78 + .../src/rules/sap-no-localstorage.ts | 143 ++ .../src/rules/sap-no-location-reload.ts | 193 ++ .../src/rules/sap-no-location-usage.ts | 188 ++ .../src/rules/sap-no-navigator.ts | 209 +++ .../src/rules/sap-no-override-rendering.ts | 258 +++ .../sap-no-override-storage-prototype.ts | 136 ++ .../rules/sap-no-proprietary-browser-api.ts | 270 +++ .../src/rules/sap-no-sessionstorage.ts | 141 ++ .../src/rules/sap-no-ui5-prop-warning.ts | 72 + .../src/rules/sap-no-ui5base-prop.ts | 139 ++ .../src/rules/sap-no-ui5eventprovider-prop.ts | 75 + .../src/rules/sap-no-ui5odatamodel-prop.ts | 115 ++ .../src/rules/sap-no-window-alert.ts | 54 + .../src/rules/sap-opa5-autowait-true.ts | 81 + .../src/rules/sap-timeout-usage.ts | 148 ++ .../src/rules/sap-ui5-forms.ts | 173 ++ .../src/rules/sap-ui5-global-eval.ts | 94 + .../src/rules/sap-ui5-legacy-factories.ts | 136 ++ .../rules/sap-ui5-legacy-jquerysap-usage.ts | 101 ++ .../src/rules/sap-ui5-no-private-prop.ts | 336 ++++ .../rules/sap-usage-basemastercontroller.ts | 79 + .../rules/sap-bookmark-performance.test.ts | 48 + .../test/rules/sap-browser-api-error.test.ts | 253 +++ .../rules/sap-browser-api-warning.test.ts | 248 +++ .../sap-cross-application-navigation.test.ts | 137 ++ .../sap-forbidden-window-property.test.ts | 53 + .../test/rules/sap-message-toast.test.ts | 156 ++ .../sap-no-absolute-component-path.test.ts | 113 ++ .../test/rules/sap-no-br-on-return.test.ts | 36 + .../test/rules/sap-no-commons-usage.test.ts | 40 + .../test/rules/sap-no-dom-access.test.ts | 120 ++ .../test/rules/sap-no-dom-insertion.test.ts | 60 + .../sap-no-dynamic-style-insertion.test.ts | 73 + .../rules/sap-no-element-creation.test.ts | 68 + .../rules/sap-no-encode-file-service.test.ts | 51 + .../test/rules/sap-no-event-prop.test.ts | 38 + .../test/rules/sap-no-exec-command.test.ts | 63 + .../test/rules/sap-no-global-define.test.ts | 49 + .../test/rules/sap-no-global-event.test.ts | 67 + .../rules/sap-no-global-selection.test.ts | 52 + .../test/rules/sap-no-global-variable.test.ts | 36 + .../test/rules/sap-no-hardcoded-color.test.ts | 33 + .../test/rules/sap-no-hardcoded-url.test.ts | 55 + .../rules/sap-no-history-manipulation.test.ts | 156 ++ .../rules/sap-no-inner-html-access.test.ts | 55 + .../rules/sap-no-inner-html-write.test.ts | 45 + .../rules/sap-no-jquery-device-api.test.ts | 44 + .../test/rules/sap-no-localhost.test.ts | 50 + .../test/rules/sap-no-localstorage.test.ts | 52 + .../test/rules/sap-no-location-reload.test.ts | 58 + .../test/rules/sap-no-location-usage.test.ts | 153 ++ .../test/rules/sap-no-navigator.test.ts | 46 + .../rules/sap-no-override-rendering.test.ts | 50 + .../sap-no-override-storage-prototype.test.ts | 45 + .../sap-no-proprietary-browser-api.test.ts | 134 ++ .../test/rules/sap-no-sessionstorage.test.ts | 53 + .../rules/sap-no-ui5-prop-warning.test.ts | 37 + .../test/rules/sap-no-ui5base-prop.test.ts | 68 + .../sap-no-ui5eventprovider-prop.test.ts | 49 + .../rules/sap-no-ui5odatamodel-prop.test.ts | 63 + .../test/rules/sap-no-window-alert.test.ts | 33 + .../test/rules/sap-opa5-autowait-true.test.ts | 91 + .../test/rules/sap-timeout-usage.test.ts | 74 + .../test/rules/sap-ui5-forms.test.ts | 440 +++++ .../test/rules/sap-ui5-global-eval.test.ts | 69 + .../rules/sap-ui5-legacy-factories.test.ts | 271 +++ .../sap-ui5-legacy-jquerysap-usage.test.ts | 61 + .../rules/sap-ui5-no-private-prop.test.ts | 285 +++ .../sap-usage-basemastercontroller.test.ts | 42 + .../eslint-plugin-fiori-tools/test_output.txt | 66 + .../test_output2.txt | 66 + .../eslint-plugin-fiori-tools/tsconfig.json | 14 +- .../eslint.config.js | 58 +- .../AddCustomFragment.controller.ts | 2 +- .../quick-actions/fe-v4/add-new-subpage.ts | 2 +- .../src/cpe/api-json.d.ts | 1 + .../src/cpe/changes/generic-change.ts | 4 +- .../src/cpe/changes/service.ts | 2 +- .../preview-middleware-client/src/cpe/init.ts | 3 +- .../src/flp/WorkspaceConnector.ts | 2 +- .../src/flp/enableFakeConnector.ts | 2 +- .../test/unit/adp/init-dialogs.test.ts | 2 +- .../test/unit/adp/quick-actions/fe-v2.test.ts | 1 + .../test/unit/flp/init.test.ts | 1 + pnpm-lock.yaml | 1612 ++++++++++++++--- 188 files changed, 16735 insertions(+), 476 deletions(-) rename packages/eslint-plugin-fiori-tools/config/{flat => }/eslintrc-common.js (100%) create mode 100644 packages/eslint-plugin-fiori-tools/config/eslintrc-prod.js create mode 100644 packages/eslint-plugin-fiori-tools/config/eslintrc-test.js rename packages/eslint-plugin-fiori-tools/config/{flat => }/eslintrc-typescript.js (95%) delete mode 100644 packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js delete mode 100644 packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js delete mode 100644 packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-common.js delete mode 100644 packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-prod.js delete mode 100644 packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-test.js delete mode 100644 packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-typescript.js create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/TEMPLATE.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/line-endings.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-bookmark-performance.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-browser-api-error.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-browser-api-warning.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-cross-application-navigation.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-forbidden-window-property.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-message-toast.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-absolute-component-path.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-br-on-return.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-commons-usage.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dom-access.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dom-insertion.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dynamic-style-insertion.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-element-creation.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-encode-file-service.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-exec-command.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-define.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-event.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-selection.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-variable.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-hardcoded-color.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-hardcoded-url.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-history-manipulation.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-inner-html-access.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-inner-html-write.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-jquery-device-api.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-localhost.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-localstorage.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-location-reload.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-location-usage.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-navigator.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-override-rendering.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-override-storage-prototype.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-proprietary-browser-api.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-sessionstorage.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-ui5-prop-warning.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-ui5base-prop.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-no-window-alert.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-opa5-autowait-true.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-timeout-usage.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-forms.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-global-eval.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-legacy-factories.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-legacy-jquerysap-usage.md create mode 100644 packages/eslint-plugin-fiori-tools/docs/rules/sap-usage-basemastercontroller.md create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/detailed-multi.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/detailed.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/helpers/scripts.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/helpers/styles.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/template-generator.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/details/code/code-wrapper.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/details/code/code.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/details/code/issue.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/details/details.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/details/result.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/details/summary.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/main-page.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/summary/files.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/summary/most-problems.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/summary/rules.html create mode 100644 packages/eslint-plugin-fiori-tools/src/reporter/templates/summary/summary-details.html create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-bookmark-performance.ts create mode 100755 packages/eslint-plugin-fiori-tools/src/rules/sap-browser-api-error.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-browser-api-warning.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-cross-application-navigation.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-forbidden-window-property.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-message-toast.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-absolute-component-path.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-br-on-return.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-commons-usage.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-dom-access.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-dom-insertion.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-dynamic-style-insertion.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-element-creation.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-encode-file-service.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-event-prop.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-exec-command.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-global-define.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-global-event.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-global-selection.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-global-variable.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-hardcoded-color.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-hardcoded-url.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-history-manipulation.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-inner-html-access.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-inner-html-write.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-jquery-device-api.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-localhost.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-localstorage.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-location-reload.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-location-usage.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-navigator.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-override-rendering.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-override-storage-prototype.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-proprietary-browser-api.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-sessionstorage.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-ui5-prop-warning.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-ui5base-prop.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-ui5eventprovider-prop.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-ui5odatamodel-prop.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-no-window-alert.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-opa5-autowait-true.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-timeout-usage.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-ui5-forms.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-ui5-global-eval.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-ui5-legacy-factories.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-ui5-legacy-jquerysap-usage.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-ui5-no-private-prop.ts create mode 100644 packages/eslint-plugin-fiori-tools/src/rules/sap-usage-basemastercontroller.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-bookmark-performance.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-browser-api-error.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-browser-api-warning.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-cross-application-navigation.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-forbidden-window-property.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-message-toast.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-absolute-component-path.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-br-on-return.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-commons-usage.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-dom-access.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-dom-insertion.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-dynamic-style-insertion.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-element-creation.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-encode-file-service.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-event-prop.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-exec-command.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-global-define.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-global-event.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-global-selection.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-global-variable.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-hardcoded-color.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-hardcoded-url.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-history-manipulation.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-inner-html-access.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-inner-html-write.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-jquery-device-api.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-localhost.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-localstorage.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-location-reload.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-location-usage.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-navigator.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-override-rendering.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-override-storage-prototype.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-proprietary-browser-api.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-sessionstorage.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-ui5-prop-warning.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-ui5base-prop.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-ui5eventprovider-prop.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-ui5odatamodel-prop.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-no-window-alert.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-opa5-autowait-true.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-timeout-usage.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-ui5-forms.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-ui5-global-eval.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-ui5-legacy-factories.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-ui5-legacy-jquerysap-usage.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-ui5-no-private-prop.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test/rules/sap-usage-basemastercontroller.test.ts create mode 100644 packages/eslint-plugin-fiori-tools/test_output.txt create mode 100644 packages/eslint-plugin-fiori-tools/test_output2.txt diff --git a/package.json b/package.json index 065ea60f29c..984943bec03 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,6 @@ "eslint-plugin-prettier": "5.2.3", "eslint-plugin-promise": "7.2.1", "eslint-plugin-sonarjs": "3.0.2", - "typescript-eslint": "8.46.2", "globals": "16.0.0", "husky": "8.0.3", "jest": "30.2.0", @@ -39,6 +38,7 @@ "rimraf": "6.0.1", "ts-jest": "29.4.5", "typescript": "5.9.3", + "typescript-eslint": "8.46.2", "update-ts-references": "3.6.2", "yargs-parser": "21.1.1" }, diff --git a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-common.js b/packages/eslint-plugin-fiori-tools/config/eslintrc-common.js similarity index 100% rename from packages/eslint-plugin-fiori-tools/config/flat/eslintrc-common.js rename to packages/eslint-plugin-fiori-tools/config/eslintrc-common.js diff --git a/packages/eslint-plugin-fiori-tools/config/eslintrc-prod.js b/packages/eslint-plugin-fiori-tools/config/eslintrc-prod.js new file mode 100644 index 00000000000..cc4f5bc54e3 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/config/eslintrc-prod.js @@ -0,0 +1,81 @@ +const { defineConfig } = require('eslint/config'); +const babelParser = require('@babel/eslint-parser'); +const js = require('@eslint/js'); + +module.exports = defineConfig([ + { + files: ['./webapp/**/*.js', './webapp/**/*.ts'], + + ignores: [ + 'target/**', + 'webapp/test/**', + 'webapp/localservice/**', + 'backup/**', + '**/Gruntfile.js', + '**/changes_preview.js', + '**/changes_preview.ts', + '**/gulpfile.js', + '**/*.d.ts', + 'test/**' + ], + + languageOptions: { + parser: babelParser, + parserOptions: { + requireConfigFile: false + } + }, + + plugins: { + '@sap-ux/fiori-tools': require('../lib/index.js') + }, + + rules: { + ...js.configs.recommended.rules, + '@sap-ux/fiori-tools/sap-no-global-variable': 'error', + '@sap-ux/fiori-tools/sap-no-jquery-device-api': 'warn', + '@sap-ux/fiori-tools/sap-no-hardcoded-color': 'error', + '@sap-ux/fiori-tools/sap-no-hardcoded-url': 'error', + '@sap-ux/fiori-tools/sap-no-localstorage': 'error', + '@sap-ux/fiori-tools/sap-no-override-rendering': 'error', + '@sap-ux/fiori-tools/sap-no-override-storage-prototype': 'error', + '@sap-ux/fiori-tools/sap-no-sessionstorage': 'error', + '@sap-ux/fiori-tools/sap-no-ui5base-prop': 'error', + '@sap-ux/fiori-tools/sap-message-toast': 'warn', + '@sap-ux/fiori-tools/sap-no-ui5-prop-warning': 'warn', + '@sap-ux/fiori-tools/sap-no-localhost': 'warn', + '@sap-ux/fiori-tools/sap-usage-basemastercontroller': 'warn', + '@sap-ux/fiori-tools/sap-no-absolute-component-path': 'error', + '@sap-ux/fiori-tools/sap-no-encode-file-service': 'warn', + '@sap-ux/fiori-tools/sap-no-dom-insertion': 'warn', + '@sap-ux/fiori-tools/sap-cross-application-navigation': 'warn', + '@sap-ux/fiori-tools/sap-no-location-usage': 'warn', + '@sap-ux/fiori-tools/sap-timeout-usage': 'warn', + '@sap-ux/fiori-tools/sap-no-proprietary-browser-api': 'warn', + '@sap-ux/fiori-tools/sap-no-dom-access': 'warn', + '@sap-ux/fiori-tools/sap-no-history-manipulation': 'warn', + '@sap-ux/fiori-tools/sap-no-global-selection': 'warn', + '@sap-ux/fiori-tools/sap-no-location-reload': 'error', + '@sap-ux/fiori-tools/sap-no-global-event': 'error', + '@sap-ux/fiori-tools/sap-no-exec-command': 'error', + '@sap-ux/fiori-tools/sap-no-br-on-return': 'error', + '@sap-ux/fiori-tools/sap-no-dynamic-style-insertion': 'error', + '@sap-ux/fiori-tools/sap-no-element-creation': 'error', + '@sap-ux/fiori-tools/sap-no-global-define': 'error', + '@sap-ux/fiori-tools/sap-forbidden-window-property': 'warn', + '@sap-ux/fiori-tools/sap-no-navigator': 'error', + '@sap-ux/fiori-tools/sap-no-inner-html-write': 'error', + '@sap-ux/fiori-tools/sap-no-inner-html-access': 'warn', + '@sap-ux/fiori-tools/sap-bookmark-performance': 'warn', + '@sap-ux/fiori-tools/sap-no-commons-usage': 'error', + '@sap-ux/fiori-tools/sap-ui5-no-private-prop': 'off', + '@sap-ux/fiori-tools/sap-browser-api-error': 'off', + '@sap-ux/fiori-tools/sap-browser-api-warning': 'warn', + '@sap-ux/fiori-tools/sap-no-window-alert': 'off', + '@sap-ux/fiori-tools/sap-ui5-legacy-jquerysap-usage': 'warn', + '@sap-ux/fiori-tools/sap-ui5-global-eval': 'warn', + '@sap-ux/fiori-tools/sap-ui5-legacy-factories': 'warn', + '@sap-ux/fiori-tools/sap-ui5-forms': 'warn' + } + } +]); diff --git a/packages/eslint-plugin-fiori-tools/config/eslintrc-test.js b/packages/eslint-plugin-fiori-tools/config/eslintrc-test.js new file mode 100644 index 00000000000..9590dc97436 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/config/eslintrc-test.js @@ -0,0 +1,22 @@ +const { defineConfig } = require('eslint/config'); +const babelParser = require('@babel/eslint-parser'); + +module.exports = defineConfig([{ + files: ['webapp/test/**/*.js', 'webapp/test/**/*.ts'], + ignores: ['**/*.d.ts'], + + languageOptions: { + parser: babelParser, + parserOptions: { + requireConfigFile: false + } + }, + + plugins: { + '@sap-ux/fiori-tools': require('../lib/index.js') + }, + + rules: { + '@sap-ux/fiori-tools/sap-opa5-autowait-true': 'warn' + } +}]); diff --git a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-typescript.js b/packages/eslint-plugin-fiori-tools/config/eslintrc-typescript.js similarity index 95% rename from packages/eslint-plugin-fiori-tools/config/flat/eslintrc-typescript.js rename to packages/eslint-plugin-fiori-tools/config/eslintrc-typescript.js index de75cfa6366..3dade05392b 100644 --- a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-typescript.js +++ b/packages/eslint-plugin-fiori-tools/config/eslintrc-typescript.js @@ -11,7 +11,7 @@ const tseslint = require('typescript-eslint'); module.exports = defineConfig([ ...tseslint.configs.recommended, - ...tseslint.configs.recommended_requiring_type_checking, + ...tseslint.configs.recommendedTypeChecked, { files: ["./webapp/*.ts", "./webapp/**/*.ts"], diff --git a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js deleted file mode 100644 index 2bfd158e89a..00000000000 --- a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js +++ /dev/null @@ -1,38 +0,0 @@ -const { defineConfig } = require('eslint/config'); - -const fioriCustom = require('eslint-plugin-fiori-custom'); -const js = require('@eslint/js'); - -const { FlatCompat } = require('@eslint/eslintrc'); - -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all -}); - -module.exports = defineConfig([ - { - files: ['./webapp/**/*.js', './webapp/**/*.ts'], - - ignores: [ - 'target/**', - 'webapp/test/**', - 'webapp/localservice/**', - 'backup/**', - '**/Gruntfile.js', - '**/changes_preview.js', - '**/changes_preview.ts', - '**/gulpfile.js', - '**/*.d.ts', - '**/*.d.ts', - 'test/**' - ], - - extends: compat.extends('eslint:recommended', 'plugin:fiori-custom/fioriToolsDefault'), - - plugins: { - 'fiori-custom': fioriCustom - } - } -]); diff --git a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js b/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js deleted file mode 100644 index d2a97087932..00000000000 --- a/packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js +++ /dev/null @@ -1,26 +0,0 @@ -const { - defineConfig, -} = require("eslint/config"); - -const fioriCustom = require("eslint-plugin-fiori-custom"); -const js = require("@eslint/js"); - -const { - FlatCompat, -} = require("@eslint/eslintrc"); - -const compat = new FlatCompat({ - baseDirectory: __dirname, - recommendedConfig: js.configs.recommended, - allConfig: js.configs.all -}); - -module.exports = defineConfig([{ - files: ["webapp/test/**/*.js", "webapp/test/**/*.ts"], - ignores: ["**/*.d.ts", "**/*.d.ts"], - extends: compat.extends("plugin:fiori-custom/fioriToolsTestcode"), - - plugins: { - "fiori-custom": fioriCustom, - }, -}]); \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-common.js b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-common.js deleted file mode 100644 index 73c27d2a67f..00000000000 --- a/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-common.js +++ /dev/null @@ -1,10 +0,0 @@ -'use strict'; - -module.exports = { - env: { - 'browser': true, - 'es6': true, - 'node': true - }, - 'root': true -}; diff --git a/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-prod.js b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-prod.js deleted file mode 100644 index 5a6df767435..00000000000 --- a/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-prod.js +++ /dev/null @@ -1,29 +0,0 @@ -'use strict'; -const { getResourcePaths } = require('../../lib/utils'); -const { sourceCodePath, testCodePath } = getResourcePaths(); -const overrides = [ - { - 'plugins': ['fiori-custom'], - 'files': [`./${sourceCodePath}/**/*.js`, `./${sourceCodePath}/**/*.ts`], - 'excludedFiles': [ - 'target/**', - `${sourceCodePath}/test/**`, - `${sourceCodePath}/localservice/**`, - 'backup/**', - 'Gruntfile.js', - 'changes_preview.js', - 'changes_preview.ts', - 'gulpfile.js', - '*.d.ts', - '**/*.d.ts' - ], - 'extends': ['eslint:recommended', 'plugin:fiori-custom/fioriToolsDefault'] - } -]; - -if (!testCodePath) { - overrides[0].excludedFiles.push('test/**'); -} -module.exports = { - overrides -}; diff --git a/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-test.js b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-test.js deleted file mode 100644 index cfbf9bc41bd..00000000000 --- a/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-test.js +++ /dev/null @@ -1,16 +0,0 @@ -'use strict'; -const { getResourcePaths } = require('../../lib/utils'); -const { sourceCodePath, testCodePath } = getResourcePaths(); -module.exports = { - overrides: [ - { - 'plugins': ['fiori-custom'], - 'files': [ - testCodePath ? `${testCodePath}/**/*.js` : `${sourceCodePath}/test/**/*.js`, - testCodePath ? `${testCodePath}/**/*.js` : `${sourceCodePath}/test/**/*.ts` - ], - 'excludedFiles': ['*.d.ts', '**/*.d.ts'], - 'extends': ['plugin:fiori-custom/fioriToolsTestcode'] - } - ] -}; diff --git a/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-typescript.js b/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-typescript.js deleted file mode 100644 index a4289d77a33..00000000000 --- a/packages/eslint-plugin-fiori-tools/config/legacy/eslintrc-typescript.js +++ /dev/null @@ -1,44 +0,0 @@ -'use strict'; -const { getResourcePaths } = require('../../lib/utils'); -const { sourceCodePath, testCodePath } = getResourcePaths(); -const overrides = [ - { - 'plugins': ['@typescript-eslint'], - 'files': [`./${sourceCodePath}/*.ts`, `./${sourceCodePath}/**/*.ts`], - 'excludedFiles': [ - 'target/**', - `${sourceCodePath}/test/changes_loader.ts`, - `${sourceCodePath}/test/changes_preview.ts`, - `${sourceCodePath}/localservice/**`, - `${sourceCodePath}/localService/**`, - `${testCodePath}/**/Example.qunit.ts`, - 'backup/**', - '*.d.ts', - - '**/*.d.ts' - ], - 'parser': '@typescript-eslint/parser', - 'extends': [ - 'plugin:@typescript-eslint/recommended', - 'plugin:@typescript-eslint/recommended-requiring-type-checking' - ], - 'parserOptions': { - 'project': true // uses local tsconfig.json nearest to file being linted. Especially important for monorepos - }, - 'rules': { - '@typescript-eslint/no-unsafe-call': 'warn', - '@typescript-eslint/no-unsafe-member-access': 'warn', - '@typescript-eslint/no-unsafe-return': 'warn', - '@typescript-eslint/no-unsafe-argument': 'warn', - '@typescript-eslint/no-unsafe-assignment': 'warn' - } - } -]; -if (testCodePath) { - overrides[0].files.push(`./${testCodePath}/*.ts`); - overrides[0].files.push(`./${testCodePath}/**/*.ts`); -} - -module.exports = { - overrides -}; diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/TEMPLATE.md b/packages/eslint-plugin-fiori-tools/docs/rules/TEMPLATE.md new file mode 100644 index 00000000000..7bce7c4a007 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/TEMPLATE.md @@ -0,0 +1,68 @@ +# Describe the rule in one sentence as 1st-level-header here please (IMPORTANT: enter ID of the rule in this brackets please) + +_**// In General: please use single backtick marks (" ` " or so called gravis) to emphasize code inside normal text**_ + +_**// describe in 3-4 words what the rule does**_ + +_**// describe why the rule was introduced**_ + +## Rule Details + +_**// Give details how the rule works (if applicable)**_ + +_**// Only if the rules has sub-rules with different message enter a sub-rule (4th level and warning message)**_ + +#### Enter critical action as 4th-level-header here please (e.g. Direct DOM insertion) + +##### Warning Message: Enter the warning message of the rule here please. + +The following patterns are considered warnings: +_**// mandatory, always give enough code example to understand the rule**_ + +```js + +_**// Enter example coding here please**_ + +``` + +The following patterns are not considered warnings: +_**// This is optional, only if it makes sense**_ + +```js + +_**// Enter example coding here please**_ + +``` + +How to Fix +_** // OPTIONAL: only if it can't be described by a code example or if is not obvious from message below**_ + +## False Positives + +_**// OPTIONAL: only if the check produces false positives**_ +There might be cases where the check produces a false positive, i.e. you receive a warning but your code is correct and complies to the UI5 guidelines. +In such a case, you can deactivate the rule by placing the following pseudo-comment block around your code. +**Please make sure to have your code reviewed by a colleague before you enter such a pseudo-comment.** + +You can disable and enable back warnings of this rule _**// replace with your check ID**_: + +```js + +/*eslint-disable rule-check_ID_XY*/ + +/*eslint-enable rule-check_ID_XY*/ + +``` + +## Bug Report + +In case you detect an issue with the check please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + +_**//If there are other links (e.g. to the UI5 API reference) describe the issue this rule addresses, please include them here in a bulleted list.**_ + + +## Release Information + + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/line-endings.md b/packages/eslint-plugin-fiori-tools/docs/rules/line-endings.md new file mode 100644 index 00000000000..edc123659ba --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/line-endings.md @@ -0,0 +1,11 @@ +# Detect usage of invalid line endings (line-endings) + +Different operating systems usually represent a newline with different characters, for details see here. + +For example Windows uses CR+LF (carriage return and line-feed characters) whereas Unix only uses the LF character. + +Mixed kinds of line-endings in the same repository can cause code reviews or automatic merging to be . + +## Rule Details + +This check will raise a warning when "Windows line endings" (CR + LF character) are detected. Please change lo Unix style line endings. diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-bookmark-performance.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-bookmark-performance.md new file mode 100644 index 00000000000..887d9e480be --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-bookmark-performance.md @@ -0,0 +1,36 @@ +# Check your setting of _serviceRefreshInterval_(sap-bookmark-performance) + +While deciding which interval to use, one has to keep in mind, that there might be thousands of users which have the Launchpad open and might display some KPIs. With a too small refresh Interval this can create a considerable work load in the back end. Therefore we recommend the following values as default depending on the use case. + +1. Complex calculations are required to calculate the data on the tile, which might take multiple seconds to be calculated -> No auto refresh must be used. Set the Interval to 0. +2. Only a simple query is required (e.g. determine the number of tasks I’m assigned to) out of one central table -> Interval should be set to 300 (5 Minutes). + +_Warning Message_: A value of more than 0 and less than 300 for the property `serviceRefreshIntervall` may result in performance limitations. + +The following patterns are considered warnings: + +```js + + function _extractDiscoveryCollection(oCollection) { + var onInit = function() { + var oView = this.getView(), + oAddToHome = oView.byId("addToHome"); + + oAddToHome.setAppData({ + title: "My Bookmark", // default: "" + serviceUrl: "/any/service/$count", // default: undefined, string or a JS function + // should raise an error + serviceRefreshInterval: 1, // default: undefined + customUrl: "http://www.sap.com" // default: undefined, string or a JS function + }); + }; + + oAddToHome.setServiceRefreshInterval(299); +``` + +## Bug Report + +In case you detect an issue with the check please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-browser-api-error.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-browser-api-error.md new file mode 100644 index 00000000000..82140731800 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-browser-api-error.md @@ -0,0 +1,123 @@ +# Detect some forbidden usages of browser APIs (sap-browser-api-error) + +This is a collection of usages of browser APIs that might lead to issues. +Please search for the warning messages that you see in ESLint to find the explanation of the respective check. + +## Rule Details + +This rule aims to detect forbidden usages of browser APIs and raise error. + +#### Direct DOM insertion + +Warning message: _Direct DOM insertion, create a custom control instead_ + +The following patterns are considered warnings: + +```js +document.createElement(foo); +``` + +#### Direct DOM manipulation + +Warning message: _Direct DOM Manipulation, better to use `jQuery.appendTo` if really needed_ + +The following patterns are considered warnings: + +```js +document.execCommand(cmd, false, args); +``` + +#### insertBrOnReturn + +Warning message: _`insertBrOnReturn` is not allowed since it is a Mozilla specific method, Chrome doesn't support that._ + +The following patterns are considered warnings: + +```js +var abc = document.queryCommandSupported('insertBrOnReturn'); +``` + +#### Location reload + +Warning message: _location.reload() is not permitted._ + +The following patterns are considered warnings: + +```js +location.reload(); +var mylocation = location; +mylocation.reload(); +``` + +#### Global event handling override + +Warning message: _Global event handling override is not permitted, please modify only single events._ + +The following patterns are considered warnings: + +```js +window.event.returnValue = false; +window.onload = function () { + return Hammer; +}; +``` + +#### Proprietary Browser API access + +Some browser APIs should not be used at all, instead the sap.ui.Device API has to be used. + +Warning message: _Proprietary Browser API access, use `sap.ui.Device` API instead._ + +The following patterns are considered warnings: + +```js +if (window.addEventListener) { + x = 1; +} +navigator.back(); +var x = navigator.appCodeName; +``` + +#### Definition of globals via window object + +Warning message: _Definition of global variable/api in `window` object is not permitted._ + +The following patterns are considered warnings: + +```js +var mynavig = window.top.tip; +window.define(); +``` + +#### Dynamic style insertion + +Warning message: _Dynamic style insertion, use library CSS or lessifier instead._ + +The following patterns are considered warnings: + +```js +var sheet = document.styleSheets[i]; +var abc = document.styleSheets.length; +``` + +## False positives + +There might be cases where the check produces a false positive, i.e. you receive a warning but your code is correct and complies to the UI5 guidelines. +In such a case, you can be deactivate the rule by placing the following pseudo-comment block around your code. +**Please make sure to have your code reviewed by a colleague before you enter such a pseudo-comment.** + +```js + +/*eslint-disable sap-browser-api-error*/ + +/*eslint-enable sap-browser-api-error*/ + +``` + +## Bug report + +In case you detect an issue with the check please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-browser-api-warning.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-browser-api-warning.md new file mode 100644 index 00000000000..63e80d08a28 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-browser-api-warning.md @@ -0,0 +1,142 @@ +# Discourage usage of certain browser APIs (sap-browser-api-warning) + +This is a collection of usages of browser APIs that might lead to issues. +Please search for the warning messages that you see in ESLint to find the explanation of the respective check. + +## Disallow usage of browser APIs that might lead to issues. + +Discourage usage of certain browser APIs. + +## Rule details + +#### Direct history manipulation + +##### Warning message: _Direct DOM insertion, create a custom control instead_ + +The following patterns are considered warnings: + +```js + + +if (this.editMode){ + + window.history.back(); + +} else { + + this.oRouter.navTo("detail", { + + contextPath : "AccountCollection('"+responseObject.accountID+"')" + + }, true); + + }, + +``` + +The following patterns are not considered warnings: + +```js + +myNavBack : function(sRoute, mData) { + + var oHistory = sap.ui.core.routing.History.getInstance(); + + var sPreviousHash = oHistory.getPreviousHash(); + +//The history contains a previous entry + + if (sPreviousHash !== undefined) { + +/* eslint-disable sap-browser-api-warning */ + + window.history.go(-1); + +/* eslint-enable sap-browser-api-warning */ + + } else { + + var bReplace = true; // otherwise we go backwards with a forward history + + this.navTo(sRoute, mData, bReplace) + + } + +}, + +``` + +#### setTimeout usage + +Executing logic with timeouts is often a workaround for faulty behavior and does not fix the root cause. The timing that works for you may not work under different circumstances (other geographical locations with greater network latency, or other devices that have slower processors) or when the code is changed. Use callbacks or events instead, if available. Please check the SAPUI5 guidelines for more details. + +##### warning message: Timeout with value > 0 + +The following patterns are considered warnings: + +```js +window.setTimeout(jQuery.proxy(processChanges, this), 50); +``` + +#### Global selection + +##### warning message: Global selection modification, only modify local selections + +The following patterns are considered warnings: + +```js +window.getSelection().rangeCount = 9; +``` + +#### Proprietary browser API + +Certain browser APIs are considered to be risky, when used directly and not wrapped via jQuery. + +##### warning message: Proprietary Browser API access + +The following patterns are considered warnings: + +```js +var variab1 = window.innerWidth; + +var myscreen = screen; +var variab5 = myscreen.something; + +document.body.appendChild(x); +document.body.style.backgroundColor = 'yellow'; + +var mydocument = window.document; +mydocument.body.appendChild(x); +mydocument.body.style.backgroundColor = 'yellow'; +var mydocument = document; +mydocument.body.appendChild(x); +mydocument.body.style.backgroundColor = 'yellow'; +var abcss = window.document.body; +abcss.appendChild(x); +abcss.style.backgroundColor = 'yellow'; +``` + +The following patterns are not considered warnings: + +```js +var width = $(window).innerWidth(); +``` + +#### DOM access + +Accessing the DOM directly is considered risky. If necessary, a jQuery selector should be used instead. + +##### warning message: Direct DOM access, use jQuery selector instead + +The following patterns are considered warnings: + +```js +document.getElementById('test'); +``` + +## Bug report + +In case you detect an issue with the check please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-cross-application-navigation.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-cross-application-navigation.md new file mode 100644 index 00000000000..fe27ac334b0 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-cross-application-navigation.md @@ -0,0 +1,44 @@ +# No static cross-application navigation targets (sap-cross-application-navigation) + +Fiori-as-a-Service Enablement Guideline prohibits the use of static list of cross-application navigation targets. + +## Rule Details + +This rule should prevent the usage of static cross-application navigation targets. + +Use the isIntentSupported function of the CrossApplicationNavigation service. See the according Cross Application Navigation and JSDOC API documentation. Note that the function is mass-enabled, you could check an array of all relevant navigation targets in one call. + +The following patterns are considered warnings: + +```js +sap.ushell.Container.getService('CrossApplicationNavigation').toExternal({}); +``` + +The following patterns are not warnings: + +```js + +checkPromoFactSheetAvailable : function() { + // By default: promo factsheet not available + this._bPromoFactSheetAvailable = false; + if (this._oCrossAppNav) { + // Check if the intent for the promotion factsheet is supported + var sIntent = "#Promotion-displayFactSheet"; + var oDeferred = this._oCrossAppNav.isIntentSupported([sIntent]); + oDeferred.done(jQuery.proxy(function(oIntentSupported) { + if (oIntentSupported && oIntentSupported[sIntent] && oIntentSupported[sIntent].supported === true) { + // Remember that the navigation to the promotion factsheet is possible + this._bPromoFactSheetAvailable = true; + // Activate the promotion links if they were already added to the view + this.activatePromotionLinks(); + } + }, this)); + } + +``` + +## Bug report + +In case you detect an issue with the check please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-forbidden-window-property.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-forbidden-window-property.md new file mode 100644 index 00000000000..5f67b9fd4ad --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-forbidden-window-property.md @@ -0,0 +1,19 @@ +# Detect the usage of forbidden window properties (sap-forbidden-window-property) + +## Rule Details + +Warning message: _Usage of a forbidden window property._ + +The following patterns are considered warnings: + +```js +var top = window.top; +window.addEventListener(listener); +``` + +## Bug report + +In case you detect a problem with this check, please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-message-toast.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-message-toast.md new file mode 100644 index 00000000000..8c8cdacae76 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-message-toast.md @@ -0,0 +1,28 @@ +# Disallow violation for certain options of sap.m.MessageToast (sap-message-toast) + +The Fiori design guidelines require a certain behavior of a message toast. + +## Rule Details + +The check looks for any call of the method `show` on the `sap.m.MessageToast-Object` and checks the following properties: + +- `duration` must no be smaller than 3000 +- `width` must no be greater then 35em +- `my` must be _center bottom_ +- `at` must be _center bottom_ + +The following patterns are considered warnings: + +```js +sap.m.MessageToast.show('This is a warning!', { duration: 1000 }); +``` + +The following patterns are not ot considered warnings: + +```js +sap.m.MessageToast.show('This is a warning!'); +``` + +## Bug report + +In case you think the finding is a false positive, open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-absolute-component-path.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-absolute-component-path.md new file mode 100644 index 00000000000..62b643bfb5e --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-absolute-component-path.md @@ -0,0 +1,41 @@ +# Disallow absolute paths to component includes (sap-no-absolute-component-path) + +Giving an absolute path in component includes might produce an error and is no longer supported by UI5. + +## Rule Details + +The rule checks if `includes` inside a component have a leading `/`. + +The following patterns are considered warnings: + +```js +code: "sap.ui.core.UIComponent.extend('sap.ui.demokit.explored.Component', { " + + 'metadata : { ' + + 'includes : [ ' + + "'css/style2.css', " + + "'/css/style2.css', " + + "'/css/titles.css' " + + '], ' + + 'routing : { ' + + 'config : { ' + + 'routerClass : MyRouter, ' + + "viewType : 'XML', " + + "viewPath : 'sap.ui.demokit.explored.view', " + + "targetControl : 'splitApp', " + + 'clearTarget : false ' + + '}, ' + + 'routes : [ { ' + + "pattern : 'entity/{id}/{part}', " + + "name : 'entity', " + + "view : 'entity', " + + 'viewLevel : 3, ' + + "targetAggregation : 'detailPages' " + + '} ]' + + '} ' + + '} ' + + '});'; +``` + +## Bug Report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-br-on-return.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-br-on-return.md new file mode 100644 index 00000000000..25c15eb8ccf --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-br-on-return.md @@ -0,0 +1,21 @@ +# Detect the usage of document.queryCommandSupported (sap-no-br-on-return) + +This rule checks any call of queryCommandSupported on document. Calls with argument `sap-no-br-on-return` are not allowed because this is a browser specific command. + +## Rule Details + +Warning message: _`insertBrOnReturn` is not allowed since it is a Mozilla specific method, other browsers don't support that._ + +The following patterns are considered warnings: + +```js +var abc = document.queryCommandSupported('insertBrOnReturn'); +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-commons-usage.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-commons-usage.md new file mode 100644 index 00000000000..9c573939054 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-commons-usage.md @@ -0,0 +1,23 @@ +# Detects the usage of sap.ui.commons objects (sap-no-commons-usage) + +As per Fiori Architectural Guidelines controls from _sap.ui.commons_ are not allowed. Instead _sap.m_ controls should be used. + +_Warning Message_: Usage of sap.ui.commons controls is forbidden, please use controls from sap.m library. + +The following patterns are considered warnings: + +```js +sap.ui.define(['sap.ui.commons.anyControl'], function (control) { + doSomething.with(control); +}); +``` + +```js +function createControl() { + return new sap.ui.commons.Control(); +} +``` + +## Bug Report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dom-access.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dom-access.md new file mode 100644 index 00000000000..d8da8c6dd06 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dom-access.md @@ -0,0 +1,24 @@ +# Discourage usage of certain methods of document (sap-no-dom-access) + +Accessing the DOM directly is considered risky. If necessary, a jQuery selector should be used instead. + +## Rule details + +The following methods are not allowed to use: + +- getElementById +- getElementsByName +- getElementsByTagName +- getElementsByClassName + +warning message: **Direct DOM access, use jQuery selector instead** + +The following patterns are considered warnings: + +```js +document.getElementById('test'); +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dom-insertion.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dom-insertion.md new file mode 100644 index 00000000000..b858a59740e --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dom-insertion.md @@ -0,0 +1,34 @@ +# Disallow usage dom insertion methods (sap-no-dom-insertion) + +The UI5 guidelines do not allow insertion of elements into the DOM. Instead usage of a custom control should be considered. + +## Rule Details + +The rule detects all method calls of `insertBefore`, `appendChild`, `replaceChild`, `after`, `before`, `insertAfter`, `insertBefore`, `append`, `prepend`, `appendTo`, `prependTo`. + +The following patterns are considered warnings: + +```js +$('#container').append('Test'); + +var list = document.getElementById('myList1'); +list.insertBefore(node, list.childNodes[0]); + +myObject.after(document.body); +``` + +## False positives + +There might be cases where the check produces a false positive, i.e. when you have a method containing one of the strings given above. +In such a case, you can change the method name or deactivate the rule by placing the following pseudo-comment block around your code. +**Please make sure to have your code reviewed by a colleague before you enter such a pseudo-comment.** + +```js +/*eslint-disable sap-no-dom-insertion*/ + +/*eslint-enable sap-no-dom-insertion*/ +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dynamic-style-insertion.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dynamic-style-insertion.md new file mode 100644 index 00000000000..6db7cd402ce --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-dynamic-style-insertion.md @@ -0,0 +1,21 @@ +# Detect dynamic style insertion (sap-no-dynamic-style-insertion) + +## Rule Details + +The check detects any usage of `document.styleSheets`. + +The following patterns are considered warnings: + +```js +var sheet = document.styleSheets[i]; +var abc = document.styleSheets.length; +``` + +Warning message: _Dynamic style insertion, use library CSS or lessifier instead._ + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-element-creation.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-element-creation.md new file mode 100644 index 00000000000..457c5ad995d --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-element-creation.md @@ -0,0 +1,22 @@ +# Disallow direct DOM insertion (sap-no-element-creation) + +The UI5 guidelines do not allow creation of elements in the DOM. Instead usage of a custom control should be considered. + +## Rule Details + +The rule detects all method calls of "createElement", "createTextNode", "createElementNS", "createDocumentFragment", "createComment", "createAttribute" and "createEvent". + +Warning message: _Direct DOM insertion, create a custom control instead_ + +The following patterns are considered warnings: + +```js +document.createElement(foo); +``` + +## Further Reading + + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-encode-file-service.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-encode-file-service.md new file mode 100644 index 00000000000..3d7607357d4 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-encode-file-service.md @@ -0,0 +1,22 @@ +# Detect the usage of encode file service (sap-no-encode-file-service) + +The encode_file service is deprecated and not available on HCP. + +## Rule Details + +The rule detects the usage of the string `/sap/bc/ui2/encode_file`. + +The following patterns are considered warnings: + +```js +oFileUpload.setEncodeUrl( + '/sap/bc/ui2/encode_file' + (sUrlParams ? '?' + sUrlParams : '') +); +var service = '/sap/bc/ui2/encode_file'; +``` + +How to fix: Use the sap.m.UploadCollection with the sap.m.UploadCollectionItem instead. + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-exec-command.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-exec-command.md new file mode 100644 index 00000000000..6aeb142e55a --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-exec-command.md @@ -0,0 +1,24 @@ +# Detect direct DOM manipulation (sap-no-exec-command) + +## Rule Details + +The rule detects usage of the `execCommand` method + +Warning message: _Direct DOM Manipulation, better to use `jQuery.appendTo` if really needed_ + +The following patterns are considered warnings: + +```js +document.execCommand(cmd, false, args); +``` + +```js +document['execCommand'](cmd, false, args); +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-define.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-define.md new file mode 100644 index 00000000000..846d03c4669 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-define.md @@ -0,0 +1,21 @@ +# Detect definition of globals via window object (sap-no-global-define) + +## Rule Details + +Global variables should not be used in Fiori Apps. This check detects global definitions by attachments to the `window` object or override of `window` properties. + +The following patterns are considered warnings: + +```js +window.MyVar = 'A'; +window.name = 'New Name'; +``` + +Warning message: _Definition of global variable/api in `window` object is not permitted._ + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-event.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-event.md new file mode 100644 index 00000000000..1caf65c3810 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-event.md @@ -0,0 +1,28 @@ +# Detect global event handling override (sap-no-global-event) + +The UI5 guidelines do not allow overriding global event handling. + +## Rule Details + +This rule detects override of the following global events: +`onload`, `onunload`, `onabort`, `onbeforeunload`, `onerror`, `onhashchange`, `onpageshow`, `onpagehide`, `onscroll`, `onblur`, `onchange`, `onfocus`, `onfocusin`, `onfocusout`, `oninput`, `oninvalid`, `onreset`, `onsearch`, `onselect`, `onsubmit`. + +#### Global event handling override + +Warning message: _Global event handling override is not permitted, please modify only single events._ + +The following patterns are considered warnings: + +```js +window.event.returnValue = false; +window.onload = function () { + return Hammer; +}; +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-selection.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-selection.md new file mode 100644 index 00000000000..a771843c07e --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-selection.md @@ -0,0 +1,18 @@ +# Discourage usage of global selection (sap-no-global-selection) + +## Rule details + +warning message: Global selection modification, only modify local selections + +The following patterns are considered warnings: + +```js +window.getSelection().rangeCount = 9; +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-variable.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-variable.md new file mode 100644 index 00000000000..39e25ac7a35 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-global-variable.md @@ -0,0 +1,11 @@ +# Global variables shall not be used in SAP Fiori applications (sap-no-global-variable) + +## Rule Details + +The rule checks if a variable is declared as global (defined outside of any function scope) and returns an error message in this case. + +ALLOWED_VARIABLES = [ "undefined", "NaN", "arguments", "PDFJS", "console", "Infinity" ] + +## Bug Report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-hardcoded-color.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-hardcoded-color.md new file mode 100644 index 00000000000..dcb1c649268 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-hardcoded-color.md @@ -0,0 +1,24 @@ +# Disallow usage of hard coded colors (sap-no-hardcoded-color) + +It is not allowed to style Fiori Apps with colors in JavaScript code as they will break the Fiori themes. + +## Rule Details + +The following patterns are considered warnings: + +```js + +$(\"
\"); + +``` + +##### How to Fix: + +Do not specify colors in custom CSS but use the standard theme-dependent classes instead. + +## Bug Report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-hardcoded-url.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-hardcoded-url.md new file mode 100644 index 00000000000..446217ab92f --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-hardcoded-url.md @@ -0,0 +1,31 @@ +# Disallow use of hardcoded URLs (sap-no-hardcoded-url) + +Fiori guidelines do not allow usage of hardcoded URLs to internal or external systems.: + +## Rule Details + +Instead of references to internal system in your URLs, you should only reference the path to the resource. + +Allowed URLs are: + +`http://www.w3.org/`, `http://www.sap.com/Protocols/`, `http://www.sap.com/adt`, `http://localhost/offline/`, `https://localhost/offline/` + +The following patterns are considered warnings: + +```js +serviceUrl: URI("http://ldc.example.com:50000/sap/opu/odata/sap/XXXX/").directory(), +``` + +```js +serviceUrl: 'proxy/http/ldc.example.com:50000/sap/opu/odata/sap/XXXX/'; +``` + +The following patterns are not considered warnings: + +```js +serviceUrl: "/sap/opu/odata/sap/XXXX/", +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-history-manipulation.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-history-manipulation.md new file mode 100644 index 00000000000..7839d1ec7c3 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-history-manipulation.md @@ -0,0 +1,43 @@ +# Discourage direct history manipulation (sap-no-history-manipulation) + +## Rule details + +Warning message: _Direct history manipulation, does not work with deep links, use router and navigation events instead_ + +The following patterns are considered warnings: + +```js +window.history.back(); +``` + +```js +history.go(-3); +``` + +```js +var personalHistory = window.history; +personalHistory.back(); +``` + +The following patterns are NOT considered warnings: + +```js +myNavBack : function(sRoute, mData) { + var oHistory = sap.ui.core.routing.History.getInstance(); + var sPreviousHash = oHistory.getPreviousHash(); + //The history contains a previous entry + if (sPreviousHash !== undefined) { + window.history.go(-1); + } else { + var bReplace = true; // otherwise we go backwards with a forward history + this.navTo(sRoute, mData, bReplace) + } +}, +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-inner-html-access.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-inner-html-access.md new file mode 100644 index 00000000000..fda8f3ff18d --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-inner-html-access.md @@ -0,0 +1,22 @@ +# Discourage the access of innerHTML (sap-no-inner-html-access) + +Accessing the DOM directly is considered risky. + +## Rule details + +It is not recommended to access the DOM via the innerHTML attribute. + +warning message: **Accessing the inner html is not recommended.** + +The following patterns are considered warnings: + +```js +if ('some text' === button.innerHTML) { + doSomething(); +} +document.getElementById('button').innerHTML = 'send'; +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-inner-html-write.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-inner-html-write.md new file mode 100644 index 00000000000..24ca93d59c6 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-inner-html-write.md @@ -0,0 +1,20 @@ +# Write to innerHTML (sap-no-inner-html-write) + +Writing to innerHTML is not allowed. + +## Rule details + +It is not allowed to alter the DOM via the innerHTML attribute. + +warning message: **"Writing to the inner html is not allowed."** + +The following patterns are considered warnings: + +```js +document.getElementById('button').innerHTML = 'send'; +document.getElementById('button')['innerHTML'] = 'send'; +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-jquery-device-api.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-jquery-device-api.md new file mode 100644 index 00000000000..33832fd541c --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-jquery-device-api.md @@ -0,0 +1,32 @@ +# Disallow usage of the jQuery device APIs (sap-no-jquery-device-api) + +The `jQuery` device API is deprecated since 1.20. The respective functions of `sap.ui.Device` should be used instead. + +## Rule Details + +The check looks for any call of `jQuery.device`. + +The following patterns are considered warnings: + +```js +if (jQuery.device.is.android_phone === false) { +} + +if ($.device.is.android_phone === false) { +} +``` + +The following patterns are not not considered warnings: + +```js +if (!sap.ui.Device.system.desktop) { + this.getView().byId('factSheetButton').setVisible(false); +} +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-localhost.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-localhost.md new file mode 100644 index 00000000000..bd9cbd84af4 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-localhost.md @@ -0,0 +1,26 @@ +# Disallow use localhost (sap-no-localhost) + +Usage of `localhost` in Fiori apps is often done for debugging or test reasons and should be avoided in in productive code. + +## Rule Details + +The check detects the string "localhost" in any JavaScript function call or expression. +The usage of localhost in an offline scenario is allowed, therefore coding mentioned below will not raise a warning. + +The following patterns are considered warnings: + +```js +if (location.hostname === 'localhost') { +} +location.host.indexOf('localhost'); +``` + +The following patterns are not considered warnings: + +```js +return 'http://localhost/offline/my_contacts/ContactCollection'; +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-localstorage.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-localstorage.md new file mode 100644 index 00000000000..1e00991e94b --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-localstorage.md @@ -0,0 +1,15 @@ +# Usage of localstorage (sap-no-localstorage) + +Local storage must not be used in a Fiori application + +## Rule Details + +The following patterns are considered warnings: + +```js +localStorage.setObj(this.SETTINGS_NAME, this.objSettings); +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-location-reload.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-location-reload.md new file mode 100644 index 00000000000..f3a5aebef79 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-location-reload.md @@ -0,0 +1,21 @@ +# Detect location reload (sap-no-location-reload) + +Fiori guidelines do not allow `location.reload()`. + +## Rule Details + +This checks detects usage of `location.reload()` + +The following patterns are considered warnings: + +```js +location.reload(); +var mylocation = location; +mylocation.reload(); +``` + +Warning message: _location.reload() is not permitted._ + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-location-usage.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-location-usage.md new file mode 100644 index 00000000000..9ee3465bea7 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-location-usage.md @@ -0,0 +1,39 @@ +# Discourage usage of location (sap-no-location-usage) + +This is a collection of usages of browser APIs that might lead to issues. +Please search for the warning messages that you see in ESLint to find the explanation of the respective check. + +## Rule details + +window.location.\* parameters should not be used directly. + +### warning message: + +- Usage of location.assign(), +- Direct Hash manipulation, use router instead, +- Usage of location.href, Override of location + +The following patterns are considered warnings: + +```js +location.assign(data.results[0].url); + +var abc = location; + +abc.href.split(' & '); + +window.location.hash = '#foo'; + +window.location.hash.indexOf('-'); + +location = this.oNavParams.toOppApp; + +window.location = this.oNavParams.toOppApp; +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-navigator.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-navigator.md new file mode 100644 index 00000000000..f50a978cf27 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-navigator.md @@ -0,0 +1,21 @@ +# Detect window.navigator usage (sap-no-navigator) + +## Rule Details + +The `window.navigator` object should not be used at all, instead the sap.ui.Device API should be used. + +The following patterns are considered warnings: + +```js +var language = navigator.language; +var name = navigator.appCodeName; +``` + +Warning message: _navigator usage is forbidden, use `sap.ui.Device` API instead._ + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-override-rendering.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-override-rendering.md new file mode 100644 index 00000000000..f3c9e50158b --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-override-rendering.md @@ -0,0 +1,21 @@ +# Disallow override of control methods (sap-no-override-rendering) + +## Rule Details + +The check detects override of getters, setters and the functions `onBeforeRendering` and `onAfterRendering` for SAPUI5 controls. + +The following patterns are considered warnings: + +```js + +var oButton5 = new sap.me.foo.bar.Button();" +oButton5.onAfterRendering = function render(){foo.bar = 1;}; + +``` + +## Further Reading + + +## Bug Report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-override-storage-prototype.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-override-storage-prototype.md new file mode 100644 index 00000000000..7d32eddf8ff --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-override-storage-prototype.md @@ -0,0 +1,15 @@ +# Disallow override of csap-no-override-storage-prototype (sap-no-override-storage-prototype) + +## Rule Details + +Storage prototype must not be overridden as this can lead to unpredictable errors + +The following patterns are considered warnings: + +```js +Storage.prototype.setObj = function (key, obj) {}; +``` + +## Bug Report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-proprietary-browser-api.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-proprietary-browser-api.md new file mode 100644 index 00000000000..9953e659a03 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-proprietary-browser-api.md @@ -0,0 +1,32 @@ +# Discourage usage of proprietary browser API (sap-no-proprietary-browser-api) + +## Rule details + +Certain browser APIs are considered to be risky, when used directly and not wrapped via jQuery. +The check detects the following browser APIs: +`document.body.*`, `screen.*`, `window.innerWidth`, `window.innerHeight` + +The following patterns are considered warnings: + +```js +var variab1 = window.innerWidth; +var variab1 = window.innerHeight; + +var myscreen = screen; +var x = myscreen.something; + +document.body.appendChild(x); +document.body.style.backgroundColor = 'yellow'; +``` + +The following patterns are not considered warnings: + +```js +var width = $(window).innerWidth(); +``` + +**Warning Message: _Proprietary Browser API access, use jQuery selector instead._** + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-sessionstorage.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-sessionstorage.md new file mode 100644 index 00000000000..beaf740d4f3 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-sessionstorage.md @@ -0,0 +1,15 @@ +# Disallow usage of session storage (sap-no-sessionstorage) + +## Rule Details + +For security reasons, the usage of session storage is not allowed in a Fiori application + +The following patterns are considered warnings: + +```js +sessionStorage.setObj(this.SETTINGS_NAME, this.objSettings); +``` + +## Bug Report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-ui5-prop-warning.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-ui5-prop-warning.md new file mode 100644 index 00000000000..d9d4abe144d --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-ui5-prop-warning.md @@ -0,0 +1,26 @@ +# Disallow usage of private members of UI5 objects (sap-no-ui5-prop-warning) + +Private members of UI5 objects must never be used in Fiori Apps. They can be changed by UI5 at anytime and the App might not work anymore. + +## Rule Details + +The rule checks usage of a member which has the same name as the following UI5 members: + +### sap.ui.model.odata.ODataModel, sap.ui.model.odata.v2.ODataModel: + +> _oData_ + +## False Positives + +As the check can not determine, whether the property used is from as SAPUI5 object, there might be false positives in case you defined a property with the same name in your own object. +In such a case you can disable the check in your coding like this: + +```js + +/* eslint-disable sap-no-ui5-prop-warning */ + +...some code false positives + +/* eslint-enable sap-no-ui5-prop-warning*/ + +``` diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-ui5base-prop.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-ui5base-prop.md new file mode 100644 index 00000000000..d56bc158378 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-ui5base-prop.md @@ -0,0 +1,50 @@ +# Disallow usage of private members of UI5 objects (sap-no-ui5base-prop) + +Private members of UI5 objects must never be used in Fiori Apps. They can be changed by UI5 at anytime and the App might not work anymore. + +## Rule Details + +The rule checks usage of a member which has the same name as the following UI5 members: + +### sap.ui.base.ManagedObject: + +> _mProperties_, _mAggregations_, _mAssociations_, _mMethods_, +_oParent_, _aDelegates_, _aBeforeDelegates_, _iSuppressInvalidate_, +_oPropagatedProperties_, _oModels_, _oBindingContexts_, +_mBindingInfos_, _sBindingPath_, _mBindingParameters_, +_mBoundObjects_ + +### sap.ui.base.EventProvider + +> _mEventRegistry_, _oEventPool_ + +### sap.ui.base.Event + +> _oSource_, _mParameters_, _sId_ + +### sap.ui.model.odata.ODataModel, sap.ui.model.odata.v2.ODataModel: + +> _oServiceData_, _bCountSupported_, _bCache_, _oRequestQueue_, +_aBatchOperations_, _oHandler_, _mSupportedBindingModes_, +_sDefaultBindingMode_, _bJSON_, _aPendingRequestHandles_, +_aCallAfterUpdate_, _mRequests_, _mDeferredRequests_, +_mChangedEntities_, _mChangeHandles_, _mDeferredBatchGroups_, +_mChangeBatchGroups_, _bTokenHandling_, _bWithCredentials_, +_bUseBatch_, _bRefreshAfterChange_, _sMaxDataServiceVersion_, +_bLoadMetadataAsync_, _bLoadAnnotationsJoined_, _sAnnotationURI_, +_sDefaultCountMode_, _sDefaultOperationMode_, _oMetadataLoadEvent_, +_oMetadataFailedEvent_, _sRefreshBatchGroupId_, +_sDefaultChangeBatchGroup_, _oAnnotations_, _aUrlParams_ + +## False Positives + +As the check can not determine, whether the property used is from as SAPUI5 object, there might be false positives in case you defined a property with the same name in your own object. +In such a case you can disable the check in your coding like this: + +```js +/* eslint-disable sap-no-ui5base-prop */ + +...some code false positives + +/* eslint-enable sap-no-ui5base-prop */ +``` \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-window-alert.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-window-alert.md new file mode 100644 index 00000000000..be22517a2aa --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-no-window-alert.md @@ -0,0 +1,15 @@ +# Disallow usage of window.alert (sap-no-window-alert) + +A window.alert statement should not be part of the code that is committed to GIT! + +Instead, sap.m.MessageBox should be used. Please check the [UI5 API](https://ui5.sap.com/#/api/sap.m.MessageBox) reference for an example how to do it. + +The following patterns are considered warnings: + +```js +window.alert('hello world'); +``` + +## Bug Report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-opa5-autowait-true.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-opa5-autowait-true.md new file mode 100644 index 00000000000..d702c518fcb --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-opa5-autowait-true.md @@ -0,0 +1,13 @@ + +# autoWait must be true in extendConfig +This rule checks if **autoWait** has been set to **true** in **Opa5.extendConfig** method. + + +## Rule Details +This rule aims to avoid unstable OPA test code which does not follow the [recommendation](https://sapui5.hana.ondemand.com/#/api/sap.ui.test.Opa5%23methods/waitFor) to use the autoWait logic. +This rule aims to detect error in OPA test code. Checks if the autoWait param is set and the value is true. The rule throws error otherwise when the autoWait is not present or is set to false. + + +```js +autoWait: true, +``` diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-timeout-usage.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-timeout-usage.md new file mode 100644 index 00000000000..454bfdb3260 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-timeout-usage.md @@ -0,0 +1,24 @@ +# Discourage usage of setTimeout (sap-timeout-usage) + +This rule finds calls to the setTimeout method with a timeout greater than 0. + +## Rule details + +Executing logic with timeouts is often a workaround for faulty behavior and does not fix the root cause. +The timing that works for you may not work under different circumstances (other geographical locations with greater network latency, or other devices that have slower processors) or when the code is changed. +Use callbacks or events instead, if available. Please check the SAPUI5 guidelines for more details. + +### warning message: Timeout with value > 0 + +The following patterns are considered warnings: + +```js +window.setTimeout(jQuery.proxy(processChanges, this), 50); +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further reading + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-forms.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-forms.md new file mode 100644 index 00000000000..81ed021b0c0 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-forms.md @@ -0,0 +1,140 @@ +# Unsupported content in SimpleForm, Form or SmartForm (sap-ui5-forms) + +This rule checks for unsupported content in SimpleForm, Form or SmartForm. + +## Rule details + +Form Form, SimpleForm or SmartForm only controls implementing interface sap.ui.core.IFormContent are supported. Other controls, especially layouts, tables, views or complex controls are not supported. Using unsupported controls might bring visual issues, breaking the designed responsiveness, bringing issues with keyboard support or screen-reader support. Please use only labels and controls implementing interface sap.ui.core.IFormContent as content of a Form. + +### warning message: Invalid content for SimpleForm / Form / SmartForm. + +The following code snippet is fine: + +```js +var oSF1 = new sap.ui.layout.form.SimpleForm("SF1", { + title: "Supported Content", + editable: true, + content: [ + new sap.m.Label({text: "Label"}), + new sap.m.Input() + ] + }).placeAt('content'); +``` + + +```js +var oF1 = new sap.ui.layout.form.Form("F1", { + title: "Supported Content", + editable: true, + layout: new sap.ui.layout.form.ResponsiveGridLayout(), + formContainers: [ + new sap.ui.layout.form.FormContainer({ + formElements: [ + new sap.ui.layout.form.FormElement({ + label: new sap.m.Label({text: "Label"}), + fields: [ + new sap.m.Input() + ] + }) + ] + }) + ] + }).placeAt('content'); +``` + + +```js +var oSF1 = new sap.ui.comp.smartform.SmartForm("SF1", { + title: "Supported Content", + editable: true, + layout: new sap.ui.comp.smartform.Layout(), + groups: [ + new sap.ui.comp.smartform.Group({ + groupElements: [ + new sap.ui.comp.smartform.GroupElement({ + label: new sap.m.Label({text: "Label"}), + elements: [ + new sap.m.Input() + ] + }) + ] + }) + ] + }).placeAt('content'); +``` + + + + +The following code snippets are unsupported and raise Warnings: + +```js +var oSF2 = new sap.ui.layout.form.SimpleForm("SF2", { + title: "Unsupported VerticalLayout", + editable: true, + content: [ + new sap.ui.layout.VerticalLayout({ + content: [ + new sap.m.Label({text: "Label"}), + new sap.m.Input() + ] + }) + ] + }).placeAt('content'); +``` + + +```js +var oF2 = new sap.ui.layout.form.Form("F2", { + title: "Unsupported VerticalLayout", + editable: true, + layout: new sap.ui.layout.form.ResponsiveGridLayout(), + formContainers: [ + new sap.ui.layout.form.FormContainer({ + formElements: [ + new sap.ui.layout.form.FormElement({ + fields: [ + new sap.ui.layout.VerticalLayout({ + content: [ + new sap.m.Label({text: "Label"}), + new sap.m.Input() + ] + }) + ] + }) + ] + }) + ] + }).placeAt('content'); +``` + + +```js +var oSF2 = new sap.ui.comp.smartform.SmartForm("SF2", { + title: "Unsupported VerticalLayout", + editable: true, + layout: new sap.ui.comp.smartform.Layout(), + groups: [ + new sap.ui.comp.smartform.Group({ + groupElements: [ + new sap.ui.comp.smartform.GroupElement({ + elements: [ + new sap.ui.layout.VerticalLayout({ + content: [ + new sap.m.Label({text: "Label"}), + new sap.m.Input() + ] + }) + ] + }) + ] + }) + ] + }).placeAt('content'); +``` + + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-global-eval.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-global-eval.md new file mode 100644 index 00000000000..f61140abf15 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-global-eval.md @@ -0,0 +1,37 @@ +# Detect the usage of global eval via jQuery(.sap) (sap-ui5-global-eval) + +## Rule Details + +The rule detects +1. invocation of function "jQuery.sap.globalEval()" or "$.sap.globalEval()" +2. invocation of function "jQuery.globalEval()" or "$.globalEval()" + + +Warning message: _Usage of globalEval() / eval() is not allowed due to strict Content Security Policy._ + +The following patterns are considered warnings: + +``` +jQuery.globalEval( "var newVar = true;" ); +``` +``` +jQuery.sap.globalEval( "var newVar = true;" ); +``` +``` +$.globalEval( "var newVar = true;" ); +``` +``` +$.sap.globalEval( "var newVar = true;" ); +``` +``` +var a = jQuery.sap; +a.globalEval( "var newVar = true;" ); +``` + +## Bug report + +In case you detect a problem with this check, please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + +- [SAPUI5 Guidelines](https://ui5.sap.com/#/api/jQuery.sap%23methods/jQuery.sap.globalEval) \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-legacy-factories.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-legacy-factories.md new file mode 100644 index 00000000000..c4ee2f0caa0 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-legacy-factories.md @@ -0,0 +1,101 @@ +# Detect the usage of legacy UI5 factories (sap-ui5-legacy-factories) + +## Rule Details + +The rule detects +1. Invocation of function "sap.ui.component()" +2. Invocation of function "sap.ui.component.load()" +3. Invocation of function "sap.ui.view()" +4. Invocation of function "sap.ui.xmlview()" +5. Invocation of function "sap.ui.jsview()" +6. Invocation of function "sap.ui.controller()" +7. Invocation of function "sap.ui.extensionpoint()" +8. Invocation of function "sap.ui.fragment()" +9. Invocation of function "sap.ui.getVersionInfo()" +10. Invocation of function "jQuery.sap.resources()" or "$.sap.resources()" + + +Warning message: _Make use of sap.ui.define([...], function(...) {...} to load required dependencies. Legacy UI5 factories leading to synchronous loading._ + +The following patterns are considered warnings: + +``` +var oView = sap.ui.jsview({ + viewName: "my.View" +}); +``` +``` +var oComponentInstance = sap.ui.component({ + name: "my.comp" +}); +``` +``` +sap.ui.component({ + name: "my.comp" +}); +``` +``` +var oComponentClass = sap.ui.component.load({ + name: "my.comp" +}); +``` +``` +var oComponentInstance = sap.ui.component("my-comp-id"); +``` + +``` +var oView = sap.ui.view({ + viewName: "my.View", + type: "XML" +}); +``` + +``` +var oView = sap.ui.xmlview({ + viewName: "my.View" +}); +``` + +``` +var oController = sap.ui.controller({ + name: "my.Controller" +}); +``` + +``` +var aControls = sap.ui.extensionpoint({ + name: "my.Point" +}); +``` + +``` +var aControls = sap.ui.fragment({ + name: "my.fragment", + type: "XML" +}); +``` + +``` +var oVersionInfo = sap.ui.getVersionInfo(); +``` + +``` +jQuery.sap.resources({ + url: "mybundle.properties" +}); +``` + +``` +$.sap.resources({ + url: "mybundle.properties" +}); +``` + + +## Bug report + +In case you detect a problem with this check, please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + +- [SAPUI5 Guidelines : Legacy Factories Replacement](https://ui5.sap.com/#/topic/491bd9c70b9f4c4d913c8c7b4a970833.html) \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-legacy-jquerysap-usage.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-legacy-jquerysap-usage.md new file mode 100644 index 00000000000..dab395e6322 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-ui5-legacy-jquerysap-usage.md @@ -0,0 +1,34 @@ +# Detect the usage of legacy jQuery.sap (sap-ui5-legacy-jquerysap-usage) + +## Rule Details + +The rule detects +1. Invocation of function "jQuery.sap.require()" or "$.sap.require()" +2. Invocation of function "jQuery.sap.declare()" or "$.sap.declare()" + + +Warning message: _Legacy jQuery.sap usage is not allowed due to strict Content Security Policy._ + +The following patterns are considered warnings: + + +``` +jQuery.sap.require( 'sap.m.Button' ); +``` +``` +$.sap.require( 'sap.m.Button' ); +``` +``` +jQuery.sap.declare( "myModule" , true); +``` +``` +$.sap.declare( "myModule" , true); +``` + +## Bug report + +In case you detect a problem with this check, please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). + +## Further Reading + +- [SAPUI5 Guidelines](https://ui5.sap.com/#/topic/a075ed88ef324261bca41813a6ac4a1c.html) \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/docs/rules/sap-usage-basemastercontroller.md b/packages/eslint-plugin-fiori-tools/docs/rules/sap-usage-basemastercontroller.md new file mode 100644 index 00000000000..641c16eb230 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/docs/rules/sap-usage-basemastercontroller.md @@ -0,0 +1,27 @@ +# Detect usage of BaseMasterController (sap-usage-basemastercontroller) + +The `BaseMasterController` is a deprecated controller and should be replaced by `sap.ca.scfld.md.controller.ScfldMasterController`. + +## Rule Details + +The rule detects the usage of the object `sap.ca.scfld.md.controller.BaseMasterController` and the usage of the string `sap/ca/scfld/md/controller/BaseMasterController`, like in define-methods. + +The following patterns are considered warnings: + +```js +sap.ca.scfld.md.controller.BaseMasterController.extend('myBaseController', { + config: 'myconfig', +}); + +define(['sap/ca/scfld/md/controller/BaseMasterController'], function ( + Controller +) { + Controller.extend('myBaseController', { + config: 'myconfig', + }); +}); +``` + +## Bug report + +In case you think the finding is a false positive please open a Github issue [here](https://github.com/SAP/open-ux-tools/issues). diff --git a/packages/eslint-plugin-fiori-tools/eslint.config.js b/packages/eslint-plugin-fiori-tools/eslint.config.js index 029e264af06..e3130fca8cd 100644 --- a/packages/eslint-plugin-fiori-tools/eslint.config.js +++ b/packages/eslint-plugin-fiori-tools/eslint.config.js @@ -1,5 +1,5 @@ -const { rules } = require('eslint-plugin-fiori-custom'); const base = require('../../eslint.config.js'); +const { default: eslintPlugin } = require('eslint-plugin-eslint-plugin'); module.exports = [ { @@ -17,5 +17,6 @@ module.exports = [ rules: { '@typescript-eslint/no-require-imports': 'warn' } - } + }, + eslintPlugin.configs.recommended ]; diff --git a/packages/eslint-plugin-fiori-tools/package.json b/packages/eslint-plugin-fiori-tools/package.json index f93a2c3fb32..4146207724c 100644 --- a/packages/eslint-plugin-fiori-tools/package.json +++ b/packages/eslint-plugin-fiori-tools/package.json @@ -17,12 +17,15 @@ "test": "jest --ci --forceExit --detectOpenHandles --colors" }, "devDependencies": { - "eslint": "^9" + "eslint": "^9", + "@typescript-eslint/rule-tester": "8.46.2", + "eslint-plugin-eslint-plugin": "7.2.0" }, "dependencies": { - "@eslint/eslintrc": "^3.3.1", + "@babel/core": "^7.28.5", + "@babel/eslint-parser": "^7.28.5", "@eslint/js": "^9", - "eslint-plugin-fiori-custom": "^2.6.7", + "lodash": "4.17.21", "yaml": "2.2.2" }, "peerDependencies": { @@ -36,6 +39,8 @@ "files": [ "LICENSE", "lib", + "docs", + "config", "eslintrc-common.js", "eslintrc-prod.js", "eslintrc-test.js", diff --git a/packages/eslint-plugin-fiori-tools/src/index.ts b/packages/eslint-plugin-fiori-tools/src/index.ts index edf553e949b..9addc34b5f2 100644 --- a/packages/eslint-plugin-fiori-tools/src/index.ts +++ b/packages/eslint-plugin-fiori-tools/src/index.ts @@ -1,68 +1,214 @@ -//------------------------------------------------------------------------------ -// Plugin Definition -//------------------------------------------------------------------------------ +import type { Rule } from 'eslint'; +import { readFileSync } from 'node:fs'; +import { join } from 'node:path'; -export const config = { - defaultTS: { - extends: [ - '../config/legacy/eslintrc-common.js', - '../config/legacy/eslintrc-typescript.js', - '../config/legacy/eslintrc-prod.js', - '../config/legacy/eslintrc-test.js' - ], - parser: '@typescript-eslint/parser' // override parser used in eslint-plugin-fiori-custom to support TS +// Read package.json to get version +const packageJson = JSON.parse(readFileSync(join(__dirname, '../package.json'), 'utf-8')) as { + name: string; + version: string; +}; + +// Import all rules +import sapBookmarkPerformance from './rules/sap-bookmark-performance'; +import sapBrowserApiError from './rules/sap-browser-api-error'; +import sapBrowserApiWarning from './rules/sap-browser-api-warning'; +import sapCrossApplicationNavigation from './rules/sap-cross-application-navigation'; +import sapForbiddenWindowProperty from './rules/sap-forbidden-window-property'; +import sapMessageToast from './rules/sap-message-toast'; +import sapNoAbsoluteComponentPath from './rules/sap-no-absolute-component-path'; +import sapNoBrOnReturn from './rules/sap-no-br-on-return'; +import sapNoCommonsUsage from './rules/sap-no-commons-usage'; +import sapNoDomAccess from './rules/sap-no-dom-access'; +import sapNoDomInsertion from './rules/sap-no-dom-insertion'; +import sapNoDynamicStyleInsertion from './rules/sap-no-dynamic-style-insertion'; +import sapNoElementCreation from './rules/sap-no-element-creation'; +import sapNoEncodeFileService from './rules/sap-no-encode-file-service'; +import sapNoEventProp from './rules/sap-no-event-prop'; +import sapNoExecCommand from './rules/sap-no-exec-command'; +import sapNoGlobalDefine from './rules/sap-no-global-define'; +import sapNoGlobalEvent from './rules/sap-no-global-event'; +import sapNoGlobalSelection from './rules/sap-no-global-selection'; +import sapNoGlobalVariable from './rules/sap-no-global-variable'; +import sapNoHardcodedColor from './rules/sap-no-hardcoded-color'; +import sapNoHardcodedUrl from './rules/sap-no-hardcoded-url'; +import sapNoHistoryManipulation from './rules/sap-no-history-manipulation'; +import sapNoInnerHtmlAccess from './rules/sap-no-inner-html-access'; +import sapNoInnerHtmlWrite from './rules/sap-no-inner-html-write'; +import sapNoJqueryDeviceApi from './rules/sap-no-jquery-device-api'; +import sapNoLocalhost from './rules/sap-no-localhost'; +import sapNoLocalstorage from './rules/sap-no-localstorage'; +import sapNoLocationReload from './rules/sap-no-location-reload'; +import sapNoLocationUsage from './rules/sap-no-location-usage'; +import sapNoNavigator from './rules/sap-no-navigator'; +import sapNoOverrideRendering from './rules/sap-no-override-rendering'; +import sapNoOverrideStoragePrototype from './rules/sap-no-override-storage-prototype'; +import sapNoProprietaryBrowserApi from './rules/sap-no-proprietary-browser-api'; +import sapNoSessionstorage from './rules/sap-no-sessionstorage'; +import sapNoUi5PropWarning from './rules/sap-no-ui5-prop-warning'; +import sapNoUi5baseProp from './rules/sap-no-ui5base-prop'; +import sapNoUi5eventproviderProp from './rules/sap-no-ui5eventprovider-prop'; +import sapNoUi5odatamodelProp from './rules/sap-no-ui5odatamodel-prop'; +import sapNoWindowAlert from './rules/sap-no-window-alert'; +import sapOpa5AutowaitTrue from './rules/sap-opa5-autowait-true'; +import sapTimeoutUsage from './rules/sap-timeout-usage'; +import sapUi5Forms from './rules/sap-ui5-forms'; +import sapUi5GlobalEval from './rules/sap-ui5-global-eval'; +import sapUi5LegacyFactories from './rules/sap-ui5-legacy-factories'; +import sapUi5LegacyJquerysapUsage from './rules/sap-ui5-legacy-jquerysap-usage'; +import sapUi5NoPrivateProp from './rules/sap-ui5-no-private-prop'; +import sapUsageBasemastercontroller from './rules/sap-usage-basemastercontroller'; + +// Plugin meta information (required for ESLint 9) +export const meta = { + name: '@sap-ux/eslint-plugin-fiori-tools', + version: packageJson.version +}; + +const rulesMap: Record = { + 'sap-bookmark-performance': sapBookmarkPerformance, + 'sap-browser-api-error': sapBrowserApiError, + 'sap-browser-api-warning': sapBrowserApiWarning, + 'sap-cross-application-navigation': sapCrossApplicationNavigation, + 'sap-forbidden-window-property': sapForbiddenWindowProperty, + 'sap-message-toast': sapMessageToast, + 'sap-no-absolute-component-path': sapNoAbsoluteComponentPath, + 'sap-no-br-on-return': sapNoBrOnReturn, + 'sap-no-commons-usage': sapNoCommonsUsage, + 'sap-no-dom-access': sapNoDomAccess, + 'sap-no-dom-insertion': sapNoDomInsertion, + 'sap-no-dynamic-style-insertion': sapNoDynamicStyleInsertion, + 'sap-no-element-creation': sapNoElementCreation, + 'sap-no-encode-file-service': sapNoEncodeFileService, + 'sap-no-event-prop': sapNoEventProp, + 'sap-no-exec-command': sapNoExecCommand, + 'sap-no-global-define': sapNoGlobalDefine, + 'sap-no-global-event': sapNoGlobalEvent, + 'sap-no-global-selection': sapNoGlobalSelection, + 'sap-no-global-variable': sapNoGlobalVariable, + 'sap-no-hardcoded-color': sapNoHardcodedColor, + 'sap-no-hardcoded-url': sapNoHardcodedUrl, + 'sap-no-history-manipulation': sapNoHistoryManipulation, + 'sap-no-inner-html-access': sapNoInnerHtmlAccess, + 'sap-no-inner-html-write': sapNoInnerHtmlWrite, + 'sap-no-jquery-device-api': sapNoJqueryDeviceApi, + 'sap-no-localhost': sapNoLocalhost, + 'sap-no-localstorage': sapNoLocalstorage, + 'sap-no-location-reload': sapNoLocationReload, + 'sap-no-location-usage': sapNoLocationUsage, + 'sap-no-navigator': sapNoNavigator, + 'sap-no-override-rendering': sapNoOverrideRendering, + 'sap-no-override-storage-prototype': sapNoOverrideStoragePrototype, + 'sap-no-proprietary-browser-api': sapNoProprietaryBrowserApi, + 'sap-no-sessionstorage': sapNoSessionstorage, + 'sap-no-ui5-prop-warning': sapNoUi5PropWarning, + 'sap-no-ui5base-prop': sapNoUi5baseProp, + 'sap-no-ui5eventprovider-prop': sapNoUi5eventproviderProp, + 'sap-no-ui5odatamodel-prop': sapNoUi5odatamodelProp, + 'sap-no-window-alert': sapNoWindowAlert, + 'sap-opa5-autowait-true': sapOpa5AutowaitTrue, + 'sap-timeout-usage': sapTimeoutUsage, + 'sap-ui5-forms': sapUi5Forms, + 'sap-ui5-global-eval': sapUi5GlobalEval, + 'sap-ui5-legacy-factories': sapUi5LegacyFactories, + 'sap-ui5-legacy-jquerysap-usage': sapUi5LegacyJquerysapUsage, + 'sap-ui5-no-private-prop': sapUi5NoPrivateProp, + 'sap-usage-basemastercontroller': sapUsageBasemastercontroller +}; + +// Build rules object with both standard and legacy (fiori-custom/) prefixes +// The fiori-custom/ prefix is maintained for backward compatibility with +// the original eslint-plugin-fiori-custom package that this replaced +export const rules: Record = {}; +Object.keys(rulesMap).forEach((ruleName: string) => { + rules[ruleName] = rulesMap[ruleName]; + // Legacy compatibility: also register with fiori-custom/ prefix + rules[`fiori-custom/${ruleName}`] = rulesMap[ruleName]; +}); + +// Named configs for easy consumption +// These use getters for lazy loading to avoid loading config files at require time +// The config files are templates meant for end users and have dependencies that +// may not be available when the plugin itself is loaded +export const configs = { + // Recommended config for JavaScript projects (prod + test) + get recommended() { + const commonConfig = require('../config/eslintrc-common.js'); + const prodConfig = require('../config/eslintrc-prod.js'); + const testConfig = require('../config/eslintrc-test.js'); + return [...commonConfig, ...prodConfig, ...testConfig]; + }, + // Recommended config for TypeScript projects (prod + test) + get 'recommended-typescript'() { + const commonConfig = require('../config/eslintrc-common.js'); + const prodConfig = require('../config/eslintrc-prod.js'); + const testConfig = require('../config/eslintrc-test.js'); + const typescriptConfig = require('../config/eslintrc-typescript.js'); + return [...commonConfig, ...typescriptConfig, ...prodConfig, ...testConfig]; }, - defaultJS: { - extends: [ - '../config/legacy/eslintrc-common.js', - '../config/legacy/eslintrc-prod.js', - '../config/legacy/eslintrc-test.js' - ] + // Production code only + get 'prod-code'() { + const commonConfig = require('../config/eslintrc-common.js'); + const prodConfig = require('../config/eslintrc-prod.js'); + return [...commonConfig, ...prodConfig]; }, - testCode: { - extends: [ - '../config/legacy/eslintrc-common.js', - '../config/legacy/eslintrc-typescript.js', - '../config/legacy/eslintrc-test.js' - ] + // Production code with TypeScript + get 'prod-code-typescript'() { + const commonConfig = require('../config/eslintrc-common.js'); + const prodConfig = require('../config/eslintrc-prod.js'); + const typescriptConfig = require('../config/eslintrc-typescript.js'); + return [...commonConfig, ...typescriptConfig, ...prodConfig]; }, - prodCode: { - extends: [ - '../config/legacy/eslintrc-common.js', - '../config/legacy/eslintrc-typescript.js', - '../config/legacy/eslintrc-prod.js' - ] + // Test code only + get 'test-code'() { + const commonConfig = require('../config/eslintrc-common.js'); + const testConfig = require('../config/eslintrc-test.js'); + return [...commonConfig, ...testConfig]; }, - flat: { - defaultTS: { - extends: [ - '../config/flat/eslintrc-common.js', - '../config/flat/eslintrc-typescript.js', - '../config/flat/eslintrc-prod.js', - '../config/flat/eslintrc-test.js' - ], - parser: '@typescript-eslint/parser' // override parser used in eslint-plugin-fiori-custom to support TS - }, - defaultJS: { - extends: [ - '../config/flat/eslintrc-common.js', - '../config/flat/eslintrc-prod.js', - '../config/flat/eslintrc-test.js' - ] - }, - testCode: { - extends: [ - '../config/flat/eslintrc-common.js', - '../config/flat/eslintrc-typescript.js', - '../config/flat/eslintrc-test.js' - ] - }, - prodCode: { - extends: [ - '../config/flat/eslintrc-common.js', - '../config/flat/eslintrc-typescript.js', - '../config/flat/eslintrc-prod.js' - ] - } + // Test code with TypeScript + get 'test-code-typescript'() { + const commonConfig = require('../config/eslintrc-common.js'); + const testConfig = require('../config/eslintrc-test.js'); + const typescriptConfig = require('../config/eslintrc-typescript.js'); + return [...commonConfig, ...typescriptConfig, ...testConfig]; } }; + +// Legacy config export for backward compatibility +// @deprecated Use `configs` instead +export const config = { + get defaultTS() { + const commonConfig = require('../config/eslintrc-common.js'); + const prodConfig = require('../config/eslintrc-prod.js'); + const testConfig = require('../config/eslintrc-test.js'); + const typescriptConfig = require('../config/eslintrc-typescript.js'); + return [...commonConfig, ...typescriptConfig, ...prodConfig, ...testConfig]; + }, + get defaultJS() { + const commonConfig = require('../config/eslintrc-common.js'); + const prodConfig = require('../config/eslintrc-prod.js'); + const testConfig = require('../config/eslintrc-test.js'); + return [...commonConfig, ...prodConfig, ...testConfig]; + }, + get testCode() { + const commonConfig = require('../config/eslintrc-common.js'); + const testConfig = require('../config/eslintrc-test.js'); + const typescriptConfig = require('../config/eslintrc-typescript.js'); + return [...commonConfig, ...typescriptConfig, ...testConfig]; + }, + get prodCode() { + const commonConfig = require('../config/eslintrc-common.js'); + const prodConfig = require('../config/eslintrc-prod.js'); + const typescriptConfig = require('../config/eslintrc-typescript.js'); + return [...commonConfig, ...typescriptConfig, ...prodConfig]; + } +}; + +// Default export following ESLint 9 plugin structure +// This is the recommended way to export plugins in ESLint 9 +const plugin = { + meta, + configs, + rules +}; + +export default plugin; diff --git a/packages/eslint-plugin-fiori-tools/src/reporter/detailed-multi.ts b/packages/eslint-plugin-fiori-tools/src/reporter/detailed-multi.ts new file mode 100644 index 00000000000..ab49a0cde92 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/src/reporter/detailed-multi.ts @@ -0,0 +1,9 @@ +/** + * @file Calls the template generator with the flag for generating multiple files set to true. + */ + +import { generateTemplate } from './template-generator'; + +export = function (results: any) { + return generateTemplate(results, true); +}; diff --git a/packages/eslint-plugin-fiori-tools/src/reporter/detailed.ts b/packages/eslint-plugin-fiori-tools/src/reporter/detailed.ts new file mode 100644 index 00000000000..41298ac9164 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/src/reporter/detailed.ts @@ -0,0 +1,10 @@ +/** + * @file Calls the template generator with the flag for generating multiple files set to false. + * @author Marcelo S. Portugal + */ + +import { generateTemplate } from './template-generator'; + +export = function (results: any) { + return generateTemplate(results, false); +}; diff --git a/packages/eslint-plugin-fiori-tools/src/reporter/helpers/scripts.html b/packages/eslint-plugin-fiori-tools/src/reporter/helpers/scripts.html new file mode 100644 index 00000000000..a005b9d0997 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/src/reporter/helpers/scripts.html @@ -0,0 +1,91 @@ + \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/src/reporter/helpers/styles.html b/packages/eslint-plugin-fiori-tools/src/reporter/helpers/styles.html new file mode 100644 index 00000000000..0784fa0d79d --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/src/reporter/helpers/styles.html @@ -0,0 +1,345 @@ + \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/src/reporter/template-generator.ts b/packages/eslint-plugin-fiori-tools/src/reporter/template-generator.ts new file mode 100644 index 00000000000..03192dc1515 --- /dev/null +++ b/packages/eslint-plugin-fiori-tools/src/reporter/template-generator.ts @@ -0,0 +1,425 @@ +/** + * @file Template generator will create the full HTML template for the reporter based on the results and options passed in. + * The code in this file is based on the code written by Julian Laval for eslint's default reporter + * and inspired by Sven Piller's eslint-formatter-markdown + * @author Marcelo S. Portugal + */ + +const _ = require('lodash'), + fs = require('fs'), + path = require('path'); + +//------------------------------------------------------------------------------ +// Helpers +//------------------------------------------------------------------------------ + +const styles = _.template(fs.readFileSync(path.join(__dirname, 'helpers/styles.html'), 'utf-8')), + scripts = _.template(fs.readFileSync(path.join(__dirname, 'helpers/scripts.html'), 'utf-8')), + pageTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/main-page.html'), 'utf-8')), + resultTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/details/result.html'), 'utf-8')), + resultDetailsTemplate = _.template( + fs.readFileSync(path.join(__dirname, 'templates/details/details.html'), 'utf-8') + ), + resultSummaryTemplate = _.template( + fs.readFileSync(path.join(__dirname, 'templates/details/summary.html'), 'utf-8') + ), + codeWrapperTemplate = _.template( + fs.readFileSync(path.join(__dirname, 'templates/details/code/code-wrapper.html'), 'utf-8') + ), + codeTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/details/code/code.html'), 'utf-8')), + issueTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/details/code/issue.html'), 'utf-8')), + summaryDetailsTemplate = _.template( + fs.readFileSync(path.join(__dirname, 'templates/summary/summary-details.html'), 'utf-8') + ), + rulesTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/summary/rules.html'), 'utf-8')), + mostProblemsTemplate = _.template( + fs.readFileSync(path.join(__dirname, 'templates/summary/most-problems.html'), 'utf-8') + ), + filesTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/summary/files.html'), 'utf-8')); + +/** + * Given a word and a count, append an s if count is not one. + * + * @param {string} word A word in its singular form. + * @param {int} count A number controlling whether word should be pluralized. + * @returns {string} The original word with an s on the end if count is not one. + */ +function pluralize(word, count) { + return count === 1 ? word : `${word}s`; +} + +/** + * Renders text along the template of x problems (x errors, x warnings) + * + * @param {int} totalErrors Total errors + * @param {int} totalWarnings Total warnings + * @returns {string} The formatted string, pluralized where necessary + */ +function renderSummary(totalErrors, totalWarnings) { + const totalProblems = totalErrors + totalWarnings; + let renderedText = `${totalProblems} ${pluralize('problem', totalProblems)}`; + + if (totalProblems !== 0) { + renderedText += ` (${totalErrors} ${pluralize('error', totalErrors)}, ${totalWarnings} ${pluralize('warning', totalWarnings)})`; + } + return renderedText; +} + +/** + * Takes in a rule Id and returns the correct link for the description + * + * @param {string} ruleId A eslint rule Id + * @returns {string} The link to the rules description + */ +function getRuleLink(ruleId) { + let ruleLink = `http://eslint.org/docs/rules/${ruleId}`; + + if (_.startsWith(ruleId, 'angular')) { + ruleId = ruleId.replace('angular/', ''); + ruleLink = `https://github.com/Gillespie59/eslint-plugin-angular/blob/master/docs/${ruleId}.md`; + } else if (_.startsWith(ruleId, 'lodash')) { + ruleId = ruleId.replace('lodash/', ''); + ruleLink = `https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/${ruleId}.md`; + } else if (_.startsWith(ruleId, 'sap')) { + ruleId = ruleId.replace('fiori-custom/', ''); + ruleId = ruleId.replace('fiori-tools/', ''); + ruleLink = `https://github.com/SAP/open-ux-tools/tree/main/packages/eslint-plugin-fiori-tools/docs/rules/${ruleId}.md`; + } + return ruleLink; +} + +/** + * Generates the summary details section by only including the necessary tables. + * + * @param {object} rules An object with all of the rules sorted by type + * @param {Array} [problemFiles] An optional object with the top 5 worst files being linted + * @param {string} currDir Current working directory + * @returns {string} HTML string of all the summary detail tables that are needed + */ +function renderSummaryDetails(rules, problemFiles, currDir) { + let summaryDetails = '
'; + + // errors exist + if (rules['2']) { + summaryDetails += summaryDetailsTemplate({ + ruleType: 'error', + topRules: renderRules(rules['2']) + }); + } + + // warnings exist + if (rules['1']) { + summaryDetails += summaryDetailsTemplate({ + ruleType: 'warning', + topRules: renderRules(rules['1']) + }); + } + + summaryDetails += '
'; + + // files with problems exist + if (!_.isEmpty(problemFiles)) { + summaryDetails += mostProblemsTemplate({ + files: renderProblemFiles(problemFiles, currDir) + }); + } + + return summaryDetails; +} + +/** + * Get the color based on whether there are errors/warnings... + * + * @param {int} totalErrors Total errors + * @param {int} totalWarnings Total warnings + * @returns {string} The color code (success = green, warning = yellow, error = red) + */ +function renderColor(totalErrors, totalWarnings) { + if (totalErrors !== 0) { + return severityString(2); + } else if (totalWarnings !== 0) { + return severityString(1); + } + return severityString(0); +} + +/** + * Converts the severity number to a string + * + * @param {int} severity severity number + * @returns {string} The color string based on severity number (0 = success, 1 = warning, 2 = error) + */ +function severityString(severity) { + const colors = ['success', 'warning', 'error']; + + return colors[severity]; +} + +/** + * Renders an issue + * + * @param {object} message a message object with an issue + * @returns {string} HTML string of an issue + */ +function renderIssue(message) { + return issueTemplate({ + severity: severityString(message.severity), + severityName: message.severity === 1 ? 'Warning' : 'Error', + lineNumber: message.line, + column: message.column, + message: message.message, + ruleId: message.ruleId, + ruleLink: getRuleLink(message.ruleId) + }); +} + +/** + * Renders the source code for the files that have issues and marks the lines that have problems + * + * @param {string} sourceCode source code string + * @param {Array} messages array of messages with the problems in a file + * @param {int} parentIndex file index + * @returns {string} HTML string of the code file that is being linted + */ +function renderSourceCode(sourceCode, messages, parentIndex) { + return codeWrapperTemplate({ + parentIndex, + sourceCode: _.map(sourceCode.split('\n'), function (code, lineNumber) { + const lineMessages = _.filter(messages, { line: lineNumber + 1 }), + severity = _.get(lineMessages[0], 'severity') || 0; + + let template = ''; + + // checks if there is a problem on the current line and renders it + if (!_.isEmpty(lineMessages)) { + template += _.map(lineMessages, renderIssue).join(''); + } + + // adds a line of code to the template (with line number and severity color if appropriate + template += codeTemplate({ + lineNumber: lineNumber + 1, + code, + severity: severityString(severity) + }); + + return template; + }).join('\n') + }); +} + +/** + * Renders the result details with tabs for source code and a summary + * + * @param {string} sourceCode source code string + * @param {Array} messages array of messages with the problems in a file + * @param {int} parentIndex file index + * @returns {string} HTML string of result details + */ +function renderResultDetails(sourceCode, messages, parentIndex) { + const topIssues = messages.length < 10 ? '' : _.groupBy(messages, 'severity'); + + return resultDetailsTemplate({ + parentIndex, + sourceCode: renderSourceCode(sourceCode, messages, parentIndex), + detailSummary: resultSummaryTemplate({ + topIssues: typeof topIssues === 'string' ? '' : renderSummaryDetails(topIssues, [], ''), + issues: _.map(messages, renderIssue).join('') + }) + }); +} + +/** + * Formats the source code before adding it to the HTML + * + * @param {string} sourceCode Source code string + * @returns {string} Source code string which will not cause issues in the HTML + */ +function formatSourceCode(sourceCode) { + return sourceCode.replace(//g, '>'); +} + +/** + * Creates the test results HTML + * + * @param {Array} results Test results. + * @param {string} currDir Current working directory + * @returns {string} HTML string describing the results. + */ +function renderResults(results, currDir) { + return _.map(results, function (result, index) { + let template = resultTemplate({ + index, + fileId: _.camelCase(result.filePath), + filePath: result.filePath.replace(currDir, ''), + color: renderColor(result.errorCount, result.warningCount), + summary: renderSummary(result.errorCount, result.warningCount), + problemCount: result.errorCount + result.warningCount + }); + + // only renders the source code if there are issues present in the file + if (!_.isEmpty(result.messages)) { + // reads the file to get the source code if the source is not provided + const sourceCode = formatSourceCode(result.source || fs.readFileSync(result.filePath, 'utf8')); + + template += renderResultDetails(sourceCode, result.messages, index); + } + + return template; + }).join('\n'); +} + +/** + * @param {Array} rules Test rules. + * @returns {string} HTML string describing the rules. + */ +function renderRules(rules) { + return _(rules) + .groupBy('ruleId') + .map(function (ruleMessages, ruleId) { + return { + ruleId, + ruleCount: _.size(ruleMessages), + ruleLink: getRuleLink(ruleId) + }; + }) + .orderBy(['ruleCount'], ['desc']) + .map(rulesTemplate) + .value() + .join('\n'); +} + +/** + * Renders list of problem files + * + * @param {Array} files + * @param {string} currDir Current working directory + * @returns {string} HTML string describing the files. + */ +function renderProblemFiles(files, currDir) { + return _.map(files, function (fileDetails) { + return filesTemplate({ + fileId: _.camelCase(fileDetails.filePath), + filePath: fileDetails.filePath.replace(currDir, ''), + errorCount: fileDetails.errorCount, + warningCount: fileDetails.warningCount + }); + }).join('\n'); +} + +/** + * Writes a file at the specified location and removes the specified strings + * + * @param {string} filePath The path of the new file + * @param {string} fileContent The contents of the new file + * @param {RegExp} regex A regex with strings to be removed from the fileContent + * @returns {void} n/a + */ +function writeFile(filePath, fileContent, regex) { + fs.writeFileSync(filePath, fileContent.replace(regex, '')); +} + +/** + * Returns the output directory for the report + * + * @returns {string} the output directory for the report + */ +function getOutputDir() { + const outputOptionIdx = + process.argv.indexOf('-o') !== -1 ? process.argv.indexOf('-o') : process.argv.indexOf('--output-file'), + argsLength = process.argv.length, + outputDirOption = '--outputDirectory='; + + if (process.argv[1].includes('grunt')) { + for (let i = 2; i < argsLength; i++) { + if (process.argv[i].includes(outputDirOption)) { + return `/${process.argv[i].replace(outputDirOption, '')}`; + } + } + return '/reports/'; // defaults to a reports folder if nothing else is found + } else if (outputOptionIdx !== -1) { + return `/${process.argv[outputOptionIdx + 1].split('/')[0]}/`; + } + + return ''; +} + +/** + * Returns the full path to the report + * + * @param currWorkingDir + * @returns {string} the full path to the report + */ +function getOutputPath(currWorkingDir) { + return currWorkingDir + getOutputDir(); +} + +/** + * Creates a styles.css and a main.js file for the report + * + * @param {string} outputPath The output path for the report + * @returns {void} n/a + */ +function buildScriptsAndStyleFiles(outputPath) { + const stylesRegex = / \ No newline at end of file diff --git a/packages/eslint-plugin-fiori-tools/src/reporter/template-generator.ts b/packages/eslint-plugin-fiori-tools/src/reporter/template-generator.ts deleted file mode 100644 index 20fc20d2d8d..00000000000 --- a/packages/eslint-plugin-fiori-tools/src/reporter/template-generator.ts +++ /dev/null @@ -1,432 +0,0 @@ -/** - * @file Template generator will create the full HTML template for the reporter based on the results and options passed in. - * The code in this file is based on the code written by Julian Laval for eslint's default reporter - * and inspired by Sven Piller's eslint-formatter-markdown - * @author Marcelo S. Portugal - */ - -const _ = require('lodash'), - fs = require('fs'), - path = require('path'); - -//------------------------------------------------------------------------------ -// Helpers -//------------------------------------------------------------------------------ - -const styles = _.template(fs.readFileSync(path.join(__dirname, 'helpers/styles.html'), 'utf-8')), - scripts = _.template(fs.readFileSync(path.join(__dirname, 'helpers/scripts.html'), 'utf-8')), - pageTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/main-page.html'), 'utf-8')), - resultTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/details/result.html'), 'utf-8')), - resultDetailsTemplate = _.template( - fs.readFileSync(path.join(__dirname, 'templates/details/details.html'), 'utf-8') - ), - resultSummaryTemplate = _.template( - fs.readFileSync(path.join(__dirname, 'templates/details/summary.html'), 'utf-8') - ), - codeWrapperTemplate = _.template( - fs.readFileSync(path.join(__dirname, 'templates/details/code/code-wrapper.html'), 'utf-8') - ), - codeTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/details/code/code.html'), 'utf-8')), - issueTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/details/code/issue.html'), 'utf-8')), - summaryDetailsTemplate = _.template( - fs.readFileSync(path.join(__dirname, 'templates/summary/summary-details.html'), 'utf-8') - ), - rulesTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/summary/rules.html'), 'utf-8')), - mostProblemsTemplate = _.template( - fs.readFileSync(path.join(__dirname, 'templates/summary/most-problems.html'), 'utf-8') - ), - filesTemplate = _.template(fs.readFileSync(path.join(__dirname, 'templates/summary/files.html'), 'utf-8')); - -/** - * Given a word and a count, append an s if count is not one. - * - * @param {string} word A word in its singular form. - * @param {number} count A number controlling whether word should be pluralized. - * @returns {string} The original word with an s on the end if count is not one. - */ -function pluralize(word, count) { - return count === 1 ? word : `${word}s`; -} - -/** - * Renders text along the template of x problems (x errors, x warnings). - * - * @param {number} totalErrors Total errors - * @param {number} totalWarnings Total warnings - * @returns {string} The formatted string, pluralized where necessary - */ -function renderSummary(totalErrors, totalWarnings) { - const totalProblems = totalErrors + totalWarnings; - let renderedText = `${totalProblems} ${pluralize('problem', totalProblems)}`; - - if (totalProblems !== 0) { - renderedText += ` (${totalErrors} ${pluralize('error', totalErrors)}, ${totalWarnings} ${pluralize('warning', totalWarnings)})`; - } - return renderedText; -} - -/** - * Takes in a rule Id and returns the correct link for the description. - * - * @param {string} ruleId A eslint rule Id - * @returns {string} The link to the rules description - */ -function getRuleLink(ruleId) { - let ruleLink = `http://eslint.org/docs/rules/${ruleId}`; - - if (_.startsWith(ruleId, 'angular')) { - ruleId = ruleId.replace('angular/', ''); - ruleLink = `https://github.com/Gillespie59/eslint-plugin-angular/blob/master/docs/${ruleId}.md`; - } else if (_.startsWith(ruleId, 'lodash')) { - ruleId = ruleId.replace('lodash/', ''); - ruleLink = `https://github.com/wix/eslint-plugin-lodash/blob/master/docs/rules/${ruleId}.md`; - } else if (_.startsWith(ruleId, 'sap')) { - ruleId = ruleId.replace('fiori-custom/', ''); - ruleId = ruleId.replace('fiori-tools/', ''); - ruleLink = `https://github.com/SAP/open-ux-tools/tree/main/packages/eslint-plugin-fiori-tools/docs/rules/${ruleId}.md`; - } - return ruleLink; -} - -/** - * Generates the summary details section by only including the necessary tables. - * - * @param {object} rules An object with all of the rules sorted by type - * @param {Array} [problemFiles] An optional object with the top 5 worst files being linted - * @param {string} currDir Current working directory - * @returns {string} HTML string of all the summary detail tables that are needed - */ -function renderSummaryDetails(rules, problemFiles, currDir) { - let summaryDetails = '
'; - - // errors exist - if (rules['2']) { - summaryDetails += summaryDetailsTemplate({ - ruleType: 'error', - topRules: renderRules(rules['2']) - }); - } - - // warnings exist - if (rules['1']) { - summaryDetails += summaryDetailsTemplate({ - ruleType: 'warning', - topRules: renderRules(rules['1']) - }); - } - - summaryDetails += '
'; - - // files with problems exist - if (!_.isEmpty(problemFiles)) { - summaryDetails += mostProblemsTemplate({ - files: renderProblemFiles(problemFiles, currDir) - }); - } - - return summaryDetails; -} - -/** - * Get the color based on whether there are errors/warnings... - * - * @param {number} totalErrors Total errors - * @param {number} totalWarnings Total warnings - * @returns {string} The color code (success = green, warning = yellow, error = red) - */ -function renderColor(totalErrors, totalWarnings) { - if (totalErrors !== 0) { - return severityString(2); - } else if (totalWarnings !== 0) { - return severityString(1); - } - return severityString(0); -} - -/** - * Converts the severity number to a string. - * - * @param {number} severity severity number - * @returns {string} The color string based on severity number (0 = success, 1 = warning, 2 = error) - */ -function severityString(severity) { - const colors = ['success', 'warning', 'error']; - - return colors[severity]; -} - -/** - * Renders an issue. - * - * @param {object} message a message object with an issue - * @returns {string} HTML string of an issue - */ -function renderIssue(message) { - return issueTemplate({ - severity: severityString(message.severity), - severityName: message.severity === 1 ? 'Warning' : 'Error', - lineNumber: message.line, - column: message.column, - message: message.message, - ruleId: message.ruleId, - ruleLink: getRuleLink(message.ruleId) - }); -} - -/** - * Renders the source code for the files that have issues and marks the lines that have problems. - * - * @param {string} sourceCode source code string - * @param {Array} messages array of messages with the problems in a file - * @param {number} parentIndex file index - * @returns {string} HTML string of the code file that is being linted - */ -function renderSourceCode(sourceCode, messages, parentIndex) { - return codeWrapperTemplate({ - parentIndex, - sourceCode: _.map(sourceCode.split('\n'), function (code, lineNumber) { - const lineMessages = _.filter(messages, { line: lineNumber + 1 }), - severity = _.get(lineMessages[0], 'severity') || 0; - - let template = ''; - - // checks if there is a problem on the current line and renders it - if (!_.isEmpty(lineMessages)) { - template += _.map(lineMessages, renderIssue).join(''); - } - - // adds a line of code to the template (with line number and severity color if appropriate - template += codeTemplate({ - lineNumber: lineNumber + 1, - code, - severity: severityString(severity) - }); - - return template; - }).join('\n') - }); -} - -/** - * Renders the result details with tabs for source code and a summary. - * - * @param {string} sourceCode source code string - * @param {Array} messages array of messages with the problems in a file - * @param {number} parentIndex file index - * @returns {string} HTML string of result details - */ -function renderResultDetails(sourceCode, messages, parentIndex) { - const topIssues = messages.length < 10 ? '' : _.groupBy(messages, 'severity'); - - return resultDetailsTemplate({ - parentIndex, - sourceCode: renderSourceCode(sourceCode, messages, parentIndex), - detailSummary: resultSummaryTemplate({ - topIssues: typeof topIssues === 'string' ? '' : renderSummaryDetails(topIssues, [], ''), - issues: _.map(messages, renderIssue).join('') - }) - }); -} - -/** - * Formats the source code before adding it to the HTML. - * - * @param {string} sourceCode Source code string - * @returns {string} Source code string which will not cause issues in the HTML - */ -function formatSourceCode(sourceCode) { - return sourceCode.replace(//g, '>'); -} - -/** - * Creates the test results HTML. - * - * @param {Array} results Test results. - * @param {string} currDir Current working directory - * @returns {string} HTML string describing the results. - */ -function renderResults(results, currDir) { - return _.map(results, function (result, index) { - let template = resultTemplate({ - index, - fileId: _.camelCase(result.filePath), - filePath: result.filePath.replace(currDir, ''), - color: renderColor(result.errorCount, result.warningCount), - summary: renderSummary(result.errorCount, result.warningCount), - problemCount: result.errorCount + result.warningCount - }); - - // only renders the source code if there are issues present in the file - if (!_.isEmpty(result.messages)) { - // reads the file to get the source code if the source is not provided - const sourceCode = formatSourceCode(result.source || fs.readFileSync(result.filePath, 'utf8')); - - template += renderResultDetails(sourceCode, result.messages, index); - } - - return template; - }).join('\n'); -} - -/** - * @param {Array} rules Test rules. - * @returns {string} HTML string describing the rules. - */ -function renderRules(rules) { - return _(rules) - .groupBy('ruleId') - .map(function (ruleMessages, ruleId) { - return { - ruleId, - ruleCount: _.size(ruleMessages), - ruleLink: getRuleLink(ruleId) - }; - }) - .orderBy(['ruleCount'], ['desc']) - .map(rulesTemplate) - .value() - .join('\n'); -} - -/** - * Renders list of problem files. - * - * @param {Array} files List of files with problems - * @param {string} currDir Current working directory - * @returns {string} HTML string describing the files. - */ -function renderProblemFiles(files, currDir) { - return _.map(files, function (fileDetails) { - return filesTemplate({ - fileId: _.camelCase(fileDetails.filePath), - filePath: fileDetails.filePath.replace(currDir, ''), - errorCount: fileDetails.errorCount, - warningCount: fileDetails.warningCount - }); - }).join('\n'); -} - -/** - * Writes a file at the specified location and removes the specified strings. - * - * @param {string} filePath The path of the new file - * @param {string} fileContent The contents of the new file - * @param {RegExp} regex A regex with strings to be removed from the fileContent - * @returns {void} n/a - */ -function writeFile(filePath, fileContent, regex) { - fs.writeFileSync(filePath, fileContent.replace(regex, '')); -} - -/** - * Returns the output directory for the report. - * - * @returns {string} the output directory for the report - */ -function getOutputDir() { - const outputOptionIdx = - process.argv.indexOf('-o') !== -1 ? process.argv.indexOf('-o') : process.argv.indexOf('--output-file'), - argsLength = process.argv.length, - outputDirOption = '--outputDirectory='; - - if (process.argv[1].includes('grunt')) { - for (let i = 2; i < argsLength; i++) { - if (process.argv[i].includes(outputDirOption)) { - return `/${process.argv[i].replace(outputDirOption, '')}`; - } - } - return '/reports/'; // defaults to a reports folder if nothing else is found - } else if (outputOptionIdx !== -1) { - return `/${process.argv[outputOptionIdx + 1].split('/')[0]}/`; - } - - return ''; -} - -/** - * Returns the full path to the report. - * - * @param {string} currWorkingDir Current working directory - * @returns {string} the full path to the report - */ -function getOutputPath(currWorkingDir) { - return currWorkingDir + getOutputDir(); -} - -/** - * Creates a styles.css and a main.js file for the report. - * - * @param {string} outputPath The output path for the report - * @returns {void} n/a - */ -function buildScriptsAndStyleFiles(outputPath) { - const stylesRegex = /