From f25156b234e00c837a403155697309eb1194504d Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 26 Dec 2022 14:36:52 -0500 Subject: [PATCH 1/6] docs: Add Function Call Example Add a function call example on how to skip parameters the safe way --- docs/src/rules/no-undefined.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/docs/src/rules/no-undefined.md b/docs/src/rules/no-undefined.md index fa089974239..60fb0687d3b 100644 --- a/docs/src/rules/no-undefined.md +++ b/docs/src/rules/no-undefined.md @@ -57,6 +57,14 @@ if (foo === undefined) { function foo(undefined) { // ... } + +// Function creation with parameter +function bar(baz, qux) { + // ... +} + +// Using function with improper refrence to the global undefined value to attempt to skip the first parameter +bar(undefined, "lorem"); ``` ::: @@ -77,6 +85,14 @@ if (typeof foo === "undefined") { } global.undefined = "foo"; + +// Function creation with parameter +function bar(baz, qux) { + // ... +} + +// Using function wihtout refrencing the global undefined +bar(void 0, "lorem"); ``` ::: From 7d3e51f96456538b0edc22c51c5a4ec9ec87b904 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 26 Dec 2022 15:08:32 -0500 Subject: [PATCH 2/6] Update docs/src/rules/no-undefined.md thx for the spelling fixes Co-authored-by: Amaresh S M --- docs/src/rules/no-undefined.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/rules/no-undefined.md b/docs/src/rules/no-undefined.md index 60fb0687d3b..e6ed2c38688 100644 --- a/docs/src/rules/no-undefined.md +++ b/docs/src/rules/no-undefined.md @@ -63,7 +63,7 @@ function bar(baz, qux) { // ... } -// Using function with improper refrence to the global undefined value to attempt to skip the first parameter +// Using a function with improper reference to the undefined global value to attempt to skip the first parameter bar(undefined, "lorem"); ``` From c8dd92f696bd3a83d7d97a8e941206bb9aef3043 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 26 Dec 2022 15:08:46 -0500 Subject: [PATCH 3/6] Update docs/src/rules/no-undefined.md thx for the spelling fixes Co-authored-by: Amaresh S M --- docs/src/rules/no-undefined.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/src/rules/no-undefined.md b/docs/src/rules/no-undefined.md index e6ed2c38688..e955c26b758 100644 --- a/docs/src/rules/no-undefined.md +++ b/docs/src/rules/no-undefined.md @@ -91,7 +91,7 @@ function bar(baz, qux) { // ... } -// Using function wihtout refrencing the global undefined +// Using function without referencing the global undefined bar(void 0, "lorem"); ``` From 66996b13e0f311c9aacb40fff0c44be9f618f914 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 26 Dec 2022 15:14:33 -0500 Subject: [PATCH 4/6] Remove Function Def Remove the function definition to reduce docs complexity. --- docs/src/rules/no-undefined.md | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/docs/src/rules/no-undefined.md b/docs/src/rules/no-undefined.md index e955c26b758..a74b00ae7fc 100644 --- a/docs/src/rules/no-undefined.md +++ b/docs/src/rules/no-undefined.md @@ -58,11 +58,6 @@ function foo(undefined) { // ... } -// Function creation with parameter -function bar(baz, qux) { - // ... -} - // Using a function with improper reference to the undefined global value to attempt to skip the first parameter bar(undefined, "lorem"); ``` @@ -86,12 +81,7 @@ if (typeof foo === "undefined") { global.undefined = "foo"; -// Function creation with parameter -function bar(baz, qux) { - // ... -} - -// Using function without referencing the global undefined +// Using function without referencing the global undefined value bar(void 0, "lorem"); ``` From c24fea1406dd5b2eeb58a09234a72e94d3dd52c8 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 26 Dec 2022 15:31:23 -0500 Subject: [PATCH 5/6] Simplify wording Simplify the wording of the comments. --- docs/src/rules/no-undefined.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/rules/no-undefined.md b/docs/src/rules/no-undefined.md index a74b00ae7fc..b01a4298a5a 100644 --- a/docs/src/rules/no-undefined.md +++ b/docs/src/rules/no-undefined.md @@ -58,7 +58,7 @@ function foo(undefined) { // ... } -// Using a function with improper reference to the undefined global value to attempt to skip the first parameter +// Skips the first parameter bar(undefined, "lorem"); ``` @@ -81,7 +81,7 @@ if (typeof foo === "undefined") { global.undefined = "foo"; -// Using function without referencing the global undefined value +// Skips the first parameter bar(void 0, "lorem"); ``` From 9bd79005b73fb919b52b3f6aa02753d220e9f046 Mon Sep 17 00:00:00 2001 From: Elliot Huffman Date: Mon, 26 Dec 2022 16:59:37 -0500 Subject: [PATCH 6/6] No comments it is after much deliberation, the committee has decreed that there shall be no comments on the new examples! --- docs/src/rules/no-undefined.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/src/rules/no-undefined.md b/docs/src/rules/no-undefined.md index b01a4298a5a..9b0be204b2f 100644 --- a/docs/src/rules/no-undefined.md +++ b/docs/src/rules/no-undefined.md @@ -58,7 +58,6 @@ function foo(undefined) { // ... } -// Skips the first parameter bar(undefined, "lorem"); ``` @@ -81,7 +80,6 @@ if (typeof foo === "undefined") { global.undefined = "foo"; -// Skips the first parameter bar(void 0, "lorem"); ```