Repository: eslint/eslint
Pull request #9031 (2017-07-29 01:38:39)

Docs: Create SUPPORT.md


<!--
    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 (http://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)**

GitHub now displays a notice about [`SUPPORT.md` files](https://github.com/blog/2400-support-file-support) when people create new issues (similar to `CONTRIBUTING.md` files). This commit adds a file encouraging people to ask questions in the Gitter channel.

**Is there anything you'd like reviewers to focus on?**

Nothing in particular

eslintbot: LGTM

Patch:
diff --git a/SUPPORT.md b/SUPPORT.md
new file mode 100644
index 000000000..08942601a
--- /dev/null
+++ b/SUPPORT.md
@@ -0,0 +1,1 @@
+If you have a question about how to use ESLint, please ask it in our [Gitter channel](https://gitter.im/eslint/eslint).
diff --git a/conf/eslint-recommended.js b/conf/eslint-recommended.js
index 1a2e2f8e7..35c8acdbe 100755
--- a/conf/eslint-recommended.js
+++ b/conf/eslint-recommended.js
@@ -6,13 +6,10 @@
 
 "use strict";
 
-/* eslint sort-keys: ["error", "asc"], quote-props: ["error", "consistent"] */
-/* eslint-disable sort-keys */
+/* eslint sort-keys: ["error", "asc"] */
 
 module.exports = {
     rules: {
-
-        /* eslint-enable sort-keys */
         "accessor-pairs": "off",
         "array-bracket-newline": "off",
         "array-bracket-spacing": "off",
@@ -25,23 +22,23 @@ module.exports = {
         "block-spacing": "off",
         "brace-style": "off",
         "callback-return": "off",
-        "camelcase": "off",
+        camelcase: "off",
         "capitalized-comments": "off",
         "class-methods-use-this": "off",
         "comma-dangle": "off",
         "comma-spacing": "off",
         "comma-style": "off",
-        "complexity": "off",
+        complexity: "off",
         "computed-property-spacing": "off",
         "consistent-return": "off",
         "consistent-this": "off",
         "constructor-super": "error",
-        "curly": "off",
+        curly: "off",
         "default-case": "off",
         "dot-location": "off",
         "dot-notation": "off",
         "eol-last": "off",
-        "eqeqeq": "off",
+        eqeqeq: "off",
         "for-direction": "off",
         "func-call-spacing": "off",
         "func-name-matching": "off",
@@ -55,7 +52,7 @@ module.exports = {
         "id-blacklist": "off",
         "id-length": "off",
         "id-match": "off",
-        "indent": "off",
+        indent: "off",
         "indent-legacy": "off",
         "init-declarations": "off",
         "jsx-quotes": "off",
@@ -234,13 +231,13 @@ module.exports = {
         "prefer-spread": "off",
         "prefer-template": "off",
         "quote-props": "off",
-        "quotes": "off",
-        "radix": "off",
+        quotes: "off",
+        radix: "off",
         "require-await": "off",
         "require-jsdoc": "off",
         "require-yield": "error",
         "rest-spread-spacing": "off",
-        "semi": "off",
+        semi: "off",
         "semi-spacing": "off",
         "semi-style": "off",
         "sort-imports": "off",
@@ -252,7 +249,7 @@ module.exports = {
         "space-infix-ops": "off",
         "space-unary-ops": "off",
         "spaced-comment": "off",
-        "strict": "off",
+        strict: "off",
         "switch-colon-spacing": "off",
         "symbol-description": "off",
         "template-curly-spacing": "off",
@@ -265,6 +262,6 @@ module.exports = {
         "wrap-iife": "off",
         "wrap-regex": "off",
         "yield-star-spacing": "off",
-        "yoda": "off"
+        yoda: "off"
     }
 };
diff --git a/lib/config/config-file.js b/lib/config/config-file.js
index 34cc0d914..87412dd2a 100644
--- a/lib/config/config-file.js
+++ b/lib/config/config-file.js
@@ -3,8 +3,6 @@
  * @author Nicholas C. Zakas
  */
 
-/* eslint no-use-before-define: 0 */
-
 "use strict";
 
 //------------------------------------------------------------------------------
@@ -418,6 +416,8 @@ function applyExtends(config, configContext, filePath, relativeTo) {
                 );
             }
             debug(`Loading ${parentPath}`);
+
+            // eslint-disable-next-line no-use-before-define
             return ConfigOps.merge(load(parentPath, configContext, relativeTo), previousValue);
         } catch (e) {
 
diff --git a/lib/rules/indent.js b/lib/rules/indent.js
index 0d4c7188b..5baf4788b 100644
--- a/lib/rules/indent.js
+++ b/lib/rules/indent.js
@@ -960,11 +960,20 @@ module.exports = {
 
         return {
             "ArrayExpression, ArrayPattern"(node) {
-                addElementListIndent(node.elements, sourceCode.getFirstToken(node), sourceCode.getLastToken(node), options.ArrayExpression);
+                const openingBracket = sourceCode.getFirstToken(node);
+                const closingBracket = sourceCode.getTokenAfter(lodash.findLast(node.elements) || openingBracket, astUtils.isClosingBracketToken);
+
+                addElementListIndent(node.elements, openingBracket, closingBracket, options.ArrayExpression);
             },
 
             "ObjectExpression, ObjectPattern"(node) {
-                addElementListIndent(node.properties, sourceCode.getFirstToken(node), sourceCode.getLastToken(node), options.ObjectExpression);
+                const openingCurly = sourceCode.getFirstToken(node);
+                const closingCurly = sourceCode.getTokenAfter(
+                    node.properties.length ? node.properties[node.properties.length - 1] : openingCurly,
+                    astUtils.isClosingBraceToken
+                );
+
+                addElementListIndent(node.properties, openingCurly, closingCurly, options.ObjectExpression);
             },
 
             ArrowFunctionExpression(node) {
diff --git a/lib/rules/padding-line-between-statements.js b/lib/rules/padding-line-between-statements.js
index 707cf33d8..413327dfd 100644
--- a/lib/rules/padding-line-between-statements.js
+++ b/lib/rules/padding-line-between-statements.js
@@ -93,7 +93,7 @@ function isBlockLikeStatement(sourceCode, node) {
 
     // Checks the last token is a closing brace of blocks.
     const lastToken = sourceCode.getLastToken(node, astUtils.isNotSemicolonToken);
-    const belongingNode = astUtils.isClosingBraceToken(lastToken)
+    const belongingNode = lastToken && astUtils.isClosingBraceToken(lastToken)
         ? sourceCode.getNodeByRangeIndex(lastToken.range[0])
         : null;
 


Test patch:
diff --git a/lib/testers/rule-tester.js b/lib/testers/rule-tester.js
index 41d2a3109..acd3bee7c 100644
--- a/lib/testers/rule-tester.js
+++ b/lib/testers/rule-tester.js
@@ -250,7 +250,6 @@ class RuleTester {
         const testerConfig = this.testerConfig,
             requiredScenarios = ["valid", "invalid"],
             scenarioErrors = [],
-            result = {},
             linter = this.linter;
 
         if (lodash.isNil(test) || typeof test !== "object") {
@@ -269,16 +268,13 @@ class RuleTester {
             ].concat(scenarioErrors).join("\n"));
         }
 
-        /* eslint-disable no-shadow */
-
         /**
          * Run the rule for the given item
-         * @param {string} ruleName name of the rule
          * @param {string|Object} item Item to run the rule against
          * @returns {Object} Eslint run result
          * @private
          */
-        function runRuleForItem(ruleName, item) {
+        function runRuleForItem(item) {
             let config = lodash.cloneDeep(testerConfig),
                 code, filename, beforeAST, afterAST;
 
@@ -350,27 +346,27 @@ class RuleTester {
 
             try {
                 linter.rules.get = function(ruleId) {
-                    const rule = originalGet.call(linter.rules, ruleId);
+                    const originalRule = originalGet.call(linter.rules, ruleId);
 
-                    if (typeof rule === "function") {
+                    if (typeof originalRule === "function") {
                         return function(context) {
                             Object.freeze(context);
                             freezeDeeply(context.options);
                             freezeDeeply(context.settings);
                             freezeDeeply(context.parserOptions);
 
-                            return rule(context);
+                            return originalRule(context);
                         };
                     }
                     return {
-                        meta: rule.meta,
+                        meta: originalRule.meta,
                         create(context) {
                             Object.freeze(context);
                             freezeDeeply(context.options);
                             freezeDeeply(context.settings);
                             freezeDeeply(context.parserOptions);
 
-                            return rule.create(context);
+                            return originalRule.create(context);
                         }
                     };
 
@@ -404,13 +400,12 @@ class RuleTester {
         /**
          * Check if the template is valid or not
          * all valid cases go through this
-         * @param {string} ruleName name of the rule
          * @param {string|Object} item Item to run the rule against
          * @returns {void}
          * @private
          */
-        function testValidTemplate(ruleName, item) {
-            const result = runRuleForItem(ruleName, item);
+        function testValidTemplate(item) {
+            const result = runRuleForItem(item);
             const messages = result.messages;
 
             assert.equal(messages.length, 0, util.format("Should have no errors but had %d: %s",
@@ -444,16 +439,15 @@ class RuleTester {
         /**
          * Check if the template is invalid or not
          * all invalid cases go through this.
-         * @param {string} ruleName name of the rule
          * @param {string|Object} item Item to run the rule against
          * @returns {void}
          * @private
          */
-        function testInvalidTemplate(ruleName, item) {
+        function testInvalidTemplate(item) {
             assert.ok(item.errors || item.errors === 0,
                 `Did not specify errors for an invalid test of ${ruleName}`);
 
-            const result = runRuleForItem(ruleName, item);
+            const result = runRuleForItem(item);
             const messages = result.messages;
 
 
@@ -543,7 +537,7 @@ class RuleTester {
                 test.valid.forEach(valid => {
                     RuleTester.it(typeof valid === "object" ? valid.code : valid, () => {
                         linter.defineRules(this.rules);
-                        testValidTemplate(ruleName, valid);
+                        testValidTemplate(valid);
                     });
                 });
             });
@@ -552,13 +546,11 @@ class RuleTester {
                 test.invalid.forEach(invalid => {
                     RuleTester.it(invalid.code, () => {
                         linter.defineRules(this.rules);
-                        testInvalidTemplate(ruleName, invalid);
+                        testInvalidTemplate(invalid);
                     });
                 });
             });
         });
-
-        return result.suite;
     }
 }
 
diff --git a/tests/fixtures/parsers/babel-eslint7/array-pattern-with-annotation.js b/tests/fixtures/parsers/babel-eslint7/array-pattern-with-annotation.js
new file mode 100644
index 000000000..ffab37906
--- /dev/null
+++ b/tests/fixtures/parsers/babel-eslint7/array-pattern-with-annotation.js
@@ -0,0 +1,389 @@
+/**
+ * Parser: babel-eslint v7.2.3
+ * Source code:
+ * ([
+ *     foo
+ *     ]: bar) => baz
+ */
+
+exports.parse = () => ({
+    "type": "Program",
+    "start": 0,
+    "end": 29,
+    "loc": {
+        "start": {
+            "line": 1,
+            "column": 0
+        },
+        "end": {
+            "line": 3,
+            "column": 18
+        }
+    },
+    "comments": [],
+    "tokens": [
+        {
+            "type": "Punctuator",
+            "value": "(",
+            "start": 0,
+            "end": 1,
+            "loc": {
+                "start": {
+                    "line": 1,
+                    "column": 0
+                },
+                "end": {
+                    "line": 1,
+                    "column": 1
+                }
+            },
+            "range": [
+                0,
+                1
+            ]
+        },
+        {
+            "type": "Punctuator",
+            "value": "[",
+            "start": 1,
+            "end": 2,
+            "loc": {
+                "start": {
+                    "line": 1,
+                    "column": 1
+                },
+                "end": {
+                    "line": 1,
+                    "column": 2
+                }
+            },
+            "range": [
+                1,
+                2
+            ]
+        },
+        {
+            "type": "Identifier",
+            "value": "foo",
+            "start": 7,
+            "end": 10,
+            "loc": {
+                "start": {
+                    "line": 2,
+                    "column": 4
+                },
+                "end": {
+                    "line": 2,
+                    "column": 7
+                }
+            },
+            "range": [
+                7,
+                10
+            ]
+        },
+        {
+            "type": "Punctuator",
+            "value": "]",
+            "start": 15,
+            "end": 16,
+            "loc": {
+                "start": {
+                    "line": 3,
+                    "column": 4
+                },
+                "end": {
+                    "line": 3,
+                    "column": 5
+                }
+            },
+            "range": [
+                15,
+                16
+            ]
+        },
+        {
+            "type": "Punctuator",
+            "value": ":",
+            "start": 16,
+            "end": 17,
+            "loc": {
+                "start": {
+                    "line": 3,
+                    "column": 5
+                },
+                "end": {
+                    "line": 3,
+                    "column": 6
+                }
+            },
+            "range": [
+                16,
+                17
+            ]
+        },
+        {
+            "type": "Identifier",
+            "value": "bar",
+            "start": 18,
+            "end": 21,
+            "loc": {
+                "start": {
+                    "line": 3,
+                    "column": 7
+                },
+                "end": {
+                    "line": 3,
+                    "column": 10
+                }
+            },
+            "range": [
+                18,
+                21
+            ]
+        },
+        {
+            "type": "Punctuator",
+            "value": ")",
+            "start": 21,
+            "end": 22,
+            "loc": {
+                "start": {
+                    "line": 3,
+                    "column": 10
+                },
+                "end": {
+                    "line": 3,
+                    "column": 11
+                }
+            },
+            "range": [
+                21,
+                22
+            ]
+        },
+        {
+            "type": "Punctuator",
+            "value": "=>",
+            "start": 23,
+            "end": 25,
+            "loc": {
+                "start": {
+                    "line": 3,
+                    "column": 12
+                },
+                "end": {
+                    "line": 3,
+                    "column": 14
+                }
+            },
+            "range": [
+                23,
+                25
+            ]
+        },
+        {
+            "type": "Identifier",
+            "value": "baz",
+            "start": 26,
+            "end": 29,
+            "loc": {
+                "start": {
+                    "line": 3,
+                    "column": 15
+                },
+                "end": {
+                    "line": 3,
+                    "column": 18
+                }
+            },
+            "range": [
+                26,
+                29
+            ]
+        }
+    ],
+    "range": [
+        0,
+        29
+    ],
+    "sourceType": "module",
+    "body": [
+        {
+            "type": "ExpressionStatement",
+            "start": 0,
+            "end": 29,
+            "loc": {
+                "start": {
+                    "line": 1,
+                    "column": 0
+                },
+                "end": {
+                    "line": 3,
+                    "column": 18
+                }
+            },
+            "expression": {
+                "type": "ArrowFunctionExpression",
+                "start": 0,
+                "end": 29,
+                "loc": {
+                    "start": {
+                        "line": 1,
+                        "column": 0
+                    },
+                    "end": {
+                        "line": 3,
+                        "column": 18
+                    }
+                },
+                "id": null,
+                "generator": false,
+                "expression": true,
+                "async": false,
+                "params": [
+                    {
+                        "type": "ArrayPattern",
+                        "start": 1,
+                        "end": 21,
+                        "loc": {
+                            "start": {
+                                "line": 1,
+                                "column": 1
+                            },
+                            "end": {
+                                "line": 3,
+                                "column": 10
+                            }
+                        },
+                        "elements": [
+                            {
+                                "type": "Identifier",
+                                "start": 7,
+                                "end": 10,
+                                "loc": {
+                                    "start": {
+                                        "line": 2,
+                                        "column": 4
+                                    },
+                                    "end": {
+                                        "line": 2,
+                                        "column": 7
+                                    },
+                                    "identifierName": "foo"
+                                },
+                                "name": "foo",
+                                "range": [
+                                    7,
+                                    10
+                                ],
+                                "_babelType": "Identifier"
+                            }
+                        ],
+                        "typeAnnotation": {
+                            "type": "TypeAnnotation",
+                            "start": 16,
+                            "end": 21,
+                            "loc": {
+                                "start": {
+                                    "line": 3,
+                                    "column": 5
+                                },
+                                "end": {
+                                    "line": 3,
+                                    "column": 10
+                                }
+                            },
+                            "typeAnnotation": {
+                                "type": "GenericTypeAnnotation",
+                                "start": 18,
+                                "end": 21,
+                                "loc": {
+                                    "start": {
+                                        "line": 3,
+                                        "column": 7
+                                    },
+                                    "end": {
+                                        "line": 3,
+                                        "column": 10
+                                    }
+                                },
+                                "typeParameters": null,
+                                "id": {
+                                    "type": "Identifier",
+                                    "start": 18,
+                                    "end": 21,
+                                    "loc": {
+                                        "start": {
+                                            "line": 3,
+                                            "column": 7
+                                        },
+                                        "end": {
+                                            "line": 3,
+                                            "column": 10
+                                        },
+                                        "identifierName": "bar"
+                                    },
+                                    "name": "bar",
+                                    "range": [
+                                        18,
+                                        21
+                                    ],
+                                    "_babelType": "Identifier"
+                                },
+                                "range": [
+                                    18,
+                                    21
+                                ],
+                                "_babelType": "GenericTypeAnnotation"
+                            },
+                            "range": [
+                                16,
+                                21
+                            ],
+                            "_babelType": "TypeAnnotation"
+                        },
+                        "range": [
+                            1,
+                            21
+                        ],
+                        "_babelType": "ArrayPattern"
+                    }
+                ],
+                "body": {
+                    "type": "Identifier",
+                    "start": 26,
+                    "end": 29,
+                    "loc": {
+                        "start": {
+                            "line": 3,
+                            "column": 15
+                        },
+                        "end": {
+                            "line": 3,
+                            "column": 18
+                        },
+                        "identifierName": "baz"
+                    },
+                    "name": "baz",
+                    "range": [
+                        26,
+                        29
+                    ],
+                    "_babelType": "Identifier"
+                },
+                "range": [
+                    0,
+                    29
+                ],
+                "_babelType": "ArrowFunctionExpression",
+                "defaults": []
+            },
+            "range": [
+                0,
+                29
+            ],
+            "_babelType": "ExpressionStatement"
+        }
+    ]
+});
diff --git a/tests/fixtures/parsers/babel-eslint7/object-pattern-with-annotation.js b/tests/fixtures/parsers/babel-eslint7/object-pattern-with-annotation.js
new file mode 100644
index 000000000..3eb4215b5
--- /dev/null
+++ b/tests/fixtures/parsers/babel-eslint7/object-pattern-with-annotation.js
@@ -0,0 +1,438 @@
+/**
+ * Parser: babel-eslint v7.2.3
+ * Source code:
+ * ({
+ *     foo
+ *     }: bar) => baz
+ */
+
+exports.parse = () => ({
+    type: "Program",
+    start: 0,
+    end: 29,
+    loc: {
+        start: {
+            line: 1,
+            column: 0
+        },
+        end: {
+            line: 3,
+            column: 18
+        }
+    },
+    comments: [],
+    tokens: [
+        {
+            type: "Punctuator",
+            value: "(",
+            start: 0,
+            end: 1,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 0
+                },
+                end: {
+                    line: 1,
+                    column: 1
+                }
+            },
+            range: [
+                0,
+                1
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "{",
+            start: 1,
+            end: 2,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 1
+                },
+                end: {
+                    line: 1,
+                    column: 2
+                }
+            },
+            range: [
+                1,
+                2
+            ]
+        },
+        {
+            type: "Identifier",
+            value: "foo",
+            start: 7,
+            end: 10,
+            loc: {
+                start: {
+                    line: 2,
+                    column: 4
+                },
+                end: {
+                    line: 2,
+                    column: 7
+                }
+            },
+            range: [
+                7,
+                10
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "}",
+            start: 15,
+            end: 16,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 4
+                },
+                end: {
+                    line: 3,
+                    column: 5
+                }
+            },
+            range: [
+                15,
+                16
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: ":",
+            start: 16,
+            end: 17,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 5
+                },
+                end: {
+                    line: 3,
+                    column: 6
+                }
+            },
+            range: [
+                16,
+                17
+            ]
+        },
+        {
+            type: "Identifier",
+            value: "bar",
+            start: 18,
+            end: 21,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 7
+                },
+                end: {
+                    line: 3,
+                    column: 10
+                }
+            },
+            range: [
+                18,
+                21
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: ")",
+            start: 21,
+            end: 22,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 10
+                },
+                end: {
+                    line: 3,
+                    column: 11
+                }
+            },
+            range: [
+                21,
+                22
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "=>",
+            start: 23,
+            end: 25,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 12
+                },
+                end: {
+                    line: 3,
+                    column: 14
+                }
+            },
+            range: [
+                23,
+                25
+            ]
+        },
+        {
+            type: "Identifier",
+            value: "baz",
+            start: 26,
+            end: 29,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 15
+                },
+                end: {
+                    line: 3,
+                    column: 18
+                }
+            },
+            range: [
+                26,
+                29
+            ]
+        }
+    ],
+    range: [
+        0,
+        29
+    ],
+    sourceType: "module",
+    body: [
+        {
+            type: "ExpressionStatement",
+            start: 0,
+            end: 29,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 0
+                },
+                end: {
+                    line: 3,
+                    column: 18
+                }
+            },
+            expression: {
+                type: "ArrowFunctionExpression",
+                start: 0,
+                end: 29,
+                loc: {
+                    start: {
+                        line: 1,
+                        column: 0
+                    },
+                    end: {
+                        line: 3,
+                        column: 18
+                    }
+                },
+                id: null,
+                generator: false,
+                expression: true,
+                async: false,
+                params: [
+                    {
+                        type: "ObjectPattern",
+                        start: 1,
+                        end: 21,
+                        loc: {
+                            start: {
+                                line: 1,
+                                column: 1
+                            },
+                            end: {
+                                line: 3,
+                                column: 10
+                            }
+                        },
+                        properties: [
+                            {
+                                type: "Property",
+                                start: 7,
+                                end: 10,
+                                loc: {
+                                    start: {
+                                        line: 2,
+                                        column: 4
+                                    },
+                                    end: {
+                                        line: 2,
+                                        column: 7
+                                    }
+                                },
+                                method: false,
+                                shorthand: true,
+                                computed: false,
+                                key: {
+                                    type: "Identifier",
+                                    start: 7,
+                                    end: 10,
+                                    loc: {
+                                        start: {
+                                            line: 2,
+                                            column: 4
+                                        },
+                                        end: {
+                                            line: 2,
+                                            column: 7
+                                        },
+                                        identifierName: "foo"
+                                    },
+                                    name: "foo",
+                                    range: [
+                                        7,
+                                        10
+                                    ],
+                                    _babelType: "Identifier"
+                                },
+                                value: {
+                                    type: "Identifier",
+                                    start: 7,
+                                    end: 10,
+                                    loc: {
+                                        start: {
+                                            line: 2,
+                                            column: 4
+                                        },
+                                        end: {
+                                            line: 2,
+                                            column: 7
+                                        },
+                                        identifierName: "foo"
+                                    },
+                                    name: "foo",
+                                    range: [
+                                        7,
+                                        10
+                                    ],
+                                    _babelType: "Identifier"
+                                },
+                                extra: {
+                                    shorthand: true
+                                },
+                                range: [
+                                    7,
+                                    10
+                                ],
+                                _babelType: "ObjectProperty",
+                                kind: "init"
+                            }
+                        ],
+                        typeAnnotation: {
+                            type: "TypeAnnotation",
+                            start: 16,
+                            end: 21,
+                            loc: {
+                                start: {
+                                    line: 3,
+                                    column: 5
+                                },
+                                end: {
+                                    line: 3,
+                                    column: 10
+                                }
+                            },
+                            typeAnnotation: {
+                                type: "GenericTypeAnnotation",
+                                start: 18,
+                                end: 21,
+                                loc: {
+                                    start: {
+                                        line: 3,
+                                        column: 7
+                                    },
+                                    end: {
+                                        line: 3,
+                                        column: 10
+                                    }
+                                },
+                                typeParameters: null,
+                                id: {
+                                    type: "Identifier",
+                                    start: 18,
+                                    end: 21,
+                                    loc: {
+                                        start: {
+                                            line: 3,
+                                            column: 7
+                                        },
+                                        end: {
+                                            line: 3,
+                                            column: 10
+                                        },
+                                        identifierName: "bar"
+                                    },
+                                    name: "bar",
+                                    range: [
+                                        18,
+                                        21
+                                    ],
+                                    _babelType: "Identifier"
+                                },
+                                range: [
+                                    18,
+                                    21
+                                ],
+                                _babelType: "GenericTypeAnnotation"
+                            },
+                            range: [
+                                16,
+                                21
+                            ],
+                            _babelType: "TypeAnnotation"
+                        },
+                        range: [
+                            1,
+                            21
+                        ],
+                        _babelType: "ObjectPattern"
+                    }
+                ],
+                body: {
+                    type: "Identifier",
+                    start: 26,
+                    end: 29,
+                    loc: {
+                        start: {
+                            line: 3,
+                            column: 15
+                        },
+                        end: {
+                            line: 3,
+                            column: 18
+                        },
+                        identifierName: "baz"
+                    },
+                    name: "baz",
+                    range: [
+                        26,
+                        29
+                    ],
+                    _babelType: "Identifier"
+                },
+                range: [
+                    0,
+                    29
+                ],
+                _babelType: "ArrowFunctionExpression",
+                defaults: []
+            },
+            range: [
+                0,
+                29
+            ],
+            _babelType: "ExpressionStatement"
+        }
+    ]
+});
diff --git a/tests/fixtures/parsers/babel-eslint7/object-pattern-with-object-annotation.js b/tests/fixtures/parsers/babel-eslint7/object-pattern-with-object-annotation.js
new file mode 100644
index 000000000..4ff2e03b6
--- /dev/null
+++ b/tests/fixtures/parsers/babel-eslint7/object-pattern-with-object-annotation.js
@@ -0,0 +1,439 @@
+/**
+ * Parser: babel-eslint v7.2.3
+ * Source code:
+ * ({
+ *     foo
+ *     }: {}) => baz
+ */
+
+exports.parse = () => ({
+    type: "Program",
+    start: 0,
+    end: 28,
+    loc: {
+        start: {
+            line: 1,
+            column: 0
+        },
+        end: {
+            line: 3,
+            column: 17
+        }
+    },
+    comments: [],
+    tokens: [
+        {
+            type: "Punctuator",
+            value: "(",
+            start: 0,
+            end: 1,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 0
+                },
+                end: {
+                    line: 1,
+                    column: 1
+                }
+            },
+            range: [
+                0,
+                1
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "{",
+            start: 1,
+            end: 2,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 1
+                },
+                end: {
+                    line: 1,
+                    column: 2
+                }
+            },
+            range: [
+                1,
+                2
+            ]
+        },
+        {
+            type: "Identifier",
+            value: "foo",
+            start: 7,
+            end: 10,
+            loc: {
+                start: {
+                    line: 2,
+                    column: 4
+                },
+                end: {
+                    line: 2,
+                    column: 7
+                }
+            },
+            range: [
+                7,
+                10
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "}",
+            start: 15,
+            end: 16,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 4
+                },
+                end: {
+                    line: 3,
+                    column: 5
+                }
+            },
+            range: [
+                15,
+                16
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: ":",
+            start: 16,
+            end: 17,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 5
+                },
+                end: {
+                    line: 3,
+                    column: 6
+                }
+            },
+            range: [
+                16,
+                17
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "{",
+            start: 18,
+            end: 19,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 7
+                },
+                end: {
+                    line: 3,
+                    column: 8
+                }
+            },
+            range: [
+                18,
+                19
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "}",
+            start: 19,
+            end: 20,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 8
+                },
+                end: {
+                    line: 3,
+                    column: 9
+                }
+            },
+            range: [
+                19,
+                20
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: ")",
+            start: 20,
+            end: 21,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 9
+                },
+                end: {
+                    line: 3,
+                    column: 10
+                }
+            },
+            range: [
+                20,
+                21
+            ]
+        },
+        {
+            type: "Punctuator",
+            value: "=>",
+            start: 22,
+            end: 24,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 11
+                },
+                end: {
+                    line: 3,
+                    column: 13
+                }
+            },
+            range: [
+                22,
+                24
+            ]
+        },
+        {
+            type: "Identifier",
+            value: "baz",
+            start: 25,
+            end: 28,
+            loc: {
+                start: {
+                    line: 3,
+                    column: 14
+                },
+                end: {
+                    line: 3,
+                    column: 17
+                }
+            },
+            range: [
+                25,
+                28
+            ]
+        }
+    ],
+    range: [
+        0,
+        28
+    ],
+    sourceType: "module",
+    body: [
+        {
+            type: "ExpressionStatement",
+            start: 0,
+            end: 28,
+            loc: {
+                start: {
+                    line: 1,
+                    column: 0
+                },
+                end: {
+                    line: 3,
+                    column: 17
+                }
+            },
+            expression: {
+                type: "ArrowFunctionExpression",
+                start: 0,
+                end: 28,
+                loc: {
+                    start: {
+                        line: 1,
+                        column: 0
+                    },
+                    end: {
+                        line: 3,
+                        column: 17
+                    }
+                },
+                id: null,
+                generator: false,
+                expression: true,
+                async: false,
+                params: [
+                    {
+                        type: "ObjectPattern",
+                        start: 1,
+                        end: 20,
+                        loc: {
+                            start: {
+                                line: 1,
+                                column: 1
+                            },
+                            end: {
+                                line: 3,
+                                column: 9
+                            }
+                        },
+                        properties: [
+                            {
+                                type: "Property",
+                                start: 7,
+                                end: 10,
+                                loc: {
+                                    start: {
+                                        line: 2,
+                                        column: 4
+                                    },
+                                    end: {
+                                        line: 2,
+                                        column: 7
+                                    }
+                                },
+                                method: false,
+                                shorthand: true,
+                                computed: false,
+                                key: {
+                                    type: "Identifier",
+                                    start: 7,
+                                    end: 10,
+                                    loc: {
+                                        start: {
+                                            line: 2,
+                                            column: 4
+                                        },
+                                        end: {
+                                            line: 2,
+                                            column: 7
+                                        },
+                                        identifierName: "foo"
+                                    },
+                                    name: "foo",
+                                    range: [
+                                        7,
+                                        10
+                                    ],
+                                    _babelType: "Identifier"
+                                },
+                                value: {
+                                    type: "Identifier",
+                                    start: 7,
+                                    end: 10,
+                                    loc: {
+                                        start: {
+                                            line: 2,
+                                            column: 4
+                                        },
+                                        end: {
+                                            line: 2,
+                                            column: 7
+                                        },
+                                        identifierName: "foo"
+                                    },
+                                    name: "foo",
+                                    range: [
+                                        7,
+                                        10
+                                    ],
+                                    _babelType: "Identifier"
+                                },
+                                extra: {
+                                    shorthand: true
+                                },
+                                range: [
+                                    7,
+                                    10
+                                ],
+                                _babelType: "ObjectProperty",
+                                kind: "init"
+                            }
+                        ],
+                        typeAnnotation: {
+                            type: "TypeAnnotation",
+                            start: 16,
+                            end: 20,
+                            loc: {
+                                start: {
+                                    line: 3,
+                                    column: 5
+                                },
+                                end: {
+                                    line: 3,
+                                    column: 9
+                                }
+                            },
+                            typeAnnotation: {
+                                type: "ObjectTypeAnnotation",
+                                start: 18,
+                                end: 20,
+                                loc: {
+                                    start: {
+                                        line: 3,
+                                        column: 7
+                                    },
+                                    end: {
+                                        line: 3,
+                                        column: 9
+                                    }
+                                },
+                                callProperties: [],
+                                properties: [],
+                                indexers: [],
+                                exact: false,
+                                range: [
+                                    18,
+                                    20
+                                ],
+                                _babelType: "ObjectTypeAnnotation"
+                            },
+                            range: [
+                                16,
+                                20
+                            ],
+                            _babelType: "TypeAnnotation"
+                        },
+                        range: [
+                            1,
+                            20
+                        ],
+                        _babelType: "ObjectPattern"
+                    }
+                ],
+                body: {
+                    type: "Identifier",
+                    start: 25,
+                    end: 28,
+                    loc: {
+                        start: {
+                            line: 3,
+                            column: 14
+                        },
+                        end: {
+                            line: 3,
+                            column: 17
+                        },
+                        identifierName: "baz"
+                    },
+                    name: "baz",
+                    range: [
+                        25,
+                        28
+                    ],
+                    _babelType: "Identifier"
+                },
+                range: [
+                    0,
+                    28
+                ],
+                _babelType: "ArrowFunctionExpression",
+                defaults: []
+            },
+            range: [
+                0,
+                28
+            ],
+            _babelType: "ExpressionStatement"
+        }
+    ]
+});
diff --git a/tests/lib/config.js b/tests/lib/config.js
index 59e1a47d0..f429dfa76 100644
--- a/tests/lib/config.js
+++ b/tests/lib/config.js
@@ -2,7 +2,6 @@
  * @fileoverview Tests for config object.
  * @author Seth McLaughlin
  */
-/* eslint no-undefined: "off" */
 "use strict";
 
 //------------------------------------------------------------------------------
@@ -875,7 +874,7 @@ describe("Config", () => {
                         parserOptions: {},
                         env: {},
                         globals: {},
-                        parser: undefined,
+                        parser: void 0,
                         rules: {
                             "home-folder-rule": 2
                         }
@@ -901,7 +900,7 @@ describe("Config", () => {
                         parserOptions: {},
                         env: {},
                         globals: {},
-                        parser: undefined,
+                        parser: void 0,
                         rules: {
                             "project-level-rule": 2
                         }
@@ -928,7 +927,7 @@ describe("Config", () => {
                         parserOptions: {},
                         env: {},
                         globals: {},
-                        parser: undefined,
+                        parser: void 0,
                         rules: {
                             quotes: [2, "double"]
                         }
@@ -953,7 +952,7 @@ describe("Config", () => {
                         parserOptions: {},
                         env: {},
                         globals: {},
-                        parser: undefined,
+                        parser: void 0,
                         rules: {
                             "project-level-rule": 2,
                             "subfolder-level-rule": 2
diff --git a/tests/lib/config/config-file.js b/tests/lib/config/config-file.js
index 210a9de35..adddd07a2 100644
--- a/tests/lib/config/config-file.js
+++ b/tests/lib/config/config-file.js
@@ -16,6 +16,7 @@ const assert = require("chai").assert,
     os = require("os"),
     yaml = require("js-yaml"),
     shell = require("shelljs"),
+    espree = require("espree"),
     ConfigFile = require("../../../lib/config/config-file"),
     Linter = require("../../../lib/linter"),
     Config = require("../../../lib/config");
@@ -48,17 +49,6 @@ function getFixturePath(filepath) {
     return path.resolve(__dirname, "../../fixtures/config-file", filepath);
 }
 
-/**
- * Reads a JS configuration object from a string to ensure that it parses.
- * Used for testing configuration file output.
- * @param {string} code The code to eval.
- * @returns {*} The result of the evaluation.
- * @private
- */
-function readJSModule(code) {
-    return eval(`var module = {};\n${code}`); // eslint-disable-line no-eval
-}
-
 /**
  * Helper function to write configs to temp file.
  * @param {Object} config Config to write out to temp file.
@@ -1229,7 +1219,7 @@ describe("ConfigFile", () => {
         });
 
         leche.withData([
-            ["JavaScript", "foo.js", readJSModule],
+            ["JavaScript", "foo.js", espree.parse],
             ["JSON", "bar.json", JSON.parse],
             ["YAML", "foo.yaml", yaml.safeLoad],
             ["YML", "foo.yml", yaml.safeLoad]
diff --git a/tests/lib/rules/indent.js b/tests/lib/rules/indent.js
index d1fd9c1ca..d3ba4e2a1 100644
--- a/tests/lib/rules/indent.js
+++ b/tests/lib/rules/indent.js
@@ -9114,6 +9114,48 @@ ruleTester.run("indent", rule, {
                 </div>
             `,
             errors: expectedErrors([3, 8, 6, "Block"])
+        },
+        {
+            code: unIndent`
+                ({
+                    foo
+                    }: bar) => baz
+            `,
+            output: unIndent`
+                ({
+                    foo
+                }: bar) => baz
+            `,
+            errors: expectedErrors([3, 0, 4, "Punctuator"]),
+            parser: require.resolve("../../fixtures/parsers/babel-eslint7/object-pattern-with-annotation")
+        },
+        {
+            code: unIndent`
+                ([
+                    foo
+                    ]: bar) => baz
+            `,
+            output: unIndent`
+                ([
+                    foo
+                ]: bar) => baz
+            `,
+            errors: expectedErrors([3, 0, 4, "Punctuator"]),
+            parser: require.resolve("../../fixtures/parsers/babel-eslint7/array-pattern-with-annotation")
+        },
+        {
+            code: unIndent`
+                ({
+                    foo
+                    }: {}) => baz
+            `,
+            output: unIndent`
+                ({
+                    foo
+                }: {}) => baz
+            `,
+            errors: expectedErrors([3, 0, 4, "Punctuator"]),
+            parser: require.resolve("../../fixtures/parsers/babel-eslint7/object-pattern-with-object-annotation")
         }
     ]
 });
diff --git a/tests/lib/rules/padding-line-between-statements.js b/tests/lib/rules/padding-line-between-statements.js
index e4a0d8109..543c06dd9 100644
--- a/tests/lib/rules/padding-line-between-statements.js
+++ b/tests/lib/rules/padding-line-between-statements.js
@@ -2359,6 +2359,12 @@ ruleTester.run("padding-line-between-statements", rule, {
             options: [
                 { blankLine: "always", prev: "*", next: ["if", "for", "return", "switch", "case", "break", "throw", "while", "default"] }
             ]
+        },
+        {
+            code: "function test() {};",
+            options: [
+                { blankLine: "always", prev: "block-like", next: "block-like" }
+            ]
         }
     ],
     invalid: [
diff --git a/tests/lib/util/source-code.js b/tests/lib/util/source-code.js
index cfc6f1f69..c3506ef1e 100644
--- a/tests/lib/util/source-code.js
+++ b/tests/lib/util/source-code.js
@@ -61,37 +61,39 @@ describe("SourceCode", () => {
             assert.equal(sourceCode.lines[1], "bar;");
         });
 
-        /* eslint-disable no-new */
-
         it("should throw an error when called with an AST that's missing tokens", () => {
 
-            assert.throws(() => {
-                new SourceCode("foo;", { comments: [], loc: {}, range: [] });
-            }, /missing the tokens array/);
+            assert.throws(
+                () => new SourceCode("foo;", { comments: [], loc: {}, range: [] }),
+                /missing the tokens array/
+            );
 
         });
 
         it("should throw an error when called with an AST that's missing comments", () => {
 
-            assert.throws(() => {
-                new SourceCode("foo;", { tokens: [], loc: {}, range: [] });
-            }, /missing the comments array/);
+            assert.throws(
+                () => new SourceCode("foo;", { tokens: [], loc: {}, range: [] }),
+                /missing the comments array/
+            );
 
         });
 
         it("should throw an error when called with an AST that's missing location", () => {
 
-            assert.throws(() => {
-                new SourceCode("foo;", { comments: [], tokens: [], range: [] });
-            }, /missing location information/);
+            assert.throws(
+                () => new SourceCode("foo;", { comments: [], tokens: [], range: [] }),
+                /missing location information/
+            );
 
         });
 
         it("should throw an error when called with an AST that's missing range", () => {
 
-            assert.throws(() => {
-                new SourceCode("foo;", { comments: [], tokens: [], loc: {} });
-            }, /missing range information/);
+            assert.throws(
+                () => new SourceCode("foo;", { comments: [], tokens: [], loc: {} }),
+                /missing range information/
+            );
         });
 
         it("should store all tokens and comments sorted by range", () => {