Skip to content

Conversation

@iOvergaard
Copy link
Contributor

@iOvergaard iOvergaard commented Aug 7, 2025

Description

Tries to mimic the existing code base whilst fixing a few inconsistencies to make sure we have correct naming, and most importantly, that we do not expose properties that are supposed to be private (i.e., leading underscore).

This also removes the need for a few of the "local rules" as this plugin now handles them: import/naming-conventions.

Fixes AB#52379

Classes/interfaces

// 🔴  NOT OK
export class SomeClass {}

// ✅ OK
export class UmbSomeClass {}
export class UfmSomeClass {}
export interface ManifestSomeType {}
export interface MetaElement {}
export class ExampleClass {}

Members of "something", including class methods

// 🔴  NOT OK
private someProperty; // No leading _underscore
public _someProperty; // Leading underscore
#_someMethod() // Leading underscore

// ✅ OK
private _someProperty; // Leading _underscore
protected _someProperty; // (Optional) leading _underscore
public someProperty; // No leading underscore
#someMethod() // No leading underscore

Quoted members

// ✅  STILL OK
declare global {
  interface HTMLElementTagNameMap {
    'umb-some-element': UmbSomeElement
  }
}

Exported constants

// 🔴  NOT OK
export const all_lowercase = 'test'; // Lowercase and no leading UMB_

// ✅ OK
export const UMB_MY_VALUE = 'test'; // UPPER_CASE and leading UMB_

Caveats

  1. Have to ignore all language files due to weird keys
  2. Have to ignore umbraco-package.ts files (also ignored before) due to convention around exports
  3. Have to allow certain prefixes such as "Manifest" and "Meta" because of established convention around the extension API
  4. Have to allow a special property called _host because it is used as a public property in all controllers (= all over the system which makes it massively breaking to change.

@github-actions
Copy link

github-actions bot commented Aug 7, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 7, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

1 similar comment
@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

Copy link
Member

@nielslyngsoe nielslyngsoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Beautiful, I've read through and added a few more deprecated proxy types or properties.

Some I have taken the risk of concluding no one would be using or should be using. In general, i would say we are generous with these changes. accommodating various hacks as many of these properties should never have been used by external code. But lets see time will tell.

@nielslyngsoe nielslyngsoe enabled auto-merge (squash) August 8, 2025 08:09
@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://victorious-ground-017b08103-19880.westeurope.6.azurestaticapps.net

@github-actions
Copy link

github-actions bot commented Aug 8, 2025

Azure Static Web Apps: Your stage site is ready! Visit it here: https://orange-sea-0c7411a03-19880.westeurope.6.azurestaticapps.net

@nielslyngsoe nielslyngsoe merged commit 2def046 into main Aug 8, 2025
27 checks passed
@nielslyngsoe nielslyngsoe deleted the v16/chore/eslint-naming-conventions branch August 8, 2025 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category/dx Developer experience ignore-for-release internal preview/backoffice Pull requests that can be previewed in a static version of the Backoffice preview/storybook Pull requests that can be previewed through Storybook

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants