Skip to content

Commit

Permalink
Bump Biome
Browse files Browse the repository at this point in the history
  • Loading branch information
karniv00l committed Oct 26, 2023
1 parent 0fcdb25 commit 50706bb
Show file tree
Hide file tree
Showing 4 changed files with 57 additions and 58 deletions.
5 changes: 2 additions & 3 deletions biome.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"noConsoleLog": "off"
},
"nursery": {
"all": true,
"useExhaustiveDependencies": "off"
"all": true
},
"complexity": {
"all": true,
Expand All @@ -33,7 +32,7 @@
"enabled": true,
"indentStyle": "space",
"lineWidth": 100,
"indentSize": 2
"indentWidth": 2
},
"javascript": {
"formatter": {
Expand Down
60 changes: 32 additions & 28 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"remark-math": "^3.0.1"
},
"devDependencies": {
"@biomejs/biome": "1.2.2",
"@biomejs/biome": "1.3.1",
"@docusaurus/module-type-aliases": "^2.4.3",
"@tsconfig/docusaurus": "^2.0.2",
"docusaurus-prince-pdf": "^1.2.1",
Expand Down
48 changes: 22 additions & 26 deletions scripts/linkValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,19 @@ const red = (text) => `\x1b[31m${text}\x1b[0m`;
const errors = [];
const wikiUrl = 'wiki.fome.tech';

/**
* Check whether links are adhering to custom rules
* @param {Array<string>} files - List of file names to check
*/
const validateDocRules = (files) => {
/**
* Check whether links are adhering to custom rules
* @param {Array<string>} files - List of file names to check
*/

let fileMatchIndicator = '';
if (files.length === 0) {
console.log('UsageError: no files qualify!');
process.exit(1);
}
if (files.length > 1) {
fileMatchIndicator = `${files.length} files`;
} else {
fileMatchIndicator = files[0];
}
console.log(`Validating rules for URL links in: ${fileMatchIndicator}`);

const fileMatchIndicator = files.length > 1 ? `${files.length} files` : files[0];

console.log(`Validating rules for URL links in: ${fileMatchIndicator}`);

// * Check whether links are not staring with "https://wiki.fome.tech"
// Note: dynamic javascript string interpolation is used here (see https://www.crstin.com/js-regex-interpolation/)
Expand Down Expand Up @@ -79,7 +75,7 @@ const validateDocRules = (files) => {
* Load all md and mdx files from / docs and process them
*/
const main = () => {
// ToDo: add try + catch?
// TODO: add try + catch?
const args = process.argv.slice(2);
const files = glob.sync(args[0]);

Expand All @@ -88,20 +84,20 @@ const main = () => {

if (errors.length === 0) {
console.log('✅ Ok');
} else {
console.log('❌ Failed\n');
console.log(red(`Number of Errors found: ${errors.length}`));
errors.forEach((error) => {
console.log(
`[${error.fileName}]` +
`[Line:${error.lineNo}]` +
`[errType:${error.errType}]` +
`"${error.lineContent.trim()}"`,
);
});

process.exit(2);
process.exit(0);
}

console.log('❌ Failed\n');
console.log(red(`Number of Errors found: ${errors.length}`));
errors.forEach((error) => {
console.log(
`[${error.fileName}][Line:${error.lineNo}][Type:${
error.errType
}]" ${error.lineContent.trim()}"`,
);
});

process.exit(2);
};

// main
Expand Down

0 comments on commit 50706bb

Please sign in to comment.