Skip to content

A platform for community discussion. Free, open, simple.

DEV: Run prettier correctly for bundled-plugin test directories (#30338)

David Taylor8f6c99df8c7d
diff --git a/package.json b/package.json
index 17cdf0c870d..293971efaa1 100644
--- a/package.json
+++ b/package.json
@@ -47,8 +47,8 @@
"lint:js:fix": "eslint --fix ./app/assets/javascripts $(script/list_bundled_plugins) --no-error-on-unmatched-pattern",
"lint:hbs": "ember-template-lint 'app/assets/javascripts/**/*.{gjs,hbs}' 'plugins/*/assets/javascripts/**/*.{gjs,hbs}' 'plugins/*/admin/assets/javascripts/**/*.{gjs,hbs}'",
"lint:hbs:fix": "ember-template-lint 'app/assets/javascripts/**/*.{gjs,hbs}' 'plugins/*/assets/javascripts/**/*.{gjs,hbs}' 'plugins/*/admin/assets/javascripts/**/*.{gjs,hbs}' --fix",
- "lint:prettier": "pnpm pprettier --list-different 'app/assets/stylesheets/**/*.scss' 'app/assets/javascripts/**/*.{js,gjs,hbs}' $(script/list_bundled_plugins '/assets/stylesheets/**/*.scss') $(script/list_bundled_plugins '/{assets,admin/assets}/javascripts/**/*.{js,gjs,hbs}')",
- "lint:prettier:fix": "pnpm prettier -w 'app/assets/stylesheets/**/*.scss' 'app/assets/javascripts/**/*.{js,gjs,hbs}' $(script/list_bundled_plugins '/assets/stylesheets/**/*.scss') $(script/list_bundled_plugins '/{assets,admin/assets}/javascripts/**/*.{js,gjs,hbs}')",
+ "lint:prettier": "pnpm pprettier --list-different 'app/assets/stylesheets/**/*.scss' 'app/assets/javascripts/**/*.{js,gjs,hbs}' $(script/list_bundled_plugins '/assets/stylesheets/**/*.scss') $(script/list_bundled_plugins '/{assets,admin/assets,test}/javascripts/**/*.{js,gjs,hbs}')",
+ "lint:prettier:fix": "pnpm prettier -w 'app/assets/stylesheets/**/*.scss' 'app/assets/javascripts/**/*.{js,gjs,hbs}' $(script/list_bundled_plugins '/assets/stylesheets/**/*.scss') $(script/list_bundled_plugins '/{assets,admin/assets,test}/javascripts/**/*.{js,gjs,hbs}')",
"lttf:ignore": "lint-to-the-future ignore",
"lttf:output": "lint-to-the-future output -o ./lint-progress/",
"lint-progress": "pnpm lttf:output && npx html-pages ./lint-progress --no-cache",
diff --git a/plugins/chat/test/javascripts/components/chat-channel-leave-btn-test.js b/plugins/chat/test/javascripts/components/chat-channel-leave-btn-test.js
index 83c57b838b7..9b16706df27 100644
--- a/plugins/chat/test/javascripts/components/chat-channel-leave-btn-test.js
+++ b/plugins/chat/test/javascripts/components/chat-channel-leave-btn-test.js
@@ -4,7 +4,7 @@ import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import pretender from "discourse/tests/helpers/create-pretender";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
module("Discourse Chat | Component | chat-channel-leave-btn", function (hooks) {
diff --git a/plugins/chat/test/javascripts/components/chat-channel-status-test.js b/plugins/chat/test/javascripts/components/chat-channel-status-test.js
index 8e34caf3c0c..8ae54384a97 100644
--- a/plugins/chat/test/javascripts/components/chat-channel-status-test.js
+++ b/plugins/chat/test/javascripts/components/chat-channel-status-test.js
@@ -3,7 +3,7 @@ import { render } from "@ember/test-helpers";
import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
import {
CHANNEL_STATUSES,
diff --git a/plugins/chat/test/javascripts/components/chat-composer-placeholder-test.js b/plugins/chat/test/javascripts/components/chat-composer-placeholder-test.js
index a0b7d0c5e96..18d560d0ab7 100644
--- a/plugins/chat/test/javascripts/components/chat-composer-placeholder-test.js
+++ b/plugins/chat/test/javascripts/components/chat-composer-placeholder-test.js
@@ -4,7 +4,7 @@ import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
import pretender from "discourse/tests/helpers/create-pretender";
import { query } from "discourse/tests/helpers/qunit-helpers";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";
module(
diff --git a/plugins/chat/test/javascripts/components/chat-composer-upload-test.js b/plugins/chat/test/javascripts/components/chat-composer-upload-test.js
index 80607adb870..2e9695daed7 100644
--- a/plugins/chat/test/javascripts/components/chat-composer-upload-test.js
+++ b/plugins/chat/test/javascripts/components/chat-composer-upload-test.js
@@ -2,7 +2,7 @@ import { click, render } from "@ember/test-helpers";
import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
module("Discourse Chat | Component | chat-composer-upload", function (hooks) {
setupRenderingTest(hooks);
diff --git a/plugins/chat/test/javascripts/components/chat-message-left-gutter-test.js b/plugins/chat/test/javascripts/components/chat-message-left-gutter-test.js
index d7f0bebecbc..ed7e5f44792 100644
--- a/plugins/chat/test/javascripts/components/chat-message-left-gutter-test.js
+++ b/plugins/chat/test/javascripts/components/chat-message-left-gutter-test.js
@@ -4,7 +4,7 @@ import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import CoreFabricators from "discourse/lib/fabricators";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
module(
diff --git a/plugins/chat/test/javascripts/components/chat-retention-reminder-test.js b/plugins/chat/test/javascripts/components/chat-retention-reminder-test.js
index a3faae79d73..052477961fe 100644
--- a/plugins/chat/test/javascripts/components/chat-retention-reminder-test.js
+++ b/plugins/chat/test/javascripts/components/chat-retention-reminder-test.js
@@ -2,7 +2,7 @@ import { render } from "@ember/test-helpers";
import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
import ChatChannel from "discourse/plugins/chat/discourse/models/chat-channel";
module(
diff --git a/plugins/chat/test/javascripts/components/chat-retention-reminder-text-test.js b/plugins/chat/test/javascripts/components/chat-retention-reminder-text-test.js
index 3424efce619..887a738a130 100644
--- a/plugins/chat/test/javascripts/components/chat-retention-reminder-text-test.js
+++ b/plugins/chat/test/javascripts/components/chat-retention-reminder-text-test.js
@@ -3,7 +3,7 @@ import { render } from "@ember/test-helpers";
import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
import ChatFabricators from "discourse/plugins/chat/discourse/lib/fabricators";
module(
diff --git a/plugins/discourse-local-dates/test/javascripts/acceptance/download-calendar-test.js b/plugins/discourse-local-dates/test/javascripts/acceptance/download-calendar-test.js
index 0c58da11ef9..cdd3c089bb6 100644
--- a/plugins/discourse-local-dates/test/javascripts/acceptance/download-calendar-test.js
+++ b/plugins/discourse-local-dates/test/javascripts/acceptance/download-calendar-test.js
@@ -4,7 +4,7 @@ import sinon from "sinon";
import { fixturesByUrl } from "discourse/tests/helpers/create-pretender";
import { acceptance } from "discourse/tests/helpers/qunit-helpers";
import { cloneJSON } from "discourse-common/lib/object";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
acceptance(
"Local Dates - Download calendar without default calendar option set",
diff --git a/plugins/discourse-local-dates/test/javascripts/unit/local-date-builder-test.js b/plugins/discourse-local-dates/test/javascripts/unit/local-date-builder-test.js
index 61f91f12419..6a0827c7693 100644
--- a/plugins/discourse-local-dates/test/javascripts/unit/local-date-builder-test.js
+++ b/plugins/discourse-local-dates/test/javascripts/unit/local-date-builder-test.js
@@ -1,5 +1,5 @@
import QUnit, { module, test } from "qunit";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
import freezeTime from "../helpers/freeze-time";
import LocalDateBuilder from "../lib/local-date-builder";
diff --git a/plugins/poll/test/javascripts/acceptance/poll-builder-enabled-test.js b/plugins/poll/test/javascripts/acceptance/poll-builder-enabled-test.js
index db22bb45978..d38bcb946ec 100644
--- a/plugins/poll/test/javascripts/acceptance/poll-builder-enabled-test.js
+++ b/plugins/poll/test/javascripts/acceptance/poll-builder-enabled-test.js
@@ -5,7 +5,7 @@ import {
acceptance,
updateCurrentUser,
} from "discourse/tests/helpers/qunit-helpers";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
import { displayPollBuilderButton } from "discourse/plugins/poll/helpers/display-poll-builder-button";
acceptance("Poll Builder - polls are enabled", function (needs) {
diff --git a/plugins/poll/test/javascripts/component/poll-options-test.js b/plugins/poll/test/javascripts/component/poll-options-test.js
index ada2616328b..0d8dc61805c 100644
--- a/plugins/poll/test/javascripts/component/poll-options-test.js
+++ b/plugins/poll/test/javascripts/component/poll-options-test.js
@@ -2,7 +2,7 @@ import { click, render } from "@ember/test-helpers";
import hbs from "htmlbars-inline-precompile";
import { module, test } from "qunit";
import { setupRenderingTest } from "discourse/tests/helpers/component-test";
-import { i18n } from 'discourse-i18n';
+import { i18n } from "discourse-i18n";
const OPTIONS = [
{ id: "1ddc47be0d2315b9711ee8526ca9d83f", html: "This", votes: 0, rank: 0 },