Replace prettier by stylistic to lint JavaScript (#3303)

In the latest versions of ESLint, more and more formatting rules were
removed or declared deprecated. These rules have been integrated into
the new Stylistic package (https://eslint.style/guide/why) and expanded.

Stylistic acts as a better formatter  for JavaScript as Prettier.

With this PR there are many changes that make the code more uniform, but
it may be difficult to review due to the large amount. Even if I have no
worries about the changes, perhaps this would be something for the
release after next.

Let me know what you think.
This commit is contained in:
Kristjan ESPERANTO 2023-12-25 08:17:11 +01:00 committed by GitHub
parent 4e7b68a69d
commit 0b70274a1a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
64 changed files with 954 additions and 942 deletions

View file

@ -134,12 +134,12 @@ const AnimateCSSOut = [
* @param {string} [animation] animation name.
* @param {number} [animationTime] animation duration.
*/
function addAnimateCSS(element, animation, animationTime) {
function addAnimateCSS (element, animation, animationTime) {
const animationName = `animate__${animation}`;
const node = document.getElementById(element);
if (!node) {
// don't execute animate: we don't find div
Log.warn(`addAnimateCSS: node not found for`, element);
Log.warn("addAnimateCSS: node not found for", element);
return;
}
node.style.setProperty("--animate-duration", `${animationTime}s`);
@ -151,12 +151,12 @@ function addAnimateCSS(element, animation, animationTime) {
* @param {string} [element] div element to animate.
* @param {string} [animation] animation name.
*/
function removeAnimateCSS(element, animation) {
function removeAnimateCSS (element, animation) {
const animationName = `animate__${animation}`;
const node = document.getElementById(element);
if (!node) {
// don't execute animate: we don't find div
Log.warn(`removeAnimateCSS: node not found for`, element);
Log.warn("removeAnimateCSS: node not found for", element);
return;
}
node.classList.remove("animate__animated", animationName);