From ce55b4671eb8a4d9a4fae50f803c73703ea9e240 Mon Sep 17 00:00:00 2001 From: Angus McLeod Date: Fri, 22 Nov 2024 17:11:51 +0100 Subject: [PATCH] Linting --- .eslintrc | 3 - .prettierrc | 1 - .prettierrc.cjs | 1 + .template-lintrc.cjs | 1 + .template-lintrc.js | 4 - .travis.yml | 10 - .../components/custom-field-input.js | 3 +- .../custom-wizard-category-selector.js | 2 +- .../custom-wizard-composer-editor.js | 14 +- .../components/custom-wizard-editor.hbs | 2 +- .../custom-wizard-field-category.js | 5 +- .../custom-wizard-field-composer-preview.js | 5 +- .../custom-wizard-field-composer.js | 4 +- .../components/custom-wizard-field-topic.js | 1 + .../components/custom-wizard-field-upload.js | 4 +- .../components/custom-wizard-field.js | 2 +- .../custom-wizard-group-selector.js | 2 +- .../components/custom-wizard-no-access.js | 8 +- .../custom-wizard-similar-topics.js | 3 + .../components/custom-wizard-step.js | 13 +- .../components/custom-wizard-tag-selector.js | 2 +- .../components/custom-wizard-text-field.js | 6 +- .../custom-wizard-topic-selector.js | 2 +- .../components/similar-topics-validator.js | 10 +- .../discourse/components/validator.js | 2 + .../components/wizard-custom-action.js | 10 +- .../components/wizard-custom-field.js | 10 +- .../discourse/components/wizard-links.js | 10 +- .../components/wizard-mapper-connector.js | 5 +- .../components/wizard-mapper-input.js | 6 +- .../components/wizard-mapper-pair.js | 6 +- .../components/wizard-mapper-selector-type.js | 2 +- .../components/wizard-mapper-selector.js | 21 +- .../discourse/components/wizard-mapper.js | 9 +- .../discourse/components/wizard-message.js | 4 +- .../components/wizard-realtime-validations.js | 2 +- .../components/wizard-subscription-badge.js | 4 +- .../wizard-subscription-container.js | 2 +- .../wizard-subscription-selector.js | 6 +- .../wizard-subscription-selector-header.js | 2 +- .../wizard-subscription-selector-row.js | 2 +- .../components/wizard-subscription-status.js | 4 +- .../components/wizard-text-editor.js | 17 +- .../components/wizard-user-chooser.js | 2 +- .../admin-user-wizard-details.hbs | 10 +- .../custom-wizard-category-settings.hbs | 4 +- .../custom-wizard-category-settings.js | 2 +- .../top-notices/prompt-completion.hbs | 2 +- .../controllers/admin-wizards-api-show.js | 12 +- .../controllers/admin-wizards-logs-show.js | 6 +- .../controllers/admin-wizards-manager.js | 11 +- .../admin-wizards-submissions-show.js | 6 +- .../controllers/admin-wizards-wizard-show.js | 25 +- .../controllers/admin-wizards-wizard.js | 2 +- .../discourse/controllers/admin-wizards.js | 2 +- .../controllers/custom-wizard-step.js | 2 +- .../discourse/helpers/wizard-char-counter.js | 2 +- .../initializers/custom-wizard-edits.js | 8 +- .../initializers/custom-wizard-redirect.js | 4 +- .../javascripts/discourse/lib/wizard-json.js | 4 +- .../discourse/lib/wizard-mapper.js | 2 +- .../discourse/lib/wizard-schema.js | 1 - assets/javascripts/discourse/lib/wizard.js | 2 +- .../discourse/mixins/subscription.js | 2 +- .../discourse/mixins/undo-changes.js | 4 +- .../discourse/models/custom-wizard-admin.js | 8 +- .../discourse/models/custom-wizard-api.js | 7 +- .../models/custom-wizard-custom-field.js | 4 +- .../discourse/models/custom-wizard-field.js | 2 +- .../discourse/models/custom-wizard-logs.js | 2 +- .../discourse/models/custom-wizard-manager.js | 2 +- .../discourse/models/custom-wizard-step.js | 4 +- .../discourse/models/custom-wizard.js | 4 +- .../routes/admin-wizards-api-show.js | 4 +- .../discourse/routes/admin-wizards-api.js | 2 +- .../routes/admin-wizards-custom-fields.js | 2 +- .../routes/admin-wizards-logs-show.js | 6 +- .../discourse/routes/admin-wizards-logs.js | 4 +- .../discourse/routes/admin-wizards-manager.js | 2 +- .../routes/admin-wizards-submissions-show.js | 4 +- .../routes/admin-wizards-submissions.js | 4 +- .../routes/admin-wizards-wizard-show.js | 4 +- .../discourse/routes/admin-wizards-wizard.js | 8 +- .../discourse/routes/admin-wizards.js | 2 +- .../discourse/routes/custom-wizard-index.js | 4 +- .../discourse/routes/custom-wizard-step.js | 8 +- .../discourse/routes/custom-wizard.js | 6 +- .../discourse/services/subscription.js | 2 +- eslint.config.mjs | 3 + package-lock.json | 5363 ----------------- package.json | 18 +- pnpm-lock.yaml | 4007 ++++++++++++ .../admin-custom-fields-unsubscribed-test.js | 4 +- .../javascripts/acceptance/admin-logs-test.js | 4 +- .../acceptance/admin-manager-test.js | 4 +- .../acceptance/admin-submissions-test.js | 4 +- .../acceptance/admin-wizards-api-test.js | 4 +- ...dmin-wizards-business-subscription-test.js | 5 +- ...dmin-wizards-standard-subscription-test.js | 5 +- .../admin-wizards-unsubscribed-test.js | 5 +- .../category-chooser-initializer-test.js | 2 +- test/javascripts/acceptance/field-test.js | 2 +- test/javascripts/acceptance/wizard-test.js | 11 +- test/javascripts/helpers/wizard.js | 6 +- yarn.lock | 3065 ---------- 105 files changed, 4275 insertions(+), 8679 deletions(-) delete mode 100644 .eslintrc delete mode 100644 .prettierrc create mode 100644 .prettierrc.cjs create mode 100644 .template-lintrc.cjs delete mode 100644 .template-lintrc.js delete mode 100644 .travis.yml create mode 100644 eslint.config.mjs delete mode 100644 package-lock.json create mode 100644 pnpm-lock.yaml delete mode 100644 yarn.lock diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 7898fbf8..00000000 --- a/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "eslint-config-discourse" -} diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 0967ef42..00000000 --- a/.prettierrc +++ /dev/null @@ -1 +0,0 @@ -{} diff --git a/.prettierrc.cjs b/.prettierrc.cjs new file mode 100644 index 00000000..57f647bc --- /dev/null +++ b/.prettierrc.cjs @@ -0,0 +1 @@ +module.exports = require("@discourse/lint-configs/prettier"); diff --git a/.template-lintrc.cjs b/.template-lintrc.cjs new file mode 100644 index 00000000..5355ea06 --- /dev/null +++ b/.template-lintrc.cjs @@ -0,0 +1 @@ +module.exports = require("@discourse/lint-configs/template-lint"); diff --git a/.template-lintrc.js b/.template-lintrc.js deleted file mode 100644 index a558b8e3..00000000 --- a/.template-lintrc.js +++ /dev/null @@ -1,4 +0,0 @@ -module.exports = { - plugins: ["ember-template-lint-plugin-discourse"], - extends: "discourse:recommended", -}; diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a2048719..00000000 --- a/.travis.yml +++ /dev/null @@ -1,10 +0,0 @@ -services: - - docker - -before_install: - - git clone --depth=1 https://github.com/discourse/discourse-plugin-ci - -install: true - -script: - - discourse-plugin-ci/script.sh diff --git a/assets/javascripts/discourse/components/custom-field-input.js b/assets/javascripts/discourse/components/custom-field-input.js index 6f891e1b..038947cd 100644 --- a/assets/javascripts/discourse/components/custom-field-input.js +++ b/assets/javascripts/discourse/components/custom-field-input.js @@ -1,6 +1,6 @@ import Component from "@ember/component"; -import discourseComputed, { observes } from "discourse-common/utils/decorators"; import { alias, equal, or } from "@ember/object/computed"; +import discourseComputed, { observes } from "discourse-common/utils/decorators"; import I18n from "I18n"; export default Component.extend({ @@ -17,6 +17,7 @@ export default Component.extend({ isExternal: equal("field.id", "external"), didInsertElement() { + this._super(...arguments); this.set("originalField", JSON.parse(JSON.stringify(this.field))); }, diff --git a/assets/javascripts/discourse/components/custom-wizard-category-selector.js b/assets/javascripts/discourse/components/custom-wizard-category-selector.js index 4aa6735d..769c6927 100644 --- a/assets/javascripts/discourse/components/custom-wizard-category-selector.js +++ b/assets/javascripts/discourse/components/custom-wizard-category-selector.js @@ -1,6 +1,6 @@ -import CategorySelector from "select-kit/components/category-selector"; import { computed } from "@ember/object"; import { makeArray } from "discourse-common/lib/helpers"; +import CategorySelector from "select-kit/components/category-selector"; export default CategorySelector.extend({ classNames: ["category-selector", "wizard-category-selector"], diff --git a/assets/javascripts/discourse/components/custom-wizard-composer-editor.js b/assets/javascripts/discourse/components/custom-wizard-composer-editor.js index 9a7af44f..eede2ac8 100644 --- a/assets/javascripts/discourse/components/custom-wizard-composer-editor.js +++ b/assets/javascripts/discourse/components/custom-wizard-composer-editor.js @@ -1,11 +1,11 @@ -import ComposerEditor from "discourse/components/composer-editor"; -import discourseComputed, { bind } from "discourse-common/utils/decorators"; -import { alias } from "@ember/object/computed"; -import { uploadIcon } from "discourse/lib/uploads"; -import { dasherize } from "@ember/string"; -import InsertHyperlink from "discourse/components/modal/insert-hyperlink"; -import { inject as service } from "@ember/service"; import { action } from "@ember/object"; +import { alias } from "@ember/object/computed"; +import { service } from "@ember/service"; +import { dasherize } from "@ember/string"; +import ComposerEditor from "discourse/components/composer-editor"; +import InsertHyperlink from "discourse/components/modal/insert-hyperlink"; +import { uploadIcon } from "discourse/lib/uploads"; +import discourseComputed, { bind } from "discourse-common/utils/decorators"; export const wizardComposerEdtiorEventPrefix = "wizard-editor"; diff --git a/assets/javascripts/discourse/components/custom-wizard-editor.hbs b/assets/javascripts/discourse/components/custom-wizard-editor.hbs index 8c0a96c1..6e9eebd0 100644 --- a/assets/javascripts/discourse/components/custom-wizard-editor.hbs +++ b/assets/javascripts/discourse/components/custom-wizard-editor.hbs @@ -23,7 +23,7 @@ options=(hash popupTitle=b.title icon=b.icon) }} {{else}} -
{{d.icon}}
+
{{b.icon}}