close

Filter

loading table of contents...

CoreMedia Content Cloud v12 Upgrade Guide / Version 2404

Table Of Contents

7.3.3 Changed Linter Rules

The linter rules in all studio-client packages have been updated to a more common rule set. In addition to this the rule set is no longer part of the Jangaroo tooling but of the studio-client workspace.

While it was useful (and even required) for the TypeScript migration that the Jangaroo tooling has brought the corresponding linter rules to result in a mergeable code base, it is now more focused on the actual build process and the resulting runtime environment. This is why the package @jangaroo/eslint-config is no longer available from v3 on.

There are now two rule sets in the studio-client workspace: @coremedia/eslint-config-studio-client and @coremedia/eslint-config-studio-client-ext. The former has strict rules for ExtJS independent TypeScript code while the latter is meant for packages containing ExtJS components which require some exceptions to the strict rules.

All TypeScript code in the studio-client workspace has been updated to apply to the new rule sets.

Upgrade steps:

Before merging the 2404.1 code base make sure to be on 2307.3 / 2401.3 or later. It is assumed that the studio-client workspace builds without any errors.

To prepare the merge, you first of all need to copy the .editorconfig contained in the blueprint workspace of the target version to the root folder of the workspace, overwriting the existing one. This can also be done via git, e.g. with target version 2404.1:

      git checkout cmcc-12-2404.1 -- .editorconfig

If you have made customizations to the .editorconfig, you can keep them at your own risk. Keep in mind that merging code based on different formatting rules can lead to many unnecessary merge conflicts, so it is advised to do at least the following steps with the original .editorconfig from the target version (and restore the customizations afterwards).

Add the following pnpm overrides to your apps/studio-client/package.json. Make sure that the version matches the version of the studio-client workspace you are merging into. For 2404.1 it would be:

Linter overrides:
  "pnpm": {
    "overrides": {
      "@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client-ext@2404.1.0",
      "@coremedia-blueprint/studio-client.blueprint-doctypes>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0",
      "@coremedia-blueprint/studio-client.ecommerce-doctypes>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0",
      "@coremedia-blueprint/studio-client.alx>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0",
      "@coremedia-blueprint/studio-client.alx-google>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0",
      "@coremedia-blueprint/studio-client.am>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0",
      "@coremedia-blueprint/studio-client.catalog>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0",
      "@coremedia-blueprint/studio-client.es>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0",
      "@coremedia-blueprint/studio-client.lc>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0",
      "@coremedia-blueprint/studio-client.p13n>@jangaroo/eslint-config": "npm:@coremedia/eslint-config-studio-client@2404.1.0"
    }
  }

This temporarily replaces the Jangaroo linter rules in all packages with the new studio-client rules coming with the 2404.1 release. While the ExtJS specific rule set is the default, all ExtJS independent packages get the stricter rule set. You do not need to complement this list with your own packages in this step as new packages will not cause any merge conflicts.

In the folder apps/studio-client run pnpm install to apply the overrides.

After the installation was successful, run pnpm -r --no-bail run lint in the same folder to fix all automatically fixable linter errors.

Revert the changes made to the apps/studio-client/package.json and also restore the apps/studio-client/pnpm-lock.yaml.

Check in all code changes.

Ignore-merge the original, but already reformatted state of the version you are coming from. You can find a corresponding tag with the suffix "-converted" in the CoreMedia Blueprint Workspace. E.g. if you come from 2401.3 there is a tag cmcc-12-2401.3-converted which can be ignore-merged using the following command: git merge -s ours cmcc-12-2401.3-converted

Merge the target version (e.g. cmcc-12-2404.1) into your vendor branch.

Perform all third-party upgrades as described in the Section 7.3.2, “Sencha Cmd Removal” section.

Replace the "devDependency" @jangaroo/eslint-config with the corresponding @coremedia/eslint-config-studio-client or @coremedia/eslint-config-studio-client-ext configuration in the package.json of all your additional packages.

Remove the "--fix" option from the lint script in the package.json files of all your additional packages.

Adjust the .eslintrc.js files (if present) in all packages accordingly to match the utilized rule set.

Run pnpm install in all packages to apply the changes and check in the updated apps/studio-client/pnpm-lock.yaml.

Run pnpm -r --no-bail run lint --fix (mind the newly added "--fix") in all packages to fix all automatically fixable linter errors.

(optionally) Check the linting results of the previous run and fix the remaining errors manually that could not be automatically fixed by the linter.

Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.