Skip to content

Commit 758a2f7

Browse files
authored
DEV: Update linting config and run gjs-codemod (#85)
1 parent f92eab9 commit 758a2f7

File tree

9 files changed

+503
-1028
lines changed

9 files changed

+503
-1028
lines changed

.discourse-compatibility

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
< 3.5.0.beta5-dev: f92eab97a15556df502ea4d644920071b8446e09
12
< 3.5.0.beta1-dev: 7c56ad642017bd7649f531cab57d2da0f6d4f84d
23
< 3.4.0.beta2-dev: 9b5d5b16aa800d8d43dfe3f871594bf68f69cf02
34
< 3.4.0.beta1-dev: 7dff8ccbcda763519cc1b94806b701af56875c3d

Gemfile.lock

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -15,41 +15,41 @@ GEM
1515
tzinfo (~> 2.0, >= 2.0.5)
1616
uri (>= 0.13.1)
1717
ast (2.4.3)
18-
base64 (0.2.0)
19-
benchmark (0.4.0)
20-
bigdecimal (3.1.9)
18+
base64 (0.3.0)
19+
benchmark (0.4.1)
20+
bigdecimal (3.2.2)
2121
concurrent-ruby (1.3.5)
22-
connection_pool (2.5.0)
23-
drb (2.2.1)
22+
connection_pool (2.5.3)
23+
drb (2.2.3)
2424
i18n (1.14.7)
2525
concurrent-ruby (~> 1.0)
26-
json (2.10.2)
27-
language_server-protocol (3.17.0.4)
26+
json (2.12.2)
27+
language_server-protocol (3.17.0.5)
2828
lint_roller (1.1.0)
2929
logger (1.7.0)
3030
minitest (5.25.5)
31-
parallel (1.26.3)
32-
parser (3.3.7.3)
31+
parallel (1.27.0)
32+
parser (3.3.8.0)
3333
ast (~> 2.4.1)
3434
racc
3535
prettier_print (1.2.1)
3636
prism (1.4.0)
3737
racc (1.8.1)
38-
rack (3.1.12)
38+
rack (3.1.16)
3939
rainbow (3.1.1)
4040
regexp_parser (2.10.0)
41-
rubocop (1.75.1)
41+
rubocop (1.76.0)
4242
json (~> 2.3)
4343
language_server-protocol (~> 3.17.0.2)
4444
lint_roller (~> 1.1.0)
4545
parallel (~> 1.10)
4646
parser (>= 3.3.0.2)
4747
rainbow (>= 2.2.2, < 4.0)
4848
regexp_parser (>= 2.9.3, < 3.0)
49-
rubocop-ast (>= 1.43.0, < 2.0)
49+
rubocop-ast (>= 1.45.0, < 2.0)
5050
ruby-progressbar (~> 1.7)
5151
unicode-display_width (>= 2.4.0, < 4.0)
52-
rubocop-ast (1.43.0)
52+
rubocop-ast (1.45.0)
5353
parser (>= 3.3.7.2)
5454
prism (~> 1.4)
5555
rubocop-capybara (2.22.1)
@@ -67,13 +67,13 @@ GEM
6767
rubocop-factory_bot (2.27.1)
6868
lint_roller (~> 1.1)
6969
rubocop (~> 1.72, >= 1.72.1)
70-
rubocop-rails (2.30.3)
70+
rubocop-rails (2.32.0)
7171
activesupport (>= 4.2.0)
7272
lint_roller (~> 1.1)
7373
rack (>= 1.1)
74-
rubocop (>= 1.72.1, < 2.0)
75-
rubocop-ast (>= 1.38.0, < 2.0)
76-
rubocop-rspec (3.5.0)
74+
rubocop (>= 1.75.0, < 2.0)
75+
rubocop-ast (>= 1.44.0, < 2.0)
76+
rubocop-rspec (3.6.0)
7777
lint_roller (~> 1.1)
7878
rubocop (~> 1.72, >= 1.72.1)
7979
rubocop-rspec_rails (2.31.0)
@@ -100,4 +100,4 @@ DEPENDENCIES
100100
syntax_tree
101101

102102
BUNDLED WITH
103-
2.6.6
103+
2.6.9

javascripts/discourse/components/modal/ucd-warning.js renamed to javascripts/discourse/components/modal/ucd-warning.gjs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ import { action } from "@ember/object";
33
import { service } from "@ember/service";
44
import { htmlSafe } from "@ember/template";
55
import { escape } from "pretty-text/sanitizer";
6+
import DModal from "discourse/components/d-modal";
67
import { emojiUnescape } from "discourse/lib/text";
78
import { i18n } from "discourse-i18n";
89
import { randomizeEmojiDiversity } from "../../lib/emoji-diversity";
10+
import UcdWarning from "../ucd-warning";
911

1012
export default class ModalUcdWarning extends Component {
1113
@service ucdState;
@@ -27,4 +29,15 @@ export default class ModalUcdWarning extends Component {
2729

2830
this.args.closeModal();
2931
}
32+
33+
<template>
34+
<DModal
35+
@closeModal={{this.closeModal}}
36+
class="modal-ucd-warning"
37+
@title={{this.title}}
38+
@inline={{@inline}}
39+
>
40+
<UcdWarning @onClose={{this.closeModal}} />
41+
</DModal>
42+
</template>
3043
}

javascripts/discourse/components/modal/ucd-warning.hbs

Lines changed: 0 additions & 8 deletions
This file was deleted.
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import Component from "@glimmer/component";
2+
import { Input } from "@ember/component";
3+
import { inject as controller } from "@ember/controller";
4+
import { on } from "@ember/modifier";
5+
import { action } from "@ember/object";
6+
import { service } from "@ember/service";
7+
import CookText from "discourse/components/cook-text";
8+
import DButton from "discourse/components/d-button";
9+
import { i18n } from "discourse-i18n";
10+
11+
export default class UcdWarning extends Component {
12+
@service modal;
13+
@service ucdState;
14+
15+
@controller composer;
16+
17+
get shouldPermanentlyDismiss() {
18+
return this.ucdState.permanentlyDismissed ?? false;
19+
}
20+
21+
@action
22+
toggleShouldPermanentlyDismiss() {
23+
this.ucdState.toggle();
24+
}
25+
26+
@action
27+
goBackAndFix() {
28+
this.modal.close();
29+
}
30+
31+
@action
32+
ignoreAndProceed() {
33+
this.modal.close();
34+
this.composer.model.ucd_previousWarningIgnored = true;
35+
this.composer.save();
36+
}
37+
38+
<template>
39+
<CookText @rawText={{i18n (themePrefix "warning_modal.content")}} />
40+
<label for="ucd_do-not-show-again" class="checkbox-label">
41+
<Input
42+
@type="checkbox"
43+
id="ucd_do-not-show-again"
44+
name="ucd_do-not-show-again"
45+
@checked={{readonly this.shouldPermanentlyDismiss}}
46+
{{on "change" this.toggleShouldPermanentlyDismiss}}
47+
/>
48+
{{i18n (themePrefix "warning_modal.do_not_show_again")}}
49+
</label>
50+
<div class="action-buttons">
51+
<DButton
52+
@action={{this.goBackAndFix}}
53+
@icon="pencil"
54+
class="btn-primary"
55+
@label={{themePrefix "warning_modal.fix_post"}}
56+
/>
57+
<DButton
58+
@action={{this.ignoreAndProceed}}
59+
@label={{themePrefix "warning_modal.ignore_and_post_anyway"}}
60+
/>
61+
</div>
62+
</template>
63+
}

javascripts/discourse/components/ucd-warning.hbs

Lines changed: 0 additions & 23 deletions
This file was deleted.

javascripts/discourse/components/ucd-warning.js

Lines changed: 0 additions & 32 deletions
This file was deleted.

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
22
"private": true,
33
"devDependencies": {
4-
"@discourse/lint-configs": "2.11.1",
5-
"ember-template-lint": "7.0.1",
6-
"eslint": "9.22.0",
4+
"@discourse/lint-configs": "2.25.0",
5+
"ember-template-lint": "7.8.1",
6+
"eslint": "9.28.0",
77
"prettier": "3.5.3",
8-
"stylelint": "16.16.0"
8+
"stylelint": "16.20.0"
99
},
1010
"engines": {
1111
"node": ">= 22",

0 commit comments

Comments
 (0)