Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Add function call example for no-undefined #16712

Merged
merged 6 commits into from Dec 27, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/src/rules/no-undefined.md
Expand Up @@ -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
elliot-huffman marked this conversation as resolved.
Show resolved Hide resolved
elliot-huffman marked this conversation as resolved.
Show resolved Hide resolved
bar(undefined, "lorem");
```

:::
Expand All @@ -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
elliot-huffman marked this conversation as resolved.
Show resolved Hide resolved
elliot-huffman marked this conversation as resolved.
Show resolved Hide resolved
bar(void 0, "lorem");
```

:::
Expand Down