${this.selectedText}
` : nothing}diff --git a/cast/src/receiver/layout/hc-lovelace.ts b/cast/src/receiver/layout/hc-lovelace.ts index 7591f55121d2..87cc165d9774 100644 --- a/cast/src/receiver/layout/hc-lovelace.ts +++ b/cast/src/receiver/layout/hc-lovelace.ts @@ -25,9 +25,9 @@ class HcLovelace extends LitElement { @property({ attribute: false }) public lovelaceConfig!: LovelaceConfig; - @property() public viewPath?: string | number | null; + @property({ attribute: false }) public viewPath?: string | number | null; - @property() public urlPath: string | null = null; + @property({ attribute: false }) public urlPath: string | null = null; protected render(): TemplateResult { const index = this._viewIndex; diff --git a/cast/src/receiver/layout/hc-main.ts b/cast/src/receiver/layout/hc-main.ts index cd7c81fa334a..958d94ccccf7 100644 --- a/cast/src/receiver/layout/hc-main.ts +++ b/cast/src/receiver/layout/hc-main.ts @@ -144,10 +144,10 @@ export class HcMain extends HassElement { } if (senderId) { - this.sendMessage(senderId, status); + this._sendMessage(senderId, status); } else { for (const sender of castContext.getSenders()) { - this.sendMessage(sender.id, status); + this._sendMessage(sender.id, status); } } } @@ -164,10 +164,10 @@ export class HcMain extends HassElement { }; if (senderId) { - this.sendMessage(senderId, error); + this._sendMessage(senderId, error); } else { for (const sender of castContext.getSenders()) { - this.sendMessage(sender.id, error); + this._sendMessage(sender.id, error); } } } @@ -394,7 +394,7 @@ export class HcMain extends HassElement { } } - private sendMessage(senderId: string, response: any) { + private _sendMessage(senderId: string, response: any) { castContext.sendCustomMessage(CAST_NS, senderId, response); } } diff --git a/eslint.config.mjs b/eslint.config.mjs index 4bc8a57fc3c4..34169498b060 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -7,10 +7,10 @@ import { fileURLToPath } from "node:url"; import js from "@eslint/js"; import { FlatCompat } from "@eslint/eslintrc"; -const __filename = fileURLToPath(import.meta.url); -const __dirname = path.dirname(__filename); +const _filename = fileURLToPath(import.meta.url); +const _dirname = path.dirname(_filename); const compat = new FlatCompat({ - baseDirectory: __dirname, + baseDirectory: _dirname, recommendedConfig: js.configs.recommended, allConfig: js.configs.all, }); @@ -115,12 +115,21 @@ export default [ "@typescript-eslint/naming-convention": [ "warn", + { + selector: ["objectLiteralProperty", "objectLiteralMethod"], + format: null, + }, { selector: ["variable"], format: ["camelCase", "snake_case", "UPPER_CASE"], leadingUnderscore: "allow", trailingUnderscore: "allow", }, + { + selector: ["variable"], + modifiers: ["exported"], + format: ["camelCase", "PascalCase", "UPPER_CASE"], + }, { selector: "typeLike", format: ["PascalCase"], diff --git a/gallery/src/components/demo-black-white-row.ts b/gallery/src/components/demo-black-white-row.ts index d043136abba7..fd4fef13f6b1 100644 --- a/gallery/src/components/demo-black-white-row.ts +++ b/gallery/src/components/demo-black-white-row.ts @@ -9,6 +9,7 @@ import "../../../src/components/ha-card"; @customElement("demo-black-white-row") class DemoBlackWhiteRow extends LitElement { + // eslint-disable-next-line lit/no-native-attributes @property() title!: string; @property() value?: any; diff --git a/gallery/src/components/demo-card.ts b/gallery/src/components/demo-card.ts index 968b7cb273e4..50234d11515f 100644 --- a/gallery/src/components/demo-card.ts +++ b/gallery/src/components/demo-card.ts @@ -18,7 +18,7 @@ class DemoCard extends LitElement { @property({ attribute: false }) public config!: DemoCardConfig; - @property({ type: Boolean }) public showConfig = false; + @property({ attribute: false, type: Boolean }) public showConfig = false; @state() private _size?: number; diff --git a/gallery/src/components/demo-cards.ts b/gallery/src/components/demo-cards.ts index 5571e1c09f25..655b38a68a32 100644 --- a/gallery/src/components/demo-cards.ts +++ b/gallery/src/components/demo-cards.ts @@ -44,11 +44,11 @@ class DemoCards extends LitElement { `; } - _showConfigToggled(ev) { + private _showConfigToggled(ev) { this._showConfig = ev.target.checked; } - _darkThemeToggled(ev) { + private _darkThemeToggled(ev) { applyThemesOnElement(this._container, { themes: {} } as any, "default", { dark: ev.target.checked, }); diff --git a/gallery/src/components/demo-more-info.ts b/gallery/src/components/demo-more-info.ts index c1dd5d091eb8..fb0ab5ff5e63 100644 --- a/gallery/src/components/demo-more-info.ts +++ b/gallery/src/components/demo-more-info.ts @@ -10,9 +10,9 @@ import type { HomeAssistant } from "../../../src/types"; class DemoMoreInfo extends LitElement { @property({ attribute: false }) public hass!: HomeAssistant; - @property() public entityId!: string; + @property({ attribute: false }) public entityId!: string; - @property({ type: Boolean }) public showConfig = false; + @property({ attribute: false, type: Boolean }) public showConfig = false; render() { const state = this._getState(this.entityId, this.hass.states); diff --git a/gallery/src/components/demo-more-infos.ts b/gallery/src/components/demo-more-infos.ts index 19f16cf8cf82..a6191040a667 100644 --- a/gallery/src/components/demo-more-infos.ts +++ b/gallery/src/components/demo-more-infos.ts @@ -58,11 +58,11 @@ class DemoMoreInfos extends LitElement { } `; - _showConfigToggled(ev) { + private _showConfigToggled(ev) { this._showConfig = ev.target.checked; } - _darkThemeToggled(ev) { + private _darkThemeToggled(ev) { applyThemesOnElement( this.shadowRoot!.querySelector("#container"), { diff --git a/gallery/src/ha-gallery.ts b/gallery/src/ha-gallery.ts index 1f079497a059..d1043815a220 100644 --- a/gallery/src/ha-gallery.ts +++ b/gallery/src/ha-gallery.ts @@ -182,7 +182,7 @@ class HaGallery extends LitElement { } } - _menuTapped() { + private _menuTapped() { this._drawer.open = !this._drawer.open; } diff --git a/gallery/src/pages/automation/editor-action.ts b/gallery/src/pages/automation/editor-action.ts index 6d07e7f4438e..cf40c4ce7c74 100644 --- a/gallery/src/pages/automation/editor-action.ts +++ b/gallery/src/pages/automation/editor-action.ts @@ -63,11 +63,6 @@ class DemoHaAutomationEditorAction extends LitElement { } protected render(): TemplateResult { - const valueChanged = (ev) => { - const sampleIdx = ev.target.sampleIdx; - this.data[sampleIdx] = ev.detail.value; - this.requestUpdate(); - }; return html`
${this.selectedText}
` : nothing}${this.localize("ui.panel.page-onboarding.analytics.intro")}
diff --git a/src/onboarding/onboarding-welcome-link.ts b/src/onboarding/onboarding-welcome-link.ts
index 25c605bb7fcd..a6397d280f09 100644
--- a/src/onboarding/onboarding-welcome-link.ts
+++ b/src/onboarding/onboarding-welcome-link.ts
@@ -9,7 +9,7 @@ import "../components/ha-svg-icon";
class OnboardingWelcomeLink extends LitElement {
@property() public label!: string;
- @property() public iconPath!: string;
+ @property({ attribute: false }) public iconPath!: string;
@property({ type: Boolean }) public noninteractive = false;
diff --git a/src/onboarding/onboarding-welcome-links.ts b/src/onboarding/onboarding-welcome-links.ts
index 95183d8839ac..0682469baf94 100644
--- a/src/onboarding/onboarding-welcome-links.ts
+++ b/src/onboarding/onboarding-welcome-links.ts
@@ -15,7 +15,7 @@ class OnboardingWelcomeLinks extends LitElement {
@property({ attribute: false }) public localize!: LocalizeFunc