From 5b11d9fa31e6588ed530559d2f65c07eb0a1672a Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 29 Jan 2019 11:21:21 -0600 Subject: [PATCH 1/3] Docs: Fixes incorrect example This commit also updates the documentation for the parameters to include the fact that the first parameter is the rule setting and not a global to be restricted. --- docs/rules/no-restricted-globals.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/rules/no-restricted-globals.md b/docs/rules/no-restricted-globals.md index e3d612412e1..b9ee4b1f8ee 100644 --- a/docs/rules/no-restricted-globals.md +++ b/docs/rules/no-restricted-globals.md @@ -13,7 +13,7 @@ This rule allows you to specify global variable names that you don't want to use ## Options -This rule takes a list of strings, where each string is a global to be restricted: +This rule takes a list of strings. The first string is the rule setting, such as "off", "warn", or "error". The strings after the rule setting is a global to be restricted: ```json { @@ -77,7 +77,7 @@ Examples of **incorrect** code for a sample `"event"` global variable name, alon ```js /*global event*/ -/* eslint no-restricted-globals: ["error", { name: "error", message: "Use local parameter instead." }] */ +/* eslint no-restricted-globals: ["error", { name: "event", message: "Use local parameter instead." }] */ function onClick() { console.log(event); // Unexpected global variable 'event'. Use local parameter instead. From 3ec7290cc38dff868d9097e2c6a2dc0ad56b9554 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 29 Jan 2019 11:27:32 -0600 Subject: [PATCH 2/3] Docs: update to have sv agreement --- docs/rules/no-restricted-globals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rules/no-restricted-globals.md b/docs/rules/no-restricted-globals.md index b9ee4b1f8ee..37dd4d0f207 100644 --- a/docs/rules/no-restricted-globals.md +++ b/docs/rules/no-restricted-globals.md @@ -13,7 +13,7 @@ This rule allows you to specify global variable names that you don't want to use ## Options -This rule takes a list of strings. The first string is the rule setting, such as "off", "warn", or "error". The strings after the rule setting is a global to be restricted: +This rule takes a list of strings. The first string is the rule setting, such as "off", "warn", or "error". The strings after the rule setting are the globals to be restricted: ```json { From 407a686e9c45a9c5c1f10d104884ddd1157787b6 Mon Sep 17 00:00:00 2001 From: michael Date: Tue, 29 Jan 2019 11:48:40 -0600 Subject: [PATCH 3/3] minor wording update --- docs/rules/no-restricted-globals.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rules/no-restricted-globals.md b/docs/rules/no-restricted-globals.md index 37dd4d0f207..c7d216f5b55 100644 --- a/docs/rules/no-restricted-globals.md +++ b/docs/rules/no-restricted-globals.md @@ -13,7 +13,7 @@ This rule allows you to specify global variable names that you don't want to use ## Options -This rule takes a list of strings. The first string is the rule setting, such as "off", "warn", or "error". The strings after the rule setting are the globals to be restricted: +This rule takes a list of strings. The first string is the rule setting, such as "off", "warn", or "error". Each string after the rule setting is a global to be restricted: ```json {