DEV: Update ESLint to remove I18n global

Also fixes missed imports in core.
This commit is contained in:
Robin Ward 2020-05-14 10:04:08 -04:00
parent a047004c9a
commit aa2d040526
48 changed files with 51 additions and 5 deletions

View File

@ -143,6 +143,7 @@ var define, requirejs;
guidFor: Ember.guidFor
},
I18n: {
// eslint-disable-next-line
default: I18n
}
};

View File

@ -2,6 +2,7 @@ import { isEmpty } from "@ember/utils";
import EmberObject from "@ember/object";
import discourseComputed, { on } from "discourse-common/utils/decorators";
import Mixin from "@ember/object/mixin";
import I18n from "I18n";
export default Mixin.create({
@on("init")

View File

@ -3,6 +3,7 @@
const ps = require("discourse/lib/preload-store").default;
const preloadedDataElement = document.getElementById("data-preloaded");
const setupData = document.getElementById("data-discourse-setup").dataset;
const I18n = require("I18n").default;
if (preloadedDataElement) {
const preloaded = JSON.parse(preloadedDataElement.dataset.preloaded);

View File

@ -45,7 +45,7 @@
"chrome-launcher": "^0.12.0",
"chrome-remote-interface": "^0.25",
"ember-template-lint": "^2.5.2",
"eslint-config-discourse": "1.1.1",
"eslint-config-discourse": "1.1.2",
"eslint-plugin-discourse-ember": "0.0.3",
"lodash-cli": "https://github.com/lodash-archive/lodash-cli.git",
"pretender": "^1.6",

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Admin - User Emails", { loggedIn: true });

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Admin - Users List", { loggedIn: true });

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import {
acceptance,
loggedInUser,

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
import { _clearSnapshots } from "select-kit/components/composer-actions";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { run } from "@ember/runloop";
import selectKit from "helpers/select-kit-helper";
import { acceptance } from "helpers/qunit-helpers";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
let userFound = false;

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
acceptance("Group Members");

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("New Group");

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
import pretender from "helpers/create-pretender";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
let userFound = false;

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
import PreloadStore from "discourse/lib/preload-store";
import { parsePostData } from "helpers/create-pretender";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Personal Message", {

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance, updateCurrentUser } from "helpers/qunit-helpers";
import selectKit from "helpers/select-kit-helper";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import { withPluginApi } from "discourse/lib/plugin-api";
import { clearTopicFooterButtons } from "discourse/lib/register-topic-footer-button";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { acceptance } from "helpers/qunit-helpers";
acceptance("Topic move posts", { loggedIn: true });

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { withPluginApi } from "discourse/lib/plugin-api";
import selectKit from "helpers/select-kit-helper";
import { acceptance } from "helpers/qunit-helpers";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
import Theme from "admin/models/theme";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
import Theme, { THEMES, COMPONENTS } from "admin/models/theme";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
moduleForComponent("d-button", { integration: true });

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { next } from "@ember/runloop";
import { clearToolbarCallbacks } from "discourse/components/d-editor";
import componentTest from "helpers/component-test";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
moduleForComponent("secret-value-list", { integration: true });

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
import { testSelectKitModule } from "helpers/select-kit-helper";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import DiscourseURL from "discourse/lib/url";
import Category from "discourse/models/category";
import componentTest from "helpers/component-test";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
import { testSelectKitModule } from "helpers/select-kit-helper";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
import { testSelectKitModule } from "helpers/select-kit-helper";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
import { testSelectKitModule } from "helpers/select-kit-helper";
import Site from "discourse/models/site";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import componentTest from "helpers/component-test";
import Topic from "discourse/models/topic";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import selectKit from "helpers/select-kit-helper";
import componentTest from "helpers/component-test";
import Topic from "discourse/models/topic";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import componentTest from "helpers/component-test";
moduleForComponent("text-field", { integration: true });

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { mapRoutes } from "discourse/mapping-router";
moduleFor("controller:create-account", "controller:create-account", {

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
/*jshint maxlen:10000000 */
export default {
"/t/280/1.json": {

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import LocalizationInitializer from "discourse/initializers/localization";
QUnit.module("initializer:localization", {

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import EmberObject from "@ember/object";
import {
setting,

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
QUnit.module("lib:i18n", {
_locale: I18n.locale,
_fallbackLocale: I18n.fallbackLocale,

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import {
translateResults,
searchContextDescription

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import {
validateUploadedFiles,
authorizedExtensions,

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import UserDraft from "discourse/models/user-draft";
import { NEW_TOPIC_KEY } from "discourse/models/composer";
import User from "discourse/models/user";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import EmberObject from "@ember/object";
import { moduleForWidget, widgetTest } from "helpers/widget-test";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import DiscourseURL from "discourse/lib/url";
import { moduleForWidget, widgetTest } from "helpers/widget-test";

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { moduleForWidget, widgetTest } from "helpers/widget-test";
moduleForWidget("widget-dropdown");

View File

@ -1,3 +1,4 @@
import I18n from "I18n";
import { next } from "@ember/runloop";
import { moduleForWidget, widgetTest } from "helpers/widget-test";
import { createWidget } from "discourse/widgets/widget";

View File

@ -978,10 +978,10 @@ escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5:
resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4"
integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=
eslint-config-discourse@1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-1.1.1.tgz#8a7f7f6f1a388b0e88f5b79145ae2a8b4a13e3d4"
integrity sha512-b3dp9DOcXYWkPQpXms/bMDy0Scb6DO/nZAAsl5I9yTNhtkx96zZMTp9QEyC8QaCXOTUpIXEE6V+Mpyjtsk3gWg==
eslint-config-discourse@1.1.2:
version "1.1.2"
resolved "https://registry.yarnpkg.com/eslint-config-discourse/-/eslint-config-discourse-1.1.2.tgz#f8569579ea3fc348a989bbab0780a5c426038744"
integrity sha512-yF29RxKyvFvQbnICCGext0rlXzQMm4AZuBxqOVFonjb0sUbB/08l/FyLHmXKpKgLCEMV6RrJKB7xxPL6twtUkA==
dependencies:
babel-eslint "^8.2"
eslint "^4.19"