From c74323869f806ffaa60b78edc929bae6de9b1203 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 20 Nov 2024 14:46:07 +0000 Subject: [PATCH] DEV: Update linting (#184) --- .../discourse/components/docs-topic.js | 4 +- .../templates/components/docs-category.hbs | 8 +- .../templates/components/docs-search.hbs | 4 +- .../templates/components/docs-tag.hbs | 11 +- .../templates/components/docs-topic-list.hbs | 18 +- .../templates/components/docs-topic.hbs | 8 +- .../discourse/templates/docs-index.hbs | 105 ++-- .../javascripts/discourse/templates/docs.hbs | 6 +- package.json | 2 +- pnpm-lock.yaml | 497 +++++++++--------- 10 files changed, 326 insertions(+), 337 deletions(-) diff --git a/assets/javascripts/discourse/components/docs-topic.js b/assets/javascripts/discourse/components/docs-topic.js index 5954e7f..edecbae 100644 --- a/assets/javascripts/discourse/components/docs-topic.js +++ b/assets/javascripts/discourse/components/docs-topic.js @@ -37,14 +37,14 @@ export default Component.extend({ didInsertElement() { this._super(...arguments); - document.querySelector("body").classList.add("archetype-docs-topic"); + document.body.classList.add("archetype-docs-topic"); document.addEventListener("scroll", this.debounceScrollEvent); }, willDestroyElement() { this._super(...arguments); - document.querySelector("body").classList.remove("archetype-docs-topic"); + document.body.classList.remove("archetype-docs-topic"); document.removeEventListener("scroll", this.debounceScrollEvent); }, }); diff --git a/assets/javascripts/discourse/templates/components/docs-category.hbs b/assets/javascripts/discourse/templates/components/docs-category.hbs index 4f5c3b9..812b3d5 100644 --- a/assets/javascripts/discourse/templates/components/docs-category.hbs +++ b/assets/javascripts/discourse/templates/components/docs-category.hbs @@ -1,10 +1,10 @@ - {{d-icon (if category.active "times-circle" "far-circle")}} + {{d-icon (if this.category.active "times-circle" "far-circle")}} - {{categoryName}} - {{category.count}} + {{this.categoryName}} + {{this.category.count}} \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/docs-search.hbs b/assets/javascripts/discourse/templates/components/docs-search.hbs index 6b88549..14c9063 100644 --- a/assets/javascripts/discourse/templates/components/docs-search.hbs +++ b/assets/javascripts/discourse/templates/components/docs-search.hbs @@ -1,7 +1,7 @@ - {{#if searchTerm}} + {{#if this.searchTerm}} - {{#unless tag.active}} + {{#unless this.tag.active}} {{d-icon "plus"}} {{/unless}} - {{#if tag.active}} + {{#if this.tag.active}} {{d-icon "times-circle"}} {{/if}} - {{tag.id}} - {{tag.count}} + {{this.tag.id}} + {{this.tag.count}} \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/docs-topic-list.hbs b/assets/javascripts/discourse/templates/components/docs-topic-list.hbs index 0945f3f..cd28b4d 100644 --- a/assets/javascripts/discourse/templates/components/docs-topic-list.hbs +++ b/assets/javascripts/discourse/templates/components/docs-topic-list.hbs @@ -1,11 +1,11 @@ - + - {{#each topics as |topic|}} + {{#each this.topics as |topic|}} {{docs-topic-list-item topic=topic - urlPath=urlPath - showExcerpt=showExcerpts + urlPath=this.urlPath + showExcerpt=this.showExcerpts }} {{/each}}
{{i18n "docs.column_titles.topic"}} - {{#if sortTitle}} - {{#if ascending}} + {{#if this.sortTitle}} + {{#if this.ascending}} {{d-icon "angle-up"}} {{else}} {{d-icon "angle-down"}} @@ -16,8 +16,8 @@ {{i18n "docs.column_titles.activity"}} - {{#if sortActivity}} - {{#if ascending}} + {{#if this.sortActivity}} + {{#if this.ascending}} {{d-icon "angle-up"}} {{else}} {{d-icon "angle-down"}} @@ -27,15 +27,15 @@
- \ No newline at end of file + \ No newline at end of file diff --git a/assets/javascripts/discourse/templates/components/docs-topic.hbs b/assets/javascripts/discourse/templates/components/docs-topic.hbs index 1f832f4..8a691a6 100644 --- a/assets/javascripts/discourse/templates/components/docs-topic.hbs +++ b/assets/javascripts/discourse/templates/components/docs-topic.hbs @@ -1,17 +1,17 @@
-

{{html-safe topic.fancyTitle}}

+

{{html-safe this.topic.fancyTitle}}

{{! template-lint-disable no-capital-arguments }} - +
- + {{d-icon "far-comment"}} {{i18n "docs.topic.navigate_to_topic"}} diff --git a/assets/javascripts/discourse/templates/docs-index.hbs b/assets/javascripts/discourse/templates/docs-index.hbs index d391ecf..3dea2e5 100644 --- a/assets/javascripts/discourse/templates/docs-index.hbs +++ b/assets/javascripts/discourse/templates/docs-index.hbs @@ -1,13 +1,16 @@ - - {{#if noContent}} - + + {{#if this.noContent}} + {{else}}
- {{#if site.mobileView}} - {{#unless selectedTopic}} + {{#if this.site.mobileView}} + {{#unless this.selectedTopic}} @@ -15,13 +18,13 @@ {{/if}}
- {{#if expandedFilters}} - {{#if canFilterSolved}} + {{#if this.expandedFilters}} + {{#if this.canFilterSolved}}