DEV: Update linting setup and fix issues (#17345)

Re-lands #16119 and #17298

* Update eslint-config-discourse
* Update linting workflow
* Prettier-ignore stuff
* Update template-lint config
* Auto-fix template issues
* Fix various template issues
  Mostly incorrect attributes and unused templates
* Prettier js files
* Fix template auto-fix regressions
* Small css tweak

Co-authored-by: Peter Wagenet <peter.wagenet@gmail.com>
This commit is contained in:
Jarek Radosz
2022-07-06 10:37:54 +02:00
committed by GitHub
parent f7c133ac74
commit c3fd91670e
186 changed files with 3235 additions and 3127 deletions

View File

@ -26,7 +26,7 @@
<div class="poll-options">
{{#if this.showAdvanced}}
<label class="input-group-label">{{i18n "poll.ui_builder.poll_options.label"}}</label>
<Textarea @value={{this.pollOptionsText}} @input={{action "onOptionsTextChange"}} />
<Textarea @value={{this.pollOptionsText}} {{on "input" (action "onOptionsTextChange")}} />
{{#if this.showMinNumOfOptionsValidation}}
{{#unless this.minNumOfOptionsValidation.ok}}
<InputTip @validation={{this.minNumOfOptionsValidation}} />
@ -56,18 +56,18 @@
<div class="options">
<div class="input-group poll-number">
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.min"}}</label>
<Input @type="number" @value={{this.pollMin}} @valueProperty="value" class="poll-options-min" @min={{1}} />
<Input @type="number" @value={{this.pollMin}} class="poll-options-min" min="1" />
</div>
<div class="input-group poll-number">
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.max"}}</label>
<Input @type="number" @value={{this.pollMax}} @valueProperty="value" class="poll-options-max" @min={{1}} />
<Input @type="number" @value={{this.pollMax}} class="poll-options-max" min="1" />
</div>
{{#if this.isNumber}}
<div class="input-group poll-number">
<label class="input-group-label">{{i18n "poll.ui_builder.poll_config.step"}}</label>
<Input @type="number" @value={{this.pollStep}} @valueProperty="value" @min="1" class="poll-options-step" />
<Input @type="number" @value={{this.pollStep}} min="1" class="poll-options-step" />
</div>
{{/if}}
</div>

View File

@ -24,8 +24,8 @@ function cleanUpPolls() {
function initializePolls(api) {
const register = getRegister(api),
pollGroupableUserFields = api.container.lookup("site-settings:main")
.poll_groupable_user_fields;
pollGroupableUserFields =
api.container.lookup("site-settings:main").poll_groupable_user_fields;
cleanUpPolls();
api.modifyClass("controller:topic", {

View File

@ -47,8 +47,7 @@ acceptance("Poll quote", function (needs) {
title_is_group: false,
bookmarked: false,
bookmarks: [],
raw:
"[poll name=poll1 type=regular results=always chartType=bar]\n* Alpha\n* Beta\n[/poll]\n\n[poll name=poll2 type=regular results=always chartType=bar]\n* First\n* Second\n[/poll]",
raw: "[poll name=poll1 type=regular results=always chartType=bar]\n* Alpha\n* Beta\n[/poll]\n\n[poll name=poll2 type=regular results=always chartType=bar]\n* First\n* Second\n[/poll]",
actions_summary: [
{
id: 3,

View File

@ -51,8 +51,7 @@ acceptance("Poll results", function (needs) {
title_is_group: false,
bookmarked: false,
bookmarks: [],
raw:
"[poll type=regular results=always public=true chartType=bar]\n* Option #1\n* Option #2\n[/poll]",
raw: "[poll type=regular results=always public=true chartType=bar]\n* Option #1\n* Option #2\n[/poll]",
actions_summary: [
{ id: 3, can_act: true },
{ id: 4, can_act: true },
@ -87,14 +86,12 @@ acceptance("Poll results", function (needs) {
options: [
{
id: "db753fe0bc4e72869ac1ad8765341764",
html:
'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
html: 'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
votes: 1,
},
{
id: "d8c22ff912e03740d9bc19e133e581e0",
html:
'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
html: 'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
votes: 0,
},
],
@ -192,14 +189,12 @@ acceptance("Poll results", function (needs) {
options: [
{
id: "db753fe0bc4e72869ac1ad8765341764",
html:
'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
html: 'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
votes: 1,
},
{
id: "d8c22ff912e03740d9bc19e133e581e0",
html:
'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
html: 'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
votes: 0,
},
],
@ -705,8 +700,7 @@ acceptance("Poll results - no voters", function (needs) {
title_is_group: false,
bookmarked: false,
bookmarks: [],
raw:
"[poll type=regular results=always public=true chartType=bar]\n* Option #1\n* Option #2\n[/poll]",
raw: "[poll type=regular results=always public=true chartType=bar]\n* Option #1\n* Option #2\n[/poll]",
actions_summary: [
{ id: 3, can_act: true },
{ id: 4, can_act: true },
@ -741,14 +735,12 @@ acceptance("Poll results - no voters", function (needs) {
options: [
{
id: "db753fe0bc4e72869ac1ad8765341764",
html:
'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
html: 'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
votes: 0,
},
{
id: "d8c22ff912e03740d9bc19e133e581e0",
html:
'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
html: 'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
votes: 0,
},
],
@ -835,14 +827,12 @@ acceptance("Poll results - no voters", function (needs) {
options: [
{
id: "db753fe0bc4e72869ac1ad8765341764",
html:
'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
html: 'Option \u003cspan class="hashtag"\u003e#1\u003c/span\u003e',
votes: 0,
},
{
id: "d8c22ff912e03740d9bc19e133e581e0",
html:
'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
html: 'Option \u003cspan class="hashtag"\u003e#2\u003c/span\u003e',
votes: 0,
},
],