Skip to content

Commit

Permalink
DEV: Update linting (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
davidtaylorhq authored Nov 20, 2024
1 parent 6538eeb commit a67122f
Show file tree
Hide file tree
Showing 15 changed files with 49 additions and 36 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{{#if showSidebar}}
{{#if this.showSidebar}}
<div class="tc-right-sidebar">
{{right-sidebar-blocks}}
</div>
Expand Down
10 changes: 5 additions & 5 deletions javascripts/discourse/components/popular-tags.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ export default class PopularTags extends Component {
@service router;
@tracked topTags = null;

willDestroy() {
super.willDestroy(...arguments);
this.topTags = null;
}

get shouldShowBlock() {
const currentRoute = this.router.currentRoute;
const count = this.args?.params?.count || 10;
Expand Down Expand Up @@ -49,9 +54,4 @@ export default class PopularTags extends Component {
displayInSpecificCategories.includes(categoryId)
);
}

willDestroy() {
super.willDestroy(...arguments);
this.topTags = null;
}
}
10 changes: 5 additions & 5 deletions javascripts/discourse/components/subcategory-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ export default class SubcategoryList extends Component {
@service router;
@tracked parentCategory = null;

willDestroy() {
super.willDestroy(...arguments);
this.parentCategory = null;
}

get shouldShowBlock() {
const currentRoute = this.router.currentRoute;

Expand Down Expand Up @@ -33,9 +38,4 @@ export default class SubcategoryList extends Component {
displayInCategories.includes(parentCategoryId)
);
}

willDestroy() {
super.willDestroy(...arguments);
this.parentCategory = null;
}
}
10 changes: 5 additions & 5 deletions javascripts/discourse/components/top-contributors.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ export default class TopContributors extends Component {
});
}

willDestroy() {
super.willDestroy(...arguments);
this.topContributors = null;
}

get requestURL() {
return `/directory_items.json?period=${this.period}&order=${this.order}&exclude_groups=${this.excludedGroupNames}&limit=${this.count}`;
}

get viewAllUrl() {
return `/u?order=${this.order}&period=${this.period}&exclude_groups=${this.excludedGroupNames}`;
}

willDestroy() {
super.willDestroy(...arguments);
this.topContributors = null;
}
}
4 changes: 2 additions & 2 deletions javascripts/discourse/templates/components/category-list.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h3 class="category-list__heading">
{{blockTitle}}
{{this.blockTitle}}
</h3>

<div class="category-list__container">
{{#each categoryList as |category|}}
{{#each this.categoryList as |category|}}
<div class="category-list__category">
{{category-link category}}
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{{category-link category}}
{{category-link this.category}}

<div class="category-topics--content">
{{#each topics as |topic|}}
{{#each this.topics as |topic|}}
<a href={{topic.url}} class="category-topics--topic">
{{html-safe (replace-emoji topic.fancy_title)}}
<span class="category-topics--posts-count">
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{{html-safe params.content}}
{{html-safe this.params.content}}
4 changes: 2 additions & 2 deletions javascripts/discourse/templates/components/popular-tags.hbs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{{#if shouldShowBlock}}
{{#if this.shouldShowBlock}}
<h3 class="popular-tags-heading">
{{theme-i18n "popular_tags.heading"}}
</h3>

<div class="popular-tags__container">
{{#each topTags as |t|}}
{{#each this.topTags as |t|}}
<a href="/tag/{{t}}" class="popular-tags__tag">
{{t}}
</a>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</h3>

<div class="recent-replies--container">
{{#each replies as |reply|}}
{{#each this.replies as |reply|}}
<div class="recent-replies--reply">
<div class="recent-replies--col">
{{avatar reply imageSize="small"}}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<PluginOutlet @name="above-right-sidebar-blocks" />

{{#each blocks as |block|}}
{{#each this.blocks as |block|}}
<div class={{block.classNames}}>
{{component block.internalName params=block.parsedParams}}
</div>
Expand Down
4 changes: 2 additions & 2 deletions javascripts/discourse/templates/components/tag-topics.hbs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<h3 class="tag-topics__heading">
{{blockTitle}}
{{this.blockTitle}}
</h3>

<div class="tag-topics__container">
{{#each tagTopics as |topic|}}
{{#each this.tagTopics as |topic|}}
<div class="tag-topics__topic">
<div class="tag-topics__col">
<div class="tag-topics__topic-title">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
</h3>

<div class="top-contributors--container">
{{#each topContributors as |item|}}
{{#each this.topContributors as |item|}}
<div class="top-contributors--user">
<span
data-user-card={{item.user.username}}
class="top-contributors--user-badge"
>
{{avatar item.user imageSize="small"}}
{{#if siteSettings.prioritize_username_in_ux}}
{{#if this.siteSettings.prioritize_username_in_ux}}
{{item.user.username}}
{{else if item.user.name}}
{{item.user.name}}
Expand Down
2 changes: 1 addition & 1 deletion javascripts/discourse/templates/components/top-topics.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</h3>

<div class="top-topics__container">
{{#each topTopics as |topic|}}
{{#each this.topTopics as |topic|}}
<div class="top-topics__topic">
<div class="top-topics__col">
<div class="top-topics__topic-title">
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"private": true,
"devDependencies": {
"@discourse/lint-configs": "2.0.1",
"@discourse/lint-configs": "2.2.1",
"ember-template-lint": "6.0.0",
"eslint": "9.14.0",
"prettier": "2.8.8"
Expand Down
23 changes: 18 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit a67122f

Please sign in to comment.