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:
Joffrey JAFFEUX
2020-09-22 16:28:28 +02:00
committed by GitHub
parent c86538097d
commit 530d9ab071
179 changed files with 1246 additions and 434 deletions
+2 -1
View File
@@ -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({});
});
+11 -4
View File
@@ -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 = {}) {
+24 -8
View File
@@ -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";
};