Add spell check (#3544)

I felt like adding a spell checker, but it's okay if you find it
superfluous. At least then we could fix the found spell issues.

What is still missing is an automatic integration so that the spell
checker does not have to be called manually. Would it perhaps make sense
to always do it before a release?
This commit is contained in:
Kristjan ESPERANTO
2024-09-18 07:37:09 +02:00
committed by GitHub
parent ea3a323581
commit d9f9f41e98
17 changed files with 1338 additions and 46 deletions

View File

@@ -70,7 +70,7 @@ function checkConfigFile () {
Log.info("Checking modules structure configuration... ");
const position_list = Utils.getModulePositions();
// Make Ajv schema confguration of modules config
// Make Ajv schema configuration of modules config
// only scan "module" and "position"
const schema = {
type: "object",

View File

@@ -286,9 +286,9 @@ const MM = (function () {
Log.debug(`${module.identifier} Force remove animateIn (in hide): ${module.hasAnimateIn}`);
module.hasAnimateIn = false;
}
// haveAnimateName for verify if we are using AninateCSS library
// haveAnimateName for verify if we are using AnimateCSS library
// we check AnimateCSSOut Array for validate it
// and finaly return the animate name or `null` (for default MM² animation)
// and finally return the animate name or `null` (for default MM² animation)
let haveAnimateName = null;
// check if have valid animateOut in module definition (module.data.animateOut)
if (module.data.animateOut && AnimateCSSOut.indexOf(module.data.animateOut) !== -1) haveAnimateName = module.data.animateOut;
@@ -357,7 +357,7 @@ const MM = (function () {
}
}
// Check if there are no more lockstrings set, or the force option is set.
// Check if there are no more lockStrings set, or the force option is set.
// Otherwise cancel show action.
if (module.lockStrings.length !== 0 && options.force !== true) {
Log.log(`Will not show ${module.name}. LockStrings active: ${module.lockStrings.join(",")}`);
@@ -380,7 +380,7 @@ const MM = (function () {
module.hidden = false;
// If forced show, clean current lockstrings.
// If forced show, clean current lockStrings.
if (module.lockStrings.length !== 0 && options.force === true) {
Log.log(`Force show of module: ${module.name}`);
module.lockStrings = [];
@@ -390,9 +390,9 @@ const MM = (function () {
if (moduleWrapper !== null) {
clearTimeout(module.showHideTimer);
// haveAnimateName for verify if we are using AninateCSS library
// haveAnimateName for verify if we are using AnimateCSS library
// we check AnimateCSSIn Array for validate it
// and finaly return the animate name or `null` (for default MM² animation)
// and finally return the animate name or `null` (for default MM² animation)
let haveAnimateName = null;
// check if have valid animateOut in module definition (module.data.animateIn)
if (module.data.animateIn && AnimateCSSIn.indexOf(module.data.animateIn) !== -1) haveAnimateName = module.data.animateIn;
@@ -702,7 +702,7 @@ const MM = (function () {
showModule(module, speed, callback, options);
},
// return all available module postions.
// Return all available module positions.
getAvailableModulePositions: modulePositions
};
}());

View File

@@ -45,12 +45,12 @@ async function cors (req, res) {
url = match[1];
const headersToSend = getHeadersToSend(req.url);
const expectedRecievedHeaders = geExpectedRecievedHeaders(req.url);
const expectedReceivedHeaders = geExpectedReceivedHeaders(req.url);
Log.log(`cors url: ${url}`);
const response = await fetch(url, { headers: headersToSend });
for (const header of expectedRecievedHeaders) {
for (const header of expectedReceivedHeaders) {
const headerValue = response.headers.get(header);
if (header) res.set(header, headerValue);
}
@@ -89,16 +89,16 @@ function getHeadersToSend (url) {
* @param {string} url - The url containing the expected headers from the response.
* @returns {string[]} headers - The name of the expected headers.
*/
function geExpectedRecievedHeaders (url) {
const expectedRecievedHeaders = ["Content-Type"];
const expectedRecievedHeadersMatch = new RegExp("expectedheaders=(.+?)(&|$)", "g").exec(url);
if (expectedRecievedHeadersMatch) {
const headers = expectedRecievedHeadersMatch[1].split(",");
function geExpectedReceivedHeaders (url) {
const expectedReceivedHeaders = ["Content-Type"];
const expectedReceivedHeadersMatch = new RegExp("expectedheaders=(.+?)(&|$)", "g").exec(url);
if (expectedReceivedHeadersMatch) {
const headers = expectedReceivedHeadersMatch[1].split(",");
for (const header of headers) {
expectedRecievedHeaders.push(header);
expectedReceivedHeaders.push(header);
}
}
return expectedRecievedHeaders;
return expectedReceivedHeaders;
}
/**

View File

@@ -15,14 +15,14 @@ const Translator = (function () {
xhr.onreadystatechange = function () {
if (xhr.readyState === 4 && xhr.status === 200) {
// needs error handler try/catch at least
let fileinfo = null;
let fileInfo = null;
try {
fileinfo = JSON.parse(xhr.responseText);
fileInfo = JSON.parse(xhr.responseText);
} catch (exception) {
// nothing here, but don't die
Log.error(` loading json file =${file} failed`);
}
resolve(fileinfo);
resolve(fileInfo);
}
};
xhr.send(null);

View File

@@ -42,7 +42,7 @@ module.exports = {
return modulePositions;
},
// return if postion is on modulePositions Array (true/false)
// return if position is on modulePositions Array (true/false)
moduleHasValidPosition (position) {
if (this.getAvailableModulePositions().indexOf(position) === -1) return false;
return true;
@@ -57,7 +57,7 @@ module.exports = {
const results = regionRegEx.exec(line);
// if the regex returned something
if (results && results.length > 0) {
// get the postition parts and replace space with underscore
// get the position parts and replace space with underscore
const positionName = results[1].replace(" ", "_");
// add it to the list
modulePositions.push(positionName);