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
64 changed files with 954 additions and 942 deletions

View File

@@ -9,15 +9,15 @@ const Log = require("logger");
const Class = require("./class");
const NodeHelper = Class.extend({
init() {
init () {
Log.log("Initializing new module helper ...");
},
loaded() {
loaded () {
Log.log(`Module helper loaded: ${this.name}`);
},
start() {
start () {
Log.log(`Starting module helper: ${this.name}`);
},
@@ -26,7 +26,7 @@ const NodeHelper = Class.extend({
* Close any open connections, stop any sub-processes and
* gracefully exit the module.
*/
stop() {
stop () {
Log.log(`Stopping module helper: ${this.name}`);
},
@@ -35,7 +35,7 @@ const NodeHelper = Class.extend({
* @param {string} notification The identifier of the notification.
* @param {*} payload The payload of the notification.
*/
socketNotificationReceived(notification, payload) {
socketNotificationReceived (notification, payload) {
Log.log(`${this.name} received a socket notification: ${notification} - Payload: ${payload}`);
},
@@ -43,7 +43,7 @@ const NodeHelper = Class.extend({
* Set the module name.
* @param {string} name Module name.
*/
setName(name) {
setName (name) {
this.name = name;
},
@@ -51,7 +51,7 @@ const NodeHelper = Class.extend({
* Set the module path.
* @param {string} path Module path.
*/
setPath(path) {
setPath (path) {
this.path = path;
},
@@ -61,7 +61,7 @@ const NodeHelper = Class.extend({
* argument notification string - The identifier of the notification.
* argument payload mixed - The payload of the notification.
*/
sendSocketNotification(notification, payload) {
sendSocketNotification (notification, payload) {
this.io.of(this.name).emit(notification, payload);
},
@@ -71,7 +71,7 @@ const NodeHelper = Class.extend({
*
* argument app Express app - The Express app object.
*/
setExpressApp(app) {
setExpressApp (app) {
this.expressApp = app;
app.use(`/${this.name}`, express.static(`${this.path}/public`));
@@ -83,7 +83,7 @@ const NodeHelper = Class.extend({
*
* argument io Socket.io - The Socket io object.
*/
setSocketIO(io) {
setSocketIO (io) {
this.io = io;
Log.log(`Connecting socket for: ${this.name}`);