From b168c720eef41c8f64264388b1c62b4f277e6c8e Mon Sep 17 00:00:00 2001 From: Daniel Halasz Date: Wed, 6 Mar 2024 12:20:37 +0100 Subject: [PATCH] linting of md files fixed --- .markdownlint.jsonc | 19 ++-- 02-just-enough-dom/README.md | 100 +++++++++--------- .../1-isolate/6-for-loops/README.md | 46 ++++---- 07-using-functions/README.md | 12 +-- 08-arrays/3-integrate/README.md | 12 +-- .../3-implicit-return/README.md | 2 +- lesson-plans/for-loops/README.md | 46 ++++---- lib/dom-io/DOCS.md | 46 ++++---- package-lock.json | 14 --- 9 files changed, 143 insertions(+), 154 deletions(-) diff --git a/.markdownlint.jsonc b/.markdownlint.jsonc index b7f0923..fbe8a94 100644 --- a/.markdownlint.jsonc +++ b/.markdownlint.jsonc @@ -172,7 +172,15 @@ // MD033/no-inline-html - Inline HTML "MD033": { // Allowed elements - "allowed_elements": ["summary", "details", "br", "strong", "code", "a"] + "allowed_elements": [ + "summary", + "details", + "br", + "strong", + "code", + "a", + "sup" + ] }, // MD034/no-bare-urls - Bare URL used @@ -200,15 +208,10 @@ "MD039": true, // MD040/fenced-code-language - Fenced code blocks should have a language specified - "MD040": true, + "MD040": false, // MD041/first-line-heading/first-line-h1 - First line in a file should be a top-level heading - "MD041": { - // Heading level - "level": 1, - // RegExp for matching title in front matter - "front_matter_title": "^\\s*title\\s*[:=]" - }, + "MD041": false, // MD042/no-empty-links - No empty links "MD042": true, diff --git a/02-just-enough-dom/README.md b/02-just-enough-dom/README.md index db963c0..16dda63 100644 --- a/02-just-enough-dom/README.md +++ b/02-just-enough-dom/README.md @@ -87,14 +87,14 @@ output, and defining user interactions with event listeners. ```html
- +
``` @@ -111,20 +111,20 @@ the syntax below and will have more freedom when writing your programs. ```html
- +
``` @@ -137,22 +137,22 @@ module's examples and exercises. ```html
- -
- + +
+
``` @@ -164,29 +164,29 @@ information to a user with the DOM, and more than enough for this module. ```html
- -
- + +
+ -
+
-

+ 

 
``` @@ -207,8 +207,8 @@ humans to know the file's purpose: ``` /exercise-name - /index.html - /script.js - /script.re.js - /styles.css + /index.html + /script.js + /script.re.js + /styles.css ``` diff --git a/03-control-flow/1-isolate/6-for-loops/README.md b/03-control-flow/1-isolate/6-for-loops/README.md index 1f899a7..eba0e67 100644 --- a/03-control-flow/1-isolate/6-for-loops/README.md +++ b/03-control-flow/1-isolate/6-for-loops/README.md @@ -16,7 +16,7 @@ conventionally used? ```js for (initialization; condition; finalExpression) { - // ... loop body ... + // ... loop body ... } ``` @@ -37,15 +37,15 @@ The correct answer is `2`: ```js for ( - // 2: declare and assign the `step` variable - let step = 0; // initialization - // 3, 6, 9, 12: check if `step` is less than 3 - step < 3; // condition - // 5, 8, 11: add 1 to `step` - step++ // finalExpression + // 2: declare and assign the `step` variable + let step = 0; // initialization + // 3, 6, 9, 12: check if `step` is less than 3 + step < 3; // condition + // 5, 8, 11: add 1 to `step` + step++ // finalExpression ) { - // 4, 7, 10: log the current value of `step` - console.log(step); + // 4, 7, 10: log the current value of `step` + console.log(step); } ``` @@ -74,14 +74,14 @@ let max = 3; let step = 0; // condition while (step < max) { - console.log(step); - // final expression - step = step + 1; + console.log(step); + // final expression + step = step + 1; } // initialization; condition; finalExpression for (let step = 0; step < max; step++) { - console.log(step); + console.log(step); } ``` @@ -91,7 +91,7 @@ _variables_ button): ```js for (let step = 0; step < 3; step++) { - console.log(step); + console.log(step); } step; // ReferenceError @@ -122,13 +122,13 @@ let totalRepetitions = 4; let repeatedString = ''; for (let i = 0; i < totalRepetitions; i++) { - repeatedString += toRepeat; - console.log('repeatedString:', repeatedString); + repeatedString += toRepeat; + console.log('repeatedString:', repeatedString); } console.assert( - repeatedString === 'howdyhowdyhowdyhowdy', - '"howdy" should be repeated 4 times', + repeatedString === 'howdyhowdyhowdyhowdy', + '"howdy" should be repeated 4 times', ); ``` @@ -149,14 +149,14 @@ let reversedString = ''; console.log('reversedString:', reversedString); for (_; _; _) { - let nextLetter = _; - reversedString = _ + _; - console.log('reversedString:', reversedString); + let nextLetter = _; + reversedString = _ + _; + console.log('reversedString:', reversedString); } console.assert( - reversedString === 'mlkj', - 'reversed string is the original reversed', + reversedString === 'mlkj', + 'reversed string is the original reversed', ); ``` diff --git a/07-using-functions/README.md b/07-using-functions/README.md index cc9876c..2a70fc7 100644 --- a/07-using-functions/README.md +++ b/07-using-functions/README.md @@ -75,11 +75,11 @@ use functions (remember zooming in and zooming out?): * @returns {string} the reversed text */ const reverseString = (text = '') => { - let backwards = ''; - for (const character of text) { - backwards = character + backwards; - } - return backwards; + let backwards = ''; + for (const character of text) { + backwards = character + backwards; + } + return backwards; }; console.assert(reverseString('') === '', 'Test 1'); console.assert(reverseString('1234') === '4321', 'Test 2'); @@ -92,7 +92,7 @@ console.assert(reverseString('ooo') === 'ooo', 'Test 5'); // -- gather user input -- let input = null; while (input === null) { - input = prompt('enter some text to reverse'); + input = prompt('enter some text to reverse'); } // -- use your program logic -- diff --git a/08-arrays/3-integrate/README.md b/08-arrays/3-integrate/README.md index 0f20c76..d863fb6 100644 --- a/08-arrays/3-integrate/README.md +++ b/08-arrays/3-integrate/README.md @@ -75,11 +75,11 @@ use functions (remember zooming in and zooming out?): * @returns {string} the reversed text */ const reverseString = (text = '') => { - let backwards = ''; - for (const character of text) { - backwards = character + backwards; - } - return backwards; + let backwards = ''; + for (const character of text) { + backwards = character + backwards; + } + return backwards; }; console.assert(reverseString('') === '', 'Test 1'); console.assert(reverseString('1234') === '4321', 'Test 2'); @@ -92,7 +92,7 @@ console.assert(reverseString('ooo') === 'ooo', 'Test 5'); // -- gather user input -- let input = null; while (input === null) { - input = prompt('enter some text to reverse'); + input = prompt('enter some text to reverse'); } // -- use your program logic -- diff --git a/09-functional-array-methods/3-implicit-return/README.md b/09-functional-array-methods/3-implicit-return/README.md index 35c1ba7..73cc95d 100644 --- a/09-functional-array-methods/3-implicit-return/README.md +++ b/09-functional-array-methods/3-implicit-return/README.md @@ -15,7 +15,7 @@ to that. // these two functions do exactly the same thing! const explicitReturn = (a, b) => { - return a + b; + return a + b; }; const implicitReturn = (a, b) => a + b; diff --git a/lesson-plans/for-loops/README.md b/lesson-plans/for-loops/README.md index 1f899a7..eba0e67 100644 --- a/lesson-plans/for-loops/README.md +++ b/lesson-plans/for-loops/README.md @@ -16,7 +16,7 @@ conventionally used? ```js for (initialization; condition; finalExpression) { - // ... loop body ... + // ... loop body ... } ``` @@ -37,15 +37,15 @@ The correct answer is `2`: ```js for ( - // 2: declare and assign the `step` variable - let step = 0; // initialization - // 3, 6, 9, 12: check if `step` is less than 3 - step < 3; // condition - // 5, 8, 11: add 1 to `step` - step++ // finalExpression + // 2: declare and assign the `step` variable + let step = 0; // initialization + // 3, 6, 9, 12: check if `step` is less than 3 + step < 3; // condition + // 5, 8, 11: add 1 to `step` + step++ // finalExpression ) { - // 4, 7, 10: log the current value of `step` - console.log(step); + // 4, 7, 10: log the current value of `step` + console.log(step); } ``` @@ -74,14 +74,14 @@ let max = 3; let step = 0; // condition while (step < max) { - console.log(step); - // final expression - step = step + 1; + console.log(step); + // final expression + step = step + 1; } // initialization; condition; finalExpression for (let step = 0; step < max; step++) { - console.log(step); + console.log(step); } ``` @@ -91,7 +91,7 @@ _variables_ button): ```js for (let step = 0; step < 3; step++) { - console.log(step); + console.log(step); } step; // ReferenceError @@ -122,13 +122,13 @@ let totalRepetitions = 4; let repeatedString = ''; for (let i = 0; i < totalRepetitions; i++) { - repeatedString += toRepeat; - console.log('repeatedString:', repeatedString); + repeatedString += toRepeat; + console.log('repeatedString:', repeatedString); } console.assert( - repeatedString === 'howdyhowdyhowdyhowdy', - '"howdy" should be repeated 4 times', + repeatedString === 'howdyhowdyhowdyhowdy', + '"howdy" should be repeated 4 times', ); ``` @@ -149,14 +149,14 @@ let reversedString = ''; console.log('reversedString:', reversedString); for (_; _; _) { - let nextLetter = _; - reversedString = _ + _; - console.log('reversedString:', reversedString); + let nextLetter = _; + reversedString = _ + _; + console.log('reversedString:', reversedString); } console.assert( - reversedString === 'mlkj', - 'reversed string is the original reversed', + reversedString === 'mlkj', + 'reversed string is the original reversed', ); ``` diff --git a/lib/dom-io/DOCS.md b/lib/dom-io/DOCS.md index dc2f492..485c200 100644 --- a/lib/dom-io/DOCS.md +++ b/lib/dom-io/DOCS.md @@ -52,7 +52,7 @@ When the user change's the form data, the code in your handler will be executed. // log the user's favorite number each time they change the input whenFormDataChanges('user-data', () => { - console.log('you just changed the form data!'); + console.log('you just changed the form data!'); }); ``` @@ -90,22 +90,22 @@ This function supports these HTML elements: ```html
- - - - -
- - - -
- - - + + + + +
+ + + +
+ + +
``` @@ -129,8 +129,8 @@ This function supports these HTML elements: ```html
- - + +
``` @@ -154,11 +154,11 @@ This function supports these HTML elements: ```html
- - + + - - + +
``` diff --git a/package-lock.json b/package-lock.json index 7b762e3..8e820e0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -6827,20 +6827,6 @@ "is-typedarray": "^1.0.0" } }, - "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", - "dev": true, - "peer": true, - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, - "engines": { - "node": ">=12.20" - } - }, "node_modules/uc.micro": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz",