DEV: Enable discourse-common-imports eslint rule (#30742)

Applies the autofix, which caught a few places that were missed in the
original find/replace

See https://github.com/discourse/lint-configs/pull/91
This commit is contained in:
David Taylor 2025-01-13 16:01:34 +00:00 committed by GitHub
parent 637a6d7928
commit acde5c4337
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
44 changed files with 48 additions and 47 deletions

View File

@ -7,6 +7,7 @@ export default [
"ember/no-classic-classes": "error",
"discourse/i18n-import-location": "error",
"discourse/i18n-t": "error",
"discourse/discourse-common-imports": "error",
"qunit/no-assert-equal-boolean": "error",
"qunit/no-assert-equal": "error",
"qunit/no-loose-assertions": "error",

View File

@ -6,7 +6,7 @@
"license": "GPL-2.0-only",
"devDependencies": {
"@babel/plugin-proposal-decorators": "^7.25.9",
"@discourse/lint-configs": "^2.2.3",
"@discourse/lint-configs": "^2.3.0",
"@discourse/moment-timezone-names-translations": "^1.0.0",
"@fortawesome/fontawesome-free": "6.6.0",
"@glint/core": "^1.5.1",

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import { htmlSafe } from "@ember/template";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
export default class ChatChannelIcon extends Component {

View File

@ -7,7 +7,7 @@ import { and, not, or } from "truth-helpers";
import DButton from "discourse/components/d-button";
import PluginOutlet from "discourse/components/plugin-outlet";
import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse-common/helpers/d-icon";
import dIcon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
import ChatModalNewMessage from "discourse/plugins/chat/discourse/components/chat/modal/new-message";
import EmptyChannelsList from "discourse/plugins/chat/discourse/components/empty-channels-list";

View File

@ -7,7 +7,7 @@ import { service } from "@ember/service";
import { and } from "truth-helpers";
import PluginOutlet from "discourse/components/plugin-outlet";
import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse-common/helpers/d-icon";
import dIcon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
import EmptyChannelsList from "discourse/plugins/chat/discourse/components/empty-channels-list";
import ChatChannelRow from "./chat-channel-row";

View File

@ -5,8 +5,8 @@ import { service } from "@ember/service";
import { gt } from "truth-helpers";
import borderColor from "discourse/helpers/border-color";
import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse/helpers/d-icon";
import replaceEmoji from "discourse/helpers/replace-emoji";
import dIcon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import ToggleChannelMembershipButton from "./toggle-channel-membership-button";

View File

@ -10,10 +10,10 @@ import { htmlSafe } from "@ember/template";
import { modifier as modifierFn } from "ember-modifier";
import { and, eq } from "truth-helpers";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse/helpers/d-icon";
import replaceEmoji from "discourse/helpers/replace-emoji";
import { popupAjaxError } from "discourse/lib/ajax-error";
import { bind } from "discourse/lib/decorators";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import ChannelIcon from "discourse/plugins/chat/discourse/components/channel-icon";
import ChannelName from "discourse/plugins/chat/discourse/components/channel-name";

View File

@ -1,5 +1,5 @@
import Component from "@glimmer/component";
import dIcon from "discourse-common/helpers/d-icon";
import dIcon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
import {
CHANNEL_STATUSES,

View File

@ -1,7 +1,7 @@
import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button";
import dIcon from "discourse/helpers/d-icon";
import replaceEmoji from "discourse/helpers/replace-emoji";
import dIcon from "discourse-common/helpers/d-icon";
import ChatUserAvatar from "./chat-user-avatar";
const ChatComposerMessageDetails = <template>

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse/helpers/d-icon";
import { isImage } from "discourse/lib/uploads";
import dIcon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatComposerUpload extends Component {

View File

@ -2,8 +2,8 @@ import Component from "@glimmer/component";
import { tracked } from "@glimmer/tracking";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import icon from "discourse/helpers/d-icon";
import getURL from "discourse/lib/get-url";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatHeader extends Component {

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import dIcon from "discourse/helpers/d-icon";
import getURL from "discourse/lib/get-url";
import dIcon from "discourse-common/helpers/d-icon";
import I18n, { i18n } from "discourse-i18n";
export default class ChatMentionWarnings extends Component {

View File

@ -2,8 +2,8 @@ import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import dIcon from "discourse/helpers/d-icon";
import replaceEmoji from "discourse/helpers/replace-emoji";
import dIcon from "discourse-common/helpers/d-icon";
import ChatEmojiAvatar from "./chat-emoji-avatar";
import ChatUserAvatar from "./chat-user-avatar";

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import icon from "discourse/helpers/d-icon";
import replaceEmoji from "discourse/helpers/replace-emoji";
import icon from "discourse-common/helpers/d-icon";
export default class ChatThreadHeading extends Component {
get showHeading() {

View File

@ -1,4 +1,4 @@
import dIcon from "discourse-common/helpers/d-icon";
import dIcon from "discourse/helpers/d-icon";
const ChatComposerButton = <template>
<div class="chat-composer-button__wrapper">

View File

@ -1,6 +1,6 @@
import { LinkTo } from "@ember/routing";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
const ChatFormRow = <template>
{{#if @route}}

View File

@ -2,8 +2,8 @@ import Component from "@glimmer/component";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse/helpers/d-icon";
import getURL from "discourse/lib/get-url";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import ChatHeaderIconUnreadIndicator from "discourse/plugins/chat/discourse/components/chat/header/icon/unread-indicator";
import { getUserChatSeparateSidebarMode } from "discourse/plugins/chat/discourse/lib/get-user-chat-separate-sidebar-mode";

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import { service } from "@ember/service";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatableGroup extends Component {

View File

@ -2,7 +2,7 @@ import { fn } from "@ember/helper";
import { eq } from "truth-helpers";
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import ChatUserAvatar from "discourse/plugins/chat/discourse/components/chat-user-avatar";
const Member = <template>

View File

@ -4,7 +4,7 @@ import { on } from "@ember/modifier";
import { action } from "@ember/object";
import didInsert from "@ember/render-modifiers/modifiers/did-insert";
import { eq } from "truth-helpers";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
import { getNext, getPrevious } from "./lib/iterate-list";
import Member from "./member";

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { Input } from "@ember/component";
import { on } from "@ember/modifier";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatMessageCreatorSearchInput extends Component {

View File

@ -8,9 +8,9 @@ import { and } from "truth-helpers";
import BookmarkIcon from "discourse/components/bookmark-icon";
import UserStatusMessage from "discourse/components/user-status-message";
import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse/helpers/d-icon";
import { bind } from "discourse/lib/decorators";
import { prioritizeNameInUx } from "discourse/lib/settings";
import dIcon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import ChannelTitle from "discourse/plugins/chat/discourse/components/channel-title";
import formatChatDate from "../../../helpers/format-chat-date";

View File

@ -4,7 +4,7 @@ import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import { eq } from "truth-helpers";
import BookmarkIcon from "discourse/components/bookmark-icon";
import dIcon from "discourse-common/helpers/d-icon";
import dIcon from "discourse/helpers/d-icon";
import formatChatDate from "../../../helpers/format-chat-date";
export default class ChatMessageLeftGutter extends Component {

View File

@ -6,8 +6,8 @@ import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import DButton from "discourse/components/d-button";
import DModal from "discourse/components/d-modal";
import icon from "discourse/helpers/d-icon";
import { popupAjaxError } from "discourse/lib/ajax-error";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatModalThreadSettings extends Component {

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatNavbarBackButton extends Component {

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatNavbarBrowseChannelsButton extends Component {

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatNavbarCloseThreadButton extends Component {

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatNavbarCloseThreadsButton extends Component {

View File

@ -2,7 +2,7 @@ import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
import ThreadHeaderUnreadIndicator from "discourse/plugins/chat/discourse/components/chat/thread/header-unread-indicator";

View File

@ -1,6 +1,6 @@
import { hash } from "@ember/helper";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import SubTitle from "./sub-title";
const ChatNavbarTitle = <template>

View File

@ -3,8 +3,8 @@ import { tracked } from "@glimmer/tracking";
import { on } from "@ember/modifier";
import { action } from "@ember/object";
import { service } from "@ember/service";
import dIcon from "discourse/helpers/d-icon";
import { popupAjaxError } from "discourse/lib/ajax-error";
import dIcon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import laterFn from "../../../modifiers/chat/later-fn";

View File

@ -7,12 +7,12 @@ import { LinkTo } from "@ember/routing";
import { service } from "@ember/service";
import { modifier } from "ember-modifier";
import FilterInput from "discourse/components/filter-input";
import icon from "discourse/helpers/d-icon";
import discourseDebounce from "discourse/lib/debounce";
import { INPUT_DELAY } from "discourse/lib/environment";
import isElementInViewport from "discourse/lib/is-element-in-viewport";
import DiscourseURL, { userPath } from "discourse/lib/url";
import autoFocus from "discourse/modifiers/auto-focus";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import MessageCreator from "discourse/plugins/chat/discourse/components/chat/message-creator";
import { MODES } from "discourse/plugins/chat/discourse/components/chat/message-creator/constants";

View File

@ -7,9 +7,9 @@ import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import DToggleSwitch from "discourse/components/d-toggle-switch";
import categoryBadge from "discourse/helpers/category-badge";
import icon from "discourse/helpers/d-icon";
import replaceEmoji from "discourse/helpers/replace-emoji";
import { popupAjaxError } from "discourse/lib/ajax-error";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import ComboBox from "select-kit/components/combo-box";
import ChatForm from "discourse/plugins/chat/discourse/components/chat/form";

View File

@ -1,6 +1,6 @@
import DButton from "discourse/components/d-button";
import concatClass from "discourse/helpers/concat-class";
import dIcon from "discourse-common/helpers/d-icon";
import dIcon from "discourse/helpers/d-icon";
const ScrollToBottomArrow = <template>
<div class="chat-scroll-to-bottom">

View File

@ -2,9 +2,9 @@ import Component from "@glimmer/component";
import { on } from "@ember/modifier";
import { service } from "@ember/service";
import { or } from "truth-helpers";
import icon from "discourse/helpers/d-icon";
import noop from "discourse/helpers/noop";
import replaceEmoji from "discourse/helpers/replace-emoji";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import and from "truth-helpers/helpers/and";
import ThreadSettingsModal from "discourse/plugins/chat/discourse/components/chat/modal/thread-settings";

View File

@ -1,6 +1,6 @@
import Component from "@glimmer/component";
import { LinkTo } from "@ember/routing";
import dIcon from "discourse-common/helpers/d-icon";
import dIcon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
export default class ChatPreferences extends Component {

View File

@ -1,6 +1,6 @@
import { cancel, debounce } from "@ember/runloop";
import Service, { service } from "@ember/service";
import { isTesting } from "discourse-common/config/environment";
import { isTesting } from "discourse/lib/environment";
const KEEP_ALIVE = 10 * 1000; // 10 seconds

View File

@ -4,7 +4,7 @@ import { action, get } from "@ember/object";
import { service } from "@ember/service";
import DButton from "discourse/components/d-button";
import DropdownMenu from "discourse/components/dropdown-menu";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import DMenu from "float-kit/components/d-menu";
const buttonOptionsMap = {

View File

@ -1,8 +1,8 @@
import Component from "@glimmer/component";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import icon from "discourse/helpers/d-icon";
import { relativeAge } from "discourse/lib/formatter";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
const ON_VOTE = "on_vote";

View File

@ -3,7 +3,7 @@ import { fn } from "@ember/helper";
import { action } from "@ember/object";
import DButton from "discourse/components/d-button";
import DropdownMenu from "discourse/components/dropdown-menu";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
import { i18n } from "discourse-i18n";
import DMenu from "float-kit/components/d-menu";

View File

@ -5,8 +5,8 @@ import { action } from "@ember/object";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import concatClass from "discourse/helpers/concat-class";
import icon from "discourse/helpers/d-icon";
import routeAction from "discourse/helpers/route-action";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import PollOptionRankedChoice from "./poll-option-ranked-choice";

View File

@ -1,7 +1,7 @@
import Component from "@glimmer/component";
import { eq } from "truth-helpers";
import avatar from "discourse/helpers/bound-avatar-template";
import icon from "discourse-common/helpers/d-icon";
import icon from "discourse/helpers/d-icon";
export default class PollVotersComponent extends Component {
groupVotersByRank = (voters) => {

View File

@ -5,10 +5,10 @@ import { action } from "@ember/object";
import didUpdate from "@ember/render-modifiers/modifiers/did-update";
import { service } from "@ember/service";
import { htmlSafe } from "@ember/template";
import icon from "discourse/helpers/d-icon";
import { ajax } from "discourse/lib/ajax";
import { popupAjaxError } from "discourse/lib/ajax-error";
import round from "discourse/lib/round";
import icon from "discourse-common/helpers/d-icon";
import { i18n } from "discourse-i18n";
import PollBreakdownModal from "../components/modal/poll-breakdown";
import {

View File

@ -35,8 +35,8 @@ importers:
specifier: ^7.25.9
version: 7.25.9(@babel/core@7.26.0)
'@discourse/lint-configs':
specifier: ^2.2.3
version: 2.2.3(ember-template-lint@6.0.0)(eslint@9.18.0)(prettier@2.8.8)
specifier: ^2.3.0
version: 2.3.0(ember-template-lint@6.0.0)(eslint@9.18.0)(prettier@2.8.8)
'@discourse/moment-timezone-names-translations':
specifier: ^1.0.0
version: 1.0.0
@ -1818,8 +1818,8 @@ packages:
'@discourse/itsatrap@2.0.10':
resolution: {integrity: sha512-Jn1gdiyHMGUsmUfLFf4Q7VnTAv0l7NePbegU6pKhKHEmbzV3FosGxq30fTOYgVyTS1bxqGjlA6LvQttJpv3ROw==}
'@discourse/lint-configs@2.2.3':
resolution: {integrity: sha512-GZE2u/9QfLRIEDscickTx6sB51pA/8lZeNx1YTgoXx6OnyOCxfQf/24M9GTPHcOYZHIDtqAFrffSd9FI5NNUOw==}
'@discourse/lint-configs@2.3.0':
resolution: {integrity: sha512-vHmUUnuTemLDGpnfgK4jcmToM9accbByzxuL3NTY3bGDtygG/B09wkxWr+A9UbAMhlKsJy9w9sIH/2BovyYX3Q==}
peerDependencies:
ember-template-lint: 6.0.0
eslint: ^9.15.0
@ -9305,7 +9305,7 @@ snapshots:
'@discourse/itsatrap@2.0.10': {}
'@discourse/lint-configs@2.2.3(ember-template-lint@6.0.0)(eslint@9.18.0)(prettier@2.8.8)':
'@discourse/lint-configs@2.3.0(ember-template-lint@6.0.0)(eslint@9.18.0)(prettier@2.8.8)':
dependencies:
'@babel/core': 7.26.0(supports-color@8.1.1)
'@babel/eslint-parser': 7.26.5(@babel/core@7.26.0)(eslint@9.18.0)