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

@@ -7,22 +7,22 @@ const Log = require("logger");
const BASE_DIR = path.normalize(`${__dirname}/../../../`);
class GitHelper {
constructor() {
constructor () {
this.gitRepos = [];
this.gitResultList = [];
}
getRefRegex(branch) {
getRefRegex (branch) {
return new RegExp(`s*([a-z,0-9]+[.][.][a-z,0-9]+) ${branch}`, "g");
}
async execShell(command) {
async execShell (command) {
const { stdout = "", stderr = "" } = await exec(command);
return { stdout, stderr };
}
async isGitRepo(moduleFolder) {
async isGitRepo (moduleFolder) {
const { stderr } = await this.execShell(`cd ${moduleFolder} && git remote -v`);
if (stderr) {
@@ -34,7 +34,7 @@ class GitHelper {
return true;
}
async add(moduleName) {
async add (moduleName) {
let moduleFolder = BASE_DIR;
if (moduleName !== "MagicMirror") {
@@ -59,7 +59,7 @@ class GitHelper {
}
}
async getStatusInfo(repo) {
async getStatusInfo (repo) {
let gitInfo = {
module: repo.module,
behind: 0, // commits behind
@@ -114,7 +114,7 @@ class GitHelper {
return gitInfo;
}
async getRepoInfo(repo) {
async getRepoInfo (repo) {
const gitInfo = await this.getStatusInfo(repo);
if (!gitInfo || !gitInfo.current) {
@@ -174,7 +174,7 @@ class GitHelper {
}
}
async getRepos() {
async getRepos () {
this.gitResultList = [];
for (const repo of this.gitRepos) {
@@ -192,7 +192,7 @@ class GitHelper {
return this.gitResultList;
}
async checkUpdates() {
async checkUpdates () {
var updates = [];
const allRepos = await this.gitResultList.map((module) => {