Repository: eslint/eslint
Pull request #11277 (2019-01-16 16:14:30)

Docs: add @g-plane as committer
<!--
    ESLint adheres to the [JS Foundation Code of Conduct](https://js.foundation/community/code-of-conduct).
-->

**What is the purpose of this pull request? (put an "X" next to item)**

[X] Documentation update
[ ] Bug fix ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/bug-report.md))
[ ] New rule ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/rule-proposal.md))
[ ] Changes an existing rule ([template](https://raw.githubusercontent.com/eslint/eslint/master/templates/rule-change-proposal.md))
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

<!--
    If the item you've checked above has a template, please paste the template questions below and answer them. (If this pull request is addressing an issue, you can just paste a link to the issue here instead.)
-->

<!--
    Please ensure your pull request is ready:

    - Read the pull request guide (https://eslint.org/docs/developer-guide/contributing/pull-requests)
    - Include tests for this change
    - Update documentation for this change (if appropriate)
-->

<!--
    The following is required for all pull requests:
-->

**What changes did you make? (Give an overview)**
This PR adds @g-plane as a committer (🎉).  I also changed the tables to match what we have on https://eslint.org/team/, to make it clearer who community members should be reaching out to. 

**Is there anything you'd like reviewers to focus on?**
Nothing in particular.




Patch:
diff --git a/README.md b/README.md
index cba920372..e1855ec3f 100644
--- a/README.md
+++ b/README.md
@@ -195,6 +195,8 @@ These folks keep the project moving and are resources for help.
 
 ### Technical Steering Committee (TSC)
 
+The people who manage releases, review feature requests, and meet regularly to ensure ESLint is properly maintained.
+
 <table>
     <tbody>
         <tr>
@@ -247,7 +249,31 @@ These folks keep the project moving and are resources for help.
     </tbody>
 </table>
 
-### Development Team
+### Committers
+
+The people who review and fix bugs and help triage issues.
+
+<table>
+    <tbody>
+        <tr>
+            <td align="center" valign="top" width="11%">
+                <a href="https://github.com/Aladdin-ADD">
+                <img src="https://github.com/Aladdin-ADD.png?s=75" width="75px" height="75px"><br/>
+                <sub>薛定谔的猫</sub></a>
+            </td>
+            <td align="center" valign="top" width="11%">
+                <a href="https://github.com/g-plane">
+                <img src="https://github.com/g-plane.png?s=75" width="75px" height="75px"><br/>
+                <sub>Pig Fang</sub></a>
+            </td>
+        </tr>
+    </tbody>
+</table>
+
+
+### Alumni
+
+Former TSC members and committers who previously helped maintain ESLint.
 
 <table>
     <tbody>
@@ -324,11 +350,6 @@ These folks keep the project moving and are resources for help.
                 <img src="https://github.com/soda0289.png?s=75" width="75px" height="75px"><br/>
                 <sub>Reyad Attiyat</sub></a>
             </td>
-            <td align="center" valign="top" width="11%">
-                <a href="https://github.com/Aladdin-ADD">
-                <img src="https://github.com/Aladdin-ADD.png?s=75" width="75px" height="75px"><br/>
-                <sub>薛定谔的猫</sub></a>
-            </td>
             <td align="center" valign="top" width="11%">
                 <a href="https://github.com/VictorHom">
                 <img src="https://github.com/VictorHom.png?s=75" width="75px" height="75px"><br/>
diff --git a/lib/rules/no-constant-condition.js b/lib/rules/no-constant-condition.js
index 8d7934d8a..39c2928ee 100644
--- a/lib/rules/no-constant-condition.js
+++ b/lib/rules/no-constant-condition.js
@@ -109,7 +109,10 @@ module.exports = {
                     const isLeftShortCircuit = (isLeftConstant && isLogicalIdentity(node.left, node.operator));
                     const isRightShortCircuit = (isRightConstant && isLogicalIdentity(node.right, node.operator));
 
-                    return (isLeftConstant && isRightConstant) || isLeftShortCircuit || isRightShortCircuit;
+                    return (isLeftConstant && isRightConstant) ||
+                        (node.operator === "||" && isRightConstant && node.right.value) || // in the case of an "OR", we need to know if the right constant value is truthy
+                        isLeftShortCircuit ||
+                        isRightShortCircuit;
                 }
 
                 case "AssignmentExpression":


Test patch:
diff --git a/tests/lib/rules/no-constant-condition.js b/tests/lib/rules/no-constant-condition.js
index 69a90dd38..c89f9080d 100644
--- a/tests/lib/rules/no-constant-condition.js
+++ b/tests/lib/rules/no-constant-condition.js
@@ -55,6 +55,12 @@ ruleTester.run("no-constant-condition", rule, {
         "if(true && abc==='str' || def ==='str'){}",
         "if(true && typeof abc==='string'){}",
 
+        // #11181, string literals
+        "if('str' || a){}",
+        "if('str1' && a){}",
+        "if(a && 'str'){}",
+        "if('str' || abc==='str'){}",
+
         // { checkLoops: false }
         { code: "while(true);", options: [{ checkLoops: false }] },
         { code: "for(;true;);", options: [{ checkLoops: false }] },
@@ -116,6 +122,12 @@ ruleTester.run("no-constant-condition", rule, {
         { code: "if(false || true){}", errors: [{ messageId: "unexpected", type: "LogicalExpression" }] },
         { code: "if(typeof abc==='str' || true){}", errors: [{ messageId: "unexpected", type: "LogicalExpression" }] },
 
+        // #11181, string literals
+        { code: "if('str1' || 'str2'){}", errors: [{ messageId: "unexpected", type: "LogicalExpression" }] },
+        { code: "if('str1' && 'str2'){}", errors: [{ messageId: "unexpected", type: "LogicalExpression" }] },
+        { code: "if(abc==='str' || 'str'){}", errors: [{ messageId: "unexpected", type: "LogicalExpression" }] },
+        { code: "if(a || 'str'){}", errors: [{ messageId: "unexpected", type: "LogicalExpression" }] },
+
         {
             code: "function* foo(){while(true){} yield 'foo';}",
             errors: [{ messageId: "unexpected", type: "Literal" }]