From ba62d20f7119535d60d765460d3f74e7b2f426e1 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Thu, 22 Jun 2023 22:54:46 +0200 Subject: [PATCH] DEV: Update ember-template-lint (#22242) --- .template-lintrc.js | 5 ++ .../discourse/app/components/d-button.hbs | 2 +- .../discourse/app/components/d-modal.hbs | 2 +- .../app/components/d-toggle-switch.hbs | 6 +-- .../app/components/d-toggle-switch.js | 10 ++-- .../discourse/app/components/emoji-picker.hbs | 4 +- .../app/components/group-flair-inputs.hbs | 1 - .../components/horizontal-overflow-nav.hbs | 2 +- .../search-menu/results/assistant-item.hbs | 2 +- .../components/search-menu/results/types.hbs | 2 +- app/assets/javascripts/discourse/package.json | 8 ++-- .../multi-select/multi-select-filter.hbs | 2 +- .../period-chooser/period-chooser-header.hbs | 2 +- .../select-kit/select-kit-filter.hbs | 2 +- .../addon/components/selected-name.hbs | 2 - package.json | 2 +- .../discourse/components/chat-composer.hbs | 2 +- .../components/chat-emoji-picker.hbs | 2 +- yarn.lock | 46 +++++-------------- 19 files changed, 42 insertions(+), 62 deletions(-) diff --git a/.template-lintrc.js b/.template-lintrc.js index 77a11b8f2cb..18ffe7b89b2 100644 --- a/.template-lintrc.js +++ b/.template-lintrc.js @@ -5,6 +5,7 @@ module.exports = { rules: { "no-action-modifiers": true, "no-args-paths": true, + "no-array-prototype-extensions": false, "no-attrs-in-components": true, "no-capital-arguments": false, // TODO: we extensively use `args` argument name "no-curly-component-invocation": { @@ -21,6 +22,10 @@ module.exports = { "no-implicit-this": { allow: ["loading-spinner"], }, + "no-negated-condition": false, + "no-obscure-array-access": false, + "require-mandatory-role-attributes": false, + "require-media-caption": false, // Begin prettier compatibility "eol-last": false, "self-closing-void-elements": false, diff --git a/app/assets/javascripts/discourse/app/components/d-button.hbs b/app/assets/javascripts/discourse/app/components/d-button.hbs index 4719a12dacd..0b9fc386241 100644 --- a/app/assets/javascripts/discourse/app/components/d-button.hbs +++ b/app/assets/javascripts/discourse/app/components/d-button.hbs @@ -1,4 +1,4 @@ -{{! template-lint-disable no-down-event-binding }} +{{! template-lint-disable no-pointer-down-event-binding }} - {{! template-lint-enable no-unnecessary-concat }} + {{! template-lint-enable no-redundant-role }} {{#if @state}} diff --git a/app/assets/javascripts/discourse/app/components/d-toggle-switch.js b/app/assets/javascripts/discourse/app/components/d-toggle-switch.js index 5dcd2cebb30..0bd175dd11d 100644 --- a/app/assets/javascripts/discourse/app/components/d-toggle-switch.js +++ b/app/assets/javascripts/discourse/app/components/d-toggle-switch.js @@ -1,15 +1,15 @@ import Component from "@glimmer/component"; -import { tracked } from "@glimmer/tracking"; import I18n from "I18n"; -export default class DiscourseToggleSwitch extends Component { - @tracked iconEnabled = true; - @tracked showIcon = this.iconEnabled && this.icon; - +export default class DToggleSwitch extends Component { get computedLabel() { if (this.args.label) { return I18n.t(this.args.label); } return this.args.translatedLabel; } + + get checked() { + return this.args.state ? "true" : "false"; + } } diff --git a/app/assets/javascripts/discourse/app/components/emoji-picker.hbs b/app/assets/javascripts/discourse/app/components/emoji-picker.hbs index c2dc26b2f27..12cd404d667 100644 --- a/app/assets/javascripts/discourse/app/components/emoji-picker.hbs +++ b/app/assets/javascripts/discourse/app/components/emoji-picker.hbs @@ -1,10 +1,10 @@ {{#if this.isActive}} - {{! template-lint-disable no-invalid-interactive no-down-event-binding }} + {{! template-lint-disable no-invalid-interactive no-pointer-down-event-binding }}
- {{! template-lint-enable no-invalid-interactive no-down-event-binding }} + {{! template-lint-enable no-invalid-interactive no-pointer-down-event-binding }}
{{#if this.recentEmojis.length}}
diff --git a/app/assets/javascripts/discourse/app/components/horizontal-overflow-nav.hbs b/app/assets/javascripts/discourse/app/components/horizontal-overflow-nav.hbs index eb9e159df6c..43302b0d661 100644 --- a/app/assets/javascripts/discourse/app/components/horizontal-overflow-nav.hbs +++ b/app/assets/javascripts/discourse/app/components/horizontal-overflow-nav.hbs @@ -1,4 +1,4 @@ -{{! template-lint-disable no-down-event-binding }} +{{! template-lint-disable no-pointer-down-event-binding }} {{! template-lint-disable no-invalid-interactive }}