Repository: eslint/eslint
Pull request #11272 (2019-01-14 16:20:21)

Docs: clarify process for adding committers
<!--
    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)**
Added a bullet point highlighting that we should get confirmation from a new committer before adding them to the team.

**Is there anything you'd like reviewers to focus on?**
Nothing in particular.




Patch:
diff --git a/README.md b/README.md
index 65ee43400..e1855ec3f 100644
--- a/README.md
+++ b/README.md
@@ -133,7 +133,7 @@ If you are trying to run locally:
 * Make sure your plugins (and ESLint) are both in your project's `package.json` as devDependencies (or dependencies, if your project uses ESLint at runtime).
 * Make sure you have run `npm install` and all your dependencies are installed.
 
-In all cases, make sure your plugins' peerDependencies have been installed as well. You can use `npm view eslint-plugin-myplugin peerDepencies` to see what peer dependencies `eslint-plugin-myplugin` has.
+In all cases, make sure your plugins' peerDependencies have been installed as well. You can use `npm view eslint-plugin-myplugin peerDependencies` to see what peer dependencies `eslint-plugin-myplugin` has.
 
 ### Does ESLint support JSX?
 
@@ -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/docs/maintainer-guide/governance.md b/docs/maintainer-guide/governance.md
index 0016d1890..a9852d512 100644
--- a/docs/maintainer-guide/governance.md
+++ b/docs/maintainer-guide/governance.md
@@ -45,12 +45,12 @@ A Committer who shows an above-average level of contribution to the project, par
 
 #### Process for Adding Committers
 
+1. Send email congratulating the new committer and confirming that they would like to accept. This should also outline the responsibilities of a committer with a link to the maintainer guide.
 1. Add the GitHub user to the "ESLint Team" team
-2. Send welcome email with link to maintainer guide
-3. Add committer email to the ESLint team mailing list
-4. Add committer to the README
-5. Invite to Gitter team chatroom
-6. Tweet congratulations to the new committer from the ESLint Twitter account
+1. Add committer email to the ESLint team mailing list
+1. Add committer to the README
+1. Invite to Gitter team chatroom
+1. Tweet congratulations to the new committer from the ESLint Twitter account
 
 ### Technical Steering Committee (TSC)
 
diff --git a/docs/rules/sort-imports.md b/docs/rules/sort-imports.md
index d885c9c1c..f6fd04f06 100644
--- a/docs/rules/sort-imports.md
+++ b/docs/rules/sort-imports.md
@@ -146,22 +146,22 @@ Examples of **incorrect** code for this rule with the default `{ "ignoreDeclarat
 
 ```js
 /*eslint sort-imports: ["error", { "ignoreDeclarationSort": false }]*/
-import 'foo.js'
-import 'bar.js'
+import b from 'foo.js'
+import a from 'bar.js'
 ```
 
 Examples of **correct** code for this rule with the `{ "ignoreDeclarationSort": true }` option:
 
 ```js
 /*eslint sort-imports: ["error", { "ignoreDeclarationSort": true }]*/
-import 'foo.js'
-import 'bar.js'
+import a from 'foo.js'
+import b from 'bar.js'
 ```
 
 ```js
 /*eslint sort-imports: ["error", { "ignoreDeclarationSort": true }]*/
-import 'bar.js'
-import 'foo.js'
+import b from 'foo.js'
+import a from 'bar.js'
 ```
 
 Default is `false`.
diff --git a/docs/user-guide/getting-started.md b/docs/user-guide/getting-started.md
index 4b98eb075..2e6e6617a 100644
--- a/docs/user-guide/getting-started.md
+++ b/docs/user-guide/getting-started.md
@@ -37,6 +37,14 @@ After that, you can run ESLint in your project's root directory like this:
 $ ./node_modules/.bin/eslint yourfile.js
 ```
 
+Instead of navigating to `./node_modules/.bin/` you may also use `npx` to run `eslint`:
+
+```
+$ npx eslint
+```
+
+**Note:** If ESLint wasn't manually installed (via `npm`), `npx` will install `eslint` to a temporary directory and execute it.
+
 Any plugins or shareable configs that you use must also be installed locally to work with a locally-installed ESLint.
 
 ### Global Installation and Usage
diff --git a/lib/formatters/tap.js b/lib/formatters/tap.js
index 9651a2bcf..354872a0c 100644
--- a/lib/formatters/tap.js
+++ b/lib/formatters/tap.js
@@ -20,7 +20,6 @@ function getMessageType(message) {
         return "error";
     }
     return "warning";
-
 }
 
 /**
@@ -50,12 +49,11 @@ module.exports = function(results) {
         let diagnostics = {};
 
         if (messages.length > 0) {
-            testResult = "not ok";
-
             messages.forEach(message => {
+                const severity = getMessageType(message);
                 const diagnostic = {
                     message: message.message,
-                    severity: getMessageType(message),
+                    severity,
                     data: {
                         line: message.line || 0,
                         column: message.column || 0,
@@ -63,6 +61,11 @@ module.exports = function(results) {
                     }
                 };
 
+                // This ensures a warning message is not flagged as error
+                if (severity === "error") {
+                    testResult = "not ok";
+                }
+
                 /*
                  * If we have multiple messages place them under a messages key
                  * The first error will be logged as message key
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/formatters/tap.js b/tests/lib/formatters/tap.js
index 7fc080a53..903af6a8b 100644
--- a/tests/lib/formatters/tap.js
+++ b/tests/lib/formatters/tap.js
@@ -72,7 +72,7 @@ describe("formatter:tap", () => {
             }]
         }];
 
-        it("should return a an error string", () => {
+        it("should return an error string", () => {
             const result = formatter(code);
 
             assert.include(result, "not ok");
@@ -80,7 +80,70 @@ describe("formatter:tap", () => {
         });
     });
 
-    describe("when passed multiple messages", () => {
+    describe("when passed a message with a severity of 1", () => {
+        const code = [{
+            filePath: "foo.js",
+            messages: [{
+                message: "Unexpected foo.",
+                severity: 1,
+                line: 5,
+                column: 10,
+                ruleId: "foo"
+            }]
+        }];
+
+        it("should return a warning string", () => {
+            const result = formatter(code);
+
+            assert.include(result, "ok");
+            assert.notInclude(result, "not ok");
+            assert.include(result, "warning");
+        });
+    });
+
+    describe("when passed multiple messages with a severity of 1", () => {
+        const code = [{
+            filePath: "foo.js",
+            messages: [{
+                message: "Foo.",
+                severity: 1,
+                line: 5,
+                column: 10,
+                ruleId: "foo"
+            }, {
+                message: "Bar.",
+                severity: 1,
+                line: 6,
+                column: 11,
+                ruleId: "bar"
+            }, {
+                message: "Baz.",
+                severity: 1,
+                line: 7,
+                column: 12,
+                ruleId: "baz"
+            }]
+        }];
+
+        it("should return a string with multiple entries", () => {
+            const result = formatter(code);
+
+            assert.include(result, "ok");
+            assert.notInclude(result, "not ok");
+            assert.include(result, "messages");
+            assert.include(result, "Foo.");
+            assert.include(result, "line: 5");
+            assert.include(result, "column: 10");
+            assert.include(result, "Bar.");
+            assert.include(result, "line: 6");
+            assert.include(result, "column: 11");
+            assert.include(result, "Baz.");
+            assert.include(result, "line: 7");
+            assert.include(result, "column: 12");
+        });
+    });
+
+    describe("when passed multiple messages with different error severity", () => {
         const code = [{
             filePath: "foo.js",
             messages: [{
@@ -146,7 +209,8 @@ describe("formatter:tap", () => {
             const result = formatter(code);
 
             assert.include(result, "not ok 1");
-            assert.include(result, "not ok 2");
+            assert.include(result, "ok 2");
+            assert.notInclude(result, "not ok 2");
         });
     });
 
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" }]