Skip to content

Commit 5f7a0b4

Browse files
authored
DEV: Update linting (#76)
1 parent c079679 commit 5f7a0b4

17 files changed

+1280
-1432
lines changed

Gemfile.lock

+53-39
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
activesupport (7.2.1.1)
4+
activesupport (8.0.2)
55
base64
6+
benchmark (>= 0.3)
67
bigdecimal
78
concurrent-ruby (~> 1.0, >= 1.3.1)
89
connection_pool (>= 2.2.5)
@@ -12,68 +13,81 @@ GEM
1213
minitest (>= 5.1)
1314
securerandom (>= 0.3)
1415
tzinfo (~> 2.0, >= 2.0.5)
16+
uri (>= 0.13.1)
1517
ast (2.4.2)
1618
base64 (0.2.0)
17-
bigdecimal (3.1.8)
18-
concurrent-ruby (1.3.4)
19-
connection_pool (2.4.1)
19+
benchmark (0.4.0)
20+
bigdecimal (3.1.9)
21+
concurrent-ruby (1.3.5)
22+
connection_pool (2.5.0)
2023
drb (2.2.1)
21-
i18n (1.14.6)
24+
i18n (1.14.7)
2225
concurrent-ruby (~> 1.0)
23-
json (2.7.2)
24-
language_server-protocol (3.17.0.3)
25-
logger (1.6.1)
26-
minitest (5.25.1)
26+
json (2.10.2)
27+
language_server-protocol (3.17.0.4)
28+
lint_roller (1.1.0)
29+
logger (1.6.6)
30+
minitest (5.25.5)
2731
parallel (1.26.3)
28-
parser (3.3.5.0)
32+
parser (3.3.7.1)
2933
ast (~> 2.4.1)
3034
racc
3135
prettier_print (1.2.1)
3236
racc (1.8.1)
33-
rack (3.1.10)
37+
rack (3.1.12)
3438
rainbow (3.1.1)
35-
regexp_parser (2.9.2)
36-
rubocop (1.67.0)
39+
regexp_parser (2.10.0)
40+
rubocop (1.74.0)
3741
json (~> 2.3)
38-
language_server-protocol (>= 3.17.0)
42+
language_server-protocol (~> 3.17.0.2)
43+
lint_roller (~> 1.1.0)
3944
parallel (~> 1.10)
4045
parser (>= 3.3.0.2)
4146
rainbow (>= 2.2.2, < 4.0)
42-
regexp_parser (>= 2.4, < 3.0)
43-
rubocop-ast (>= 1.32.2, < 2.0)
47+
regexp_parser (>= 2.9.3, < 3.0)
48+
rubocop-ast (>= 1.38.0, < 2.0)
4449
ruby-progressbar (~> 1.7)
45-
unicode-display_width (>= 2.4.0, < 3.0)
46-
rubocop-ast (1.32.3)
50+
unicode-display_width (>= 2.4.0, < 4.0)
51+
rubocop-ast (1.39.0)
4752
parser (>= 3.3.1.0)
48-
rubocop-capybara (2.21.0)
49-
rubocop (~> 1.41)
50-
rubocop-discourse (3.8.2)
53+
rubocop-capybara (2.22.1)
54+
lint_roller (~> 1.1)
55+
rubocop (~> 1.72, >= 1.72.1)
56+
rubocop-discourse (3.12.1)
5157
activesupport (>= 6.1)
52-
rubocop (>= 1.59.0)
53-
rubocop-capybara (>= 2.0.0)
54-
rubocop-factory_bot (>= 2.0.0)
55-
rubocop-rails (>= 2.25.0)
58+
lint_roller (>= 1.1.0)
59+
rubocop (>= 1.73.2)
60+
rubocop-capybara (>= 2.22.0)
61+
rubocop-factory_bot (>= 2.27.0)
62+
rubocop-rails (>= 2.30.3)
5663
rubocop-rspec (>= 3.0.1)
57-
rubocop-rspec_rails (>= 2.30.0)
58-
rubocop-factory_bot (2.26.1)
59-
rubocop (~> 1.61)
60-
rubocop-rails (2.26.2)
64+
rubocop-rspec_rails (>= 2.31.0)
65+
rubocop-factory_bot (2.27.1)
66+
lint_roller (~> 1.1)
67+
rubocop (~> 1.72, >= 1.72.1)
68+
rubocop-rails (2.30.3)
6169
activesupport (>= 4.2.0)
70+
lint_roller (~> 1.1)
6271
rack (>= 1.1)
63-
rubocop (>= 1.52.0, < 2.0)
64-
rubocop-ast (>= 1.31.1, < 2.0)
65-
rubocop-rspec (3.1.0)
66-
rubocop (~> 1.61)
67-
rubocop-rspec_rails (2.30.0)
68-
rubocop (~> 1.61)
69-
rubocop-rspec (~> 3, >= 3.0.1)
72+
rubocop (>= 1.72.1, < 2.0)
73+
rubocop-ast (>= 1.38.0, < 2.0)
74+
rubocop-rspec (3.5.0)
75+
lint_roller (~> 1.1)
76+
rubocop (~> 1.72, >= 1.72.1)
77+
rubocop-rspec_rails (2.31.0)
78+
lint_roller (~> 1.1)
79+
rubocop (~> 1.72, >= 1.72.1)
80+
rubocop-rspec (~> 3.5)
7081
ruby-progressbar (1.13.0)
71-
securerandom (0.3.1)
82+
securerandom (0.4.1)
7283
syntax_tree (6.2.0)
7384
prettier_print (>= 1.2.0)
7485
tzinfo (2.0.6)
7586
concurrent-ruby (~> 1.0)
76-
unicode-display_width (2.6.0)
87+
unicode-display_width (3.1.4)
88+
unicode-emoji (~> 4.0, >= 4.0.4)
89+
unicode-emoji (4.0.4)
90+
uri (1.0.3)
7791

7892
PLATFORMS
7993
arm64-darwin-23
@@ -84,4 +98,4 @@ DEPENDENCIES
8498
syntax_tree
8599

86100
BUNDLED WITH
87-
2.5.21
101+
2.6.6

desktop/desktop.scss

+4-2
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424

2525
.rs-component {
2626
margin-bottom: 1.5em;
27+
2728
h3 {
2829
border-bottom: 1px solid var(--primary-low);
2930
padding-bottom: 0.5em;
@@ -54,6 +55,7 @@
5455
// Recent replies
5556
.recent-replies--reply {
5657
display: flex;
58+
5759
&:not(:last-child) {
5860
padding-bottom: 1em;
5961
border-bottom: 1px solid var(--primary-low);
@@ -65,6 +67,7 @@
6567
&:first-child {
6668
padding-top: 0.05em;
6769
}
70+
6871
&:nth-child(2) {
6972
margin: 0 0.5em;
7073
flex-shrink: 1;
@@ -83,6 +86,7 @@
8386
.top-topics__topic {
8487
flex-wrap: wrap;
8588
justify-content: space-between;
89+
8690
@extend .recent-replies--reply;
8791
}
8892

@@ -122,7 +126,6 @@
122126
}
123127

124128
// Subcategory list
125-
126129
.subcategory-list--item {
127130
> .subcategory {
128131
display: flex;
@@ -135,7 +138,6 @@
135138
}
136139

137140
// category list
138-
139141
.category-list__category {
140142
&:not(:last-child) {
141143
margin-bottom: 0.5em;
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{#if this.showSidebar}}
22
<div class="tc-right-sidebar">
3-
{{right-sidebar-blocks}}
3+
<RightSidebarBlocks />
44
</div>
55
{{/if}}
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,47 @@
1+
import Component from "@ember/component";
12
import { service } from "@ember/service";
23
import discourseComputed from "discourse/lib/decorators";
34

4-
export default {
5-
setupComponent() {
6-
this.reopen({
7-
router: service(),
5+
export default class TcRightSidebar extends Component {
6+
@service router;
7+
@service site;
88

9-
@discourseComputed(
10-
"router.currentRouteName",
11-
"router.currentRoute.attributes.category",
12-
"router.currentRoute.attributes.category.slug",
13-
"router.currentRoute.attributes.tag.id"
14-
)
15-
showSidebar(currentRouteName, category, categorySlug, tagId) {
16-
if (this.site.mobileView) {
17-
return false;
18-
}
9+
@discourseComputed(
10+
"router.currentRouteName",
11+
"router.currentRoute.attributes.category",
12+
"router.currentRoute.attributes.category.slug",
13+
"router.currentRoute.attributes.tag.id"
14+
)
15+
showSidebar(currentRouteName, category, categorySlug, tagId) {
16+
if (this.site.mobileView) {
17+
return false;
18+
}
1919

20-
if (settings.show_in_routes !== "") {
21-
const selectedRoutes = settings.show_in_routes.split("|");
22-
let subcategory = null;
23-
let parentCategory = null;
20+
if (settings.show_in_routes !== "") {
21+
const selectedRoutes = settings.show_in_routes.split("|");
22+
let subcategory = null;
23+
let parentCategory = null;
2424

25-
// check if current page is subcategory
26-
// -- is category
27-
// -- does not have children itself
28-
// -- has a parent category
29-
if (
30-
!!this.category &&
31-
!this.category.has_children &&
32-
!!this.category.parent_category_id
33-
) {
34-
subcategory = categorySlug;
35-
parentCategory = category.ancestors[0].slug;
36-
}
25+
// check if current page is subcategory
26+
const categoryArg = this.outletArgs.category;
27+
if (
28+
categoryArg &&
29+
!categoryArg.has_children &&
30+
categoryArg.parent_category_id
31+
) {
32+
subcategory = categorySlug;
33+
parentCategory = category.ancestors[0].slug;
34+
}
3735

38-
if (
39-
selectedRoutes.includes(currentRouteName) ||
40-
selectedRoutes.includes(`c/${categorySlug}`) ||
41-
selectedRoutes.includes(`c/${parentCategory}/${subcategory}`) ||
42-
selectedRoutes.includes(`tag/${tagId}`)
43-
) {
44-
return true;
45-
} else {
46-
return false;
47-
}
48-
}
36+
return (
37+
selectedRoutes.includes(currentRouteName) ||
38+
selectedRoutes.includes(`c/${categorySlug}`) ||
39+
selectedRoutes.includes(`c/${parentCategory}/${subcategory}`) ||
40+
selectedRoutes.includes(`tag/${tagId}`)
41+
);
42+
}
4943

50-
// if theme setting is empty, show everywhere except /categories
51-
return currentRouteName === "discovery.categories" ? false : true;
52-
},
53-
});
54-
},
55-
};
44+
// if theme setting is empty, show everywhere except /categories
45+
return currentRouteName !== "discovery.categories";
46+
}
47+
}

javascripts/discourse/components/popular-tags.js

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { service } from "@ember/service";
55
export default class PopularTags extends Component {
66
@service site;
77
@service router;
8+
89
@tracked topTags = null;
910

1011
willDestroy() {

javascripts/discourse/components/subcategory-list.js

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { service } from "@ember/service";
44

55
export default class SubcategoryList extends Component {
66
@service router;
7+
78
@tracked parentCategory = null;
89

910
willDestroy() {

javascripts/discourse/components/top-contributors.hbs

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@
3333

3434
<a class="top-contributors--view-all" href={{this.viewAllUrl}}>
3535
{{theme-i18n "top_contributors.view_all"}}
36-
</a>
36+
</a>

package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"@discourse/lint-configs": "2.4.0",
5-
"ember-template-lint": "6.1.0",
6-
"eslint": "9.19.0",
7-
"prettier": "2.8.8"
4+
"@discourse/lint-configs": "2.11.1",
5+
"ember-template-lint": "7.0.1",
6+
"eslint": "9.22.0",
7+
"prettier": "3.5.3",
8+
"stylelint": "16.16.0"
89
},
910
"engines": {
1011
"node": ">= 22",

0 commit comments

Comments
 (0)