Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit

Permalink
fix: formatter
Browse files Browse the repository at this point in the history
  • Loading branch information
GiandonatoGreco committed Nov 28, 2024
1 parent 741a0ea commit 9301c95
Show file tree
Hide file tree
Showing 56 changed files with 275 additions and 277 deletions.
2 changes: 1 addition & 1 deletion docs/README-comuni-Linux.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion docs/README-comuni-Windows.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion docs/README-comuni-macOS.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion docs/README-scuole-Linux.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion docs/README-scuole-Windows.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta charset="utf-8" />
Expand Down
2 changes: 1 addition & 1 deletion docs/README-scuole-macOS.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html xmlns="http://www.w3.org/1999/xhtml" lang="it" xml:lang="it">
<head>
<meta charset="utf-8" />
Expand Down
8 changes: 4 additions & 4 deletions src/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,21 +100,21 @@ try {
dest,
`report-${hostname}-${dateFormat(
currentDate,
"UTC:yyyymmdd'T'HHMMss'Z'"
"UTC:yyyymmdd'T'HHMMss'Z'",
)}-v${version}`,
true,
accuracy === "custom" ? "all" : accuracy,
undefined,
numberOfServicePages
numberOfServicePages,
);

console.log();
console.log();
console.log(
"[--L'analisi è terminata. Il report si aprirà automaticamente nel tuo browser--]"
"[--L'analisi è terminata. Il report si aprirà automaticamente nel tuo browser--]",
);
console.log(
`Se non dovesse aprirsi, una copia HTML e JSON del report è stata salvata nella cartella ${dest}}`
`Se non dovesse aprirsi, una copia HTML e JSON del report è stata salvata nella cartella ${dest}}`,
);
} catch (e) {
console.error(e);
Expand Down
2 changes: 1 addition & 1 deletion src/audits/common/informative/ipLocationAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class LoadAudit extends Audit {
result:
"Questo audit produce un risultato solo quando viene effettuato su un sito pubblicato online.",
},
]
],
),
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/audits/common/ipLocationAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class LoadAudit extends Audit {
}

static async audit(
artifacts: LH.Artifacts & { hostname: string }
artifacts: LH.Artifacts & { hostname: string },
): Promise<{ score: number; details: LH.Audit.Details.Table }> {
const hostname = artifacts.hostname;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class LoadAudit extends Audit {
static async audit(
artifacts: LH.Artifacts & {
origin: string;
}
},
): Promise<{ score: number; details: LH.Audit.Details.Table }> {
const url = artifacts.origin;
let score = 0;
Expand Down Expand Up @@ -81,7 +81,7 @@ class LoadAudit extends Audit {
const $: CheerioAPI = await loadPageData(url);

const accessibilityDeclarationElement = $("footer").find(
'[data-element="accessibility-link"]'
'[data-element="accessibility-link"]',
);
const elementObj = $(accessibilityDeclarationElement).attr();
items[0].link_name = accessibilityDeclarationElement.text().trim() ?? "";
Expand Down
12 changes: 6 additions & 6 deletions src/audits/municipality/bookingAppointmentAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class LoadAudit extends Audit {
}

static async audit(
artifacts: LH.Artifacts & { origin: string }
artifacts: LH.Artifacts & { origin: string },
): Promise<LH.Audit.ProductBase> {
const url = artifacts.origin;

Expand Down Expand Up @@ -101,7 +101,7 @@ class LoadAudit extends Audit {
{
result: notExecutedErrorMessage.replace("<LIST>", ex.message),
},
]
],
),
};
}
Expand All @@ -127,7 +127,7 @@ class LoadAudit extends Audit {
numberOfPages: 1,
},
],
false
false,
);

if (bookingAppointmentPage.length === 0) {
Expand All @@ -146,7 +146,7 @@ class LoadAudit extends Audit {
{
result: notExecutedErrorMessage.replace("<LIST>", ex.message),
},
]
],
),
};
}
Expand All @@ -163,7 +163,7 @@ class LoadAudit extends Audit {
let errorMessage = ex.message;
errorMessage = errorMessage.substring(
errorMessage.indexOf('"') + 1,
errorMessage.lastIndexOf('"')
errorMessage.lastIndexOf('"'),
);
pagesInError.push({
inspected_page: pageToBeAnalyzed,
Expand All @@ -180,7 +180,7 @@ class LoadAudit extends Audit {

const bookingAppointmentServicePage = await getPrimaryPageUrl(
pageToBeAnalyzed,
"appointment-booking"
"appointment-booking",
);

if (bookingAppointmentServicePage === "") {
Expand Down
14 changes: 7 additions & 7 deletions src/audits/municipality/bootstrapItaliaDoubleCheckAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ class LoadAudit extends Audit {
static async audit(
artifacts: LH.Artifacts & {
origin: string;
}
},
): Promise<LH.Audit.ProductBase> {
const url = artifacts.origin;

Expand Down Expand Up @@ -132,7 +132,7 @@ class LoadAudit extends Audit {
{
result: notExecutedErrorMessage.replace("<LIST>", ex.message),
},
]
],
),
};
}
Expand Down Expand Up @@ -177,7 +177,7 @@ class LoadAudit extends Audit {
const res = await gotoRetry(
page,
pageToBeAnalyzed,
errorHandling.gotoRetryTentative
errorHandling.gotoRetryTentative,
);
console.log(res?.url(), res?.status());

Expand All @@ -186,7 +186,7 @@ class LoadAudit extends Audit {
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
//@ts-ignore
return window.BOOTSTRAP_ITALIA_VERSION || null;
}
},
);

if (bootstrapItaliaVariableVersion !== null)
Expand All @@ -200,10 +200,10 @@ class LoadAudit extends Audit {
//@ts-ignore
return (
getComputedStyle(document.body).getPropertyValue(
"--bootstrap-italia-version"
"--bootstrap-italia-version",
) || null
);
}
},
);

if (bootstrapItaliaSelectorVariableVersion !== null)
Expand Down Expand Up @@ -270,7 +270,7 @@ class LoadAudit extends Audit {
}

const percentage = Math.round(
(correctClasses.length / baseClasses.length) * 100
(correctClasses.length / baseClasses.length) * 100,
);
item.classes_found = percentage + "%";
if (percentage < 30) {
Expand Down
8 changes: 4 additions & 4 deletions src/audits/municipality/contactsAssistencyAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LoadAudit extends Audit {
}

static async audit(
artifacts: LH.Artifacts & { origin: string }
artifacts: LH.Artifacts & { origin: string },
): Promise<LH.Audit.ProductBase> {
const url = artifacts.origin;

Expand Down Expand Up @@ -99,7 +99,7 @@ class LoadAudit extends Audit {
{
result: notExecutedErrorMessage.replace("<LIST>", ex.message),
},
]
],
),
};
}
Expand All @@ -122,7 +122,7 @@ class LoadAudit extends Audit {
let errorMessage = ex.message;
errorMessage = errorMessage.substring(
errorMessage.indexOf('"') + 1,
errorMessage.lastIndexOf('"')
errorMessage.lastIndexOf('"'),
);

pagesInError.push({
Expand All @@ -141,7 +141,7 @@ class LoadAudit extends Audit {
const indexList = await getPageElementDataAttribute(
$,
'[data-element="page-index"]',
"> li > a"
"> li > a",
);

if (indexList.includes("Contatti")) {
Expand Down
14 changes: 7 additions & 7 deletions src/audits/municipality/controlledVocabulariesAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class LoadAudit extends lighthouse.Audit {
}

static async audit(
artifacts: LH.Artifacts & { origin: string }
artifacts: LH.Artifacts & { origin: string },
): Promise<{ score: number; details: LH.Audit.Details.Table }> {
const url = artifacts.origin;

Expand Down Expand Up @@ -82,7 +82,7 @@ class LoadAudit extends lighthouse.Audit {
let $ = await loadPageData(url);
const allArgumentsHREF = await getHREFValuesDataAttribute(
$,
'[data-element="all-topics"]'
'[data-element="all-topics"]',
);
if (allArgumentsHREF.length <= 0) {
item[0].result = notExecutedErrorMessage.replace("<LIST>", "`all-topics");
Expand All @@ -103,7 +103,7 @@ class LoadAudit extends lighthouse.Audit {
$ = await loadPageData(allArgumentsPageUrl);
const argumentList = await getPageElementDataAttribute(
$,
'[data-element="topic-element"]'
'[data-element="topic-element"]',
);

if (argumentList.length === 0) {
Expand All @@ -115,15 +115,15 @@ class LoadAudit extends lighthouse.Audit {

const elementInfoMunicipalityVocabulary = await areAllElementsInVocabulary(
argumentList,
municipalityModelVocabulary
municipalityModelVocabulary,
);

const elementInMunicipalityModelPercentage = parseInt(
(
(elementInfoMunicipalityVocabulary.elementIncluded.length /
argumentList.length) *
100
).toFixed(0)
).toFixed(0),
);

const lowerCaseEurovoc = eurovocVocabulary.map((element) => {
Expand All @@ -136,15 +136,15 @@ class LoadAudit extends lighthouse.Audit {

const elementInUnionVocabulary = await areAllElementsInVocabulary(
argumentList,
uniq
uniq,
);

const elementInUnionVocabularyPercentage = parseInt(
(
(elementInUnionVocabulary.elementIncluded.length /
argumentList.length) *
100
).toFixed(0)
).toFixed(0),
);

if (elementInfoMunicipalityVocabulary.allArgumentsInVocabulary) {
Expand Down
6 changes: 3 additions & 3 deletions src/audits/municipality/cookieDomainCheckAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class LoadAudit extends Audit {
}

static async audit(
artifacts: LH.Artifacts & { origin: string }
artifacts: LH.Artifacts & { origin: string },
): Promise<LH.Audit.ProductBase> {
const url = artifacts.origin;
const titleSubHeadings = [
Expand Down Expand Up @@ -121,7 +121,7 @@ class LoadAudit extends Audit {
{
result: notExecutedErrorMessage.replace("<LIST>", ex.message),
},
]
],
),
};
}
Expand All @@ -145,7 +145,7 @@ class LoadAudit extends Audit {
let errorMessage = ex.message;
errorMessage = errorMessage.substring(
errorMessage.indexOf('"') + 1,
errorMessage.lastIndexOf('"')
errorMessage.lastIndexOf('"'),
);

pagesInError.push({
Expand Down
6 changes: 3 additions & 3 deletions src/audits/municipality/domainAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class LoadAudit extends Audit {
}

static async audit(
artifacts: LH.Artifacts & { origin: string }
artifacts: LH.Artifacts & { origin: string },
): Promise<{ score: number; details: LH.Audit.Details.Table }> {
const url = artifacts.origin;

Expand Down Expand Up @@ -111,7 +111,7 @@ class LoadAudit extends Audit {
numberOfPages: 1,
},
],
false
false,
)),
];

Expand Down Expand Up @@ -141,7 +141,7 @@ class LoadAudit extends Audit {
{
result: notExecutedErrorMessage.replace("<LIST>", ex.message),
},
]
],
),
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/audits/municipality/faqAudit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class LoadAudit extends Audit {
}

static async audit(
artifacts: LH.Artifacts & { origin: string }
artifacts: LH.Artifacts & { origin: string },
): Promise<{ score: number; details: LH.Audit.Details.Table }> {
const url = artifacts.origin;

Expand Down
Loading

0 comments on commit 9301c95

Please sign in to comment.