DEV: enforces eslint’s curly rule to the codebase (#10720)
eslint --fix is capable of fix it automatically for you, ensure prettier is run after eslint as eslint --fix could leave the code in an invalid prettier state.
This commit is contained in:
@@ -325,13 +325,14 @@ export function applyDefaultHandlers(pretender) {
|
||||
pretender.get("/draft.json", (request) => {
|
||||
if (request.queryParams.draft_key === "new_topic") {
|
||||
return response(fixturesByUrl["/draft.json"]);
|
||||
} else if (request.queryParams.draft_key.startsWith("topic_"))
|
||||
} else if (request.queryParams.draft_key.startsWith("topic_")) {
|
||||
return response(
|
||||
fixturesByUrl[request.url] || {
|
||||
draft: null,
|
||||
draft_sequence: 0,
|
||||
}
|
||||
);
|
||||
}
|
||||
return response({});
|
||||
});
|
||||
|
||||
|
||||
@@ -91,11 +91,16 @@ function AcceptanceModal(option, _relatedTarget) {
|
||||
typeof option === "object" && option
|
||||
);
|
||||
|
||||
if (!data) $this.data("bs.modal", (data = new Modal(this, options)));
|
||||
if (!data) {
|
||||
$this.data("bs.modal", (data = new Modal(this, options)));
|
||||
}
|
||||
data.$body = $("#ember-testing");
|
||||
|
||||
if (typeof option === "string") data[option](_relatedTarget);
|
||||
else if (options.show) data.show(_relatedTarget);
|
||||
if (typeof option === "string") {
|
||||
data[option](_relatedTarget);
|
||||
} else if (options.show) {
|
||||
data.show(_relatedTarget);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -106,7 +111,9 @@ let _pretenderCallbacks = {};
|
||||
|
||||
export function applyPretender(name, server, helper) {
|
||||
const cb = _pretenderCallbacks[name];
|
||||
if (cb) cb(server, helper);
|
||||
if (cb) {
|
||||
cb(server, helper);
|
||||
}
|
||||
}
|
||||
|
||||
export function controllerModule(name, args = {}) {
|
||||
|
||||
@@ -70,11 +70,21 @@ QUnit.module("lib:i18n", {
|
||||
// fake pluralization rules
|
||||
I18n.pluralizationRules = Object.assign({}, I18n.pluralizationRules);
|
||||
I18n.pluralizationRules.fr = function (n) {
|
||||
if (n === 0) return "zero";
|
||||
if (n === 1) return "one";
|
||||
if (n === 2) return "two";
|
||||
if (n >= 3 && n <= 9) return "few";
|
||||
if (n >= 10 && n <= 99) return "many";
|
||||
if (n === 0) {
|
||||
return "zero";
|
||||
}
|
||||
if (n === 1) {
|
||||
return "one";
|
||||
}
|
||||
if (n === 2) {
|
||||
return "two";
|
||||
}
|
||||
if (n >= 3 && n <= 9) {
|
||||
return "few";
|
||||
}
|
||||
if (n >= 10 && n <= 99) {
|
||||
return "many";
|
||||
}
|
||||
return "other";
|
||||
};
|
||||
},
|
||||
@@ -153,9 +163,15 @@ QUnit.test("extra translations", (assert) => {
|
||||
},
|
||||
};
|
||||
I18n.pluralizationRules.pl_PL = function (n) {
|
||||
if (n === 1) return "one";
|
||||
if (n % 10 >= 2 && n % 10 <= 4) return "few";
|
||||
if (n % 10 === 0) return "many";
|
||||
if (n === 1) {
|
||||
return "one";
|
||||
}
|
||||
if (n % 10 >= 2 && n % 10 <= 4) {
|
||||
return "few";
|
||||
}
|
||||
if (n % 10 === 0) {
|
||||
return "many";
|
||||
}
|
||||
return "other";
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user