From b2f1ba0c13fe91f9b2f091dad0034bea56ac5e96 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Thu, 13 Dec 2018 17:20:48 +0800 Subject: [PATCH 1/2] Docs: add a note for no-unused-expressions (fixes #11169) --- docs/rules/no-unused-expressions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rules/no-unused-expressions.md b/docs/rules/no-unused-expressions.md index 480915ee223..e777441ed09 100644 --- a/docs/rules/no-unused-expressions.md +++ b/docs/rules/no-unused-expressions.md @@ -2,7 +2,7 @@ An unused expression which has no effect on the state of the program indicates a logic error. -For example, `n + 1;` is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement `n += 1;` instead. +For example, `n + 1;` is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement `n += 1;` instead. Sometimes, such unused expressions may be eliminated by some build tools in production environment, which may causes some unexpected effect. ## Rule Details From d4431525d32eb6f136e01ba895bd8e11d0cd7252 Mon Sep 17 00:00:00 2001 From: Pig Fang Date: Thu, 13 Dec 2018 21:12:50 +0800 Subject: [PATCH 2/2] Docs: polish no-unused-expressions --- docs/rules/no-unused-expressions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/rules/no-unused-expressions.md b/docs/rules/no-unused-expressions.md index e777441ed09..8a9748d3d06 100644 --- a/docs/rules/no-unused-expressions.md +++ b/docs/rules/no-unused-expressions.md @@ -2,7 +2,7 @@ An unused expression which has no effect on the state of the program indicates a logic error. -For example, `n + 1;` is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement `n += 1;` instead. Sometimes, such unused expressions may be eliminated by some build tools in production environment, which may causes some unexpected effect. +For example, `n + 1;` is not a syntax error, but it might be a typing mistake where a programmer meant an assignment statement `n += 1;` instead. Sometimes, such unused expressions may be eliminated by some build tools in production environment, which possibly breaks application logic. ## Rule Details