Repository: eslint/eslint
Pull request #11161 (2018-12-05 17:06:35)

Upgrade: Espree v5.0.0
<!--
    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)**

[ ] 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
[X] 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.)
-->

Upgrading to Espree v5.0.0 (which removes comment attachment).

<!--
    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)**
Upgrade espree from `^4.0.0` to `^5.0.0`.


**Is there anything you'd like reviewers to focus on?**
Nothing in particular.

jaydenseric: Hopefully it will fix this warning on installation:

```
npm WARN acorn-jsx@5.0.1 requires a peer of acorn@^6.0.0 but none is installed. You must install peer dependencies yourself.
```

```
$ npm ls acorn-jsx
[redacted]
└─┬ eslint@5.9.0
  └─┬ espree@4.1.0
    └── acorn-jsx@5.0.1
```

```
$ npm ls acorn
[redacted]
└─┬ next@7.0.2
  └─┬ webpack@4.20.2
    ├── acorn@5.7.3
    └─┬ acorn-dynamic-import@3.0.0
      └── acorn@5.7.3  deduped
```

Patch:
diff --git a/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/.github/ISSUE_TEMPLATE/BUG_REPORT.md
index a614d6b2f..1e9a73641 100644
--- a/.github/ISSUE_TEMPLATE/BUG_REPORT.md
+++ b/.github/ISSUE_TEMPLATE/BUG_REPORT.md
@@ -1,6 +1,9 @@
 ---
 name: "\U0001F41E  Bug report"
 about: Report an issue with ESLint or rules bundled with ESLint
+title: ''
+labels: bug, evaluating
+assignees: ''
 
 ---
 
@@ -56,5 +59,3 @@ about: Report an issue with ESLint or rules bundled with ESLint
 
 
 **Are you willing to submit a pull request to fix this bug?**
-
-
diff --git a/.github/ISSUE_TEMPLATE/CHANGE.md b/.github/ISSUE_TEMPLATE/CHANGE.md
index 3fe2fe241..35cb70243 100644
--- a/.github/ISSUE_TEMPLATE/CHANGE.md
+++ b/.github/ISSUE_TEMPLATE/CHANGE.md
@@ -1,6 +1,9 @@
 ---
 name: "\U0001F4DD Non-rule change request"
 about: Request a change that is not a bug fix, rule change, or new rule
+title: ''
+labels: core, enhancement, evaluating
+assignees: ''
 
 ---
 
@@ -27,4 +30,3 @@ about: Request a change that is not a bug fix, rule change, or new rule
 
 
 **Are you willing to submit a pull request to implement this change?**
-
diff --git a/.github/ISSUE_TEMPLATE/NEW_RULE.md b/.github/ISSUE_TEMPLATE/NEW_RULE.md
index 247302d7b..0fa62b1cf 100644
--- a/.github/ISSUE_TEMPLATE/NEW_RULE.md
+++ b/.github/ISSUE_TEMPLATE/NEW_RULE.md
@@ -1,6 +1,9 @@
 ---
 name: "\U0001F680 New rule proposal"
 about: Propose a new rule to be added to ESLint
+title: ''
+labels: rule, feature, evaluating
+assignees: ''
 
 ---
 
@@ -37,4 +40,3 @@ about: Propose a new rule to be added to ESLint
 
 
 **Are you willing to submit a pull request to implement this rule?**
-
diff --git a/.github/ISSUE_TEMPLATE/QUESTION.md b/.github/ISSUE_TEMPLATE/QUESTION.md
index ba96b4104..375e2170a 100644
--- a/.github/ISSUE_TEMPLATE/QUESTION.md
+++ b/.github/ISSUE_TEMPLATE/QUESTION.md
@@ -1,6 +1,9 @@
 ---
 name: "⛔ Question"
 about: Please go to https://gitter.im/eslint/eslint
+title: ''
+labels: ''
+assignees: ''
 
 ---
 
diff --git a/.github/ISSUE_TEMPLATE/RULE_CHANGE.md b/.github/ISSUE_TEMPLATE/RULE_CHANGE.md
index 9ecb2d002..88e250f96 100644
--- a/.github/ISSUE_TEMPLATE/RULE_CHANGE.md
+++ b/.github/ISSUE_TEMPLATE/RULE_CHANGE.md
@@ -1,6 +1,9 @@
 ---
 name: "\U0001F4DD Rule change request"
 about: Request a change to an existing rule
+title: ''
+labels: enhancement, evaluating, rule
+assignees: ''
 
 ---
 
@@ -34,4 +37,4 @@ about: Request a change to an existing rule
 
 **What will the rule do after it's changed?**
 
-**Are you willing to submit a pull request to implement this change?**
\ No newline at end of file
+**Are you willing to submit a pull request to implement this change?**
diff --git a/.github/ISSUE_TEMPLATE/SECURITY.md b/.github/ISSUE_TEMPLATE/SECURITY.md
index 8cc33ec6e..c04f52536 100644
--- a/.github/ISSUE_TEMPLATE/SECURITY.md
+++ b/.github/ISSUE_TEMPLATE/SECURITY.md
@@ -1,6 +1,9 @@
 ---
 name: "⛔ Security issue"
 about: Please file security issues at https://hackerone.com/eslint
+title: ''
+labels: ''
+assignees: ''
 
 ---
 
diff --git a/docs/rules/object-shorthand.md b/docs/rules/object-shorthand.md
index 6f2471faf..79e76655c 100644
--- a/docs/rules/object-shorthand.md
+++ b/docs/rules/object-shorthand.md
@@ -84,7 +84,7 @@ var foo = {
 
 See Also:
 
-- [`no-useless-rename`](https://eslint.org/docs/rules/object-shorthand) which disallows renaming import, export, and destructured assignments to the same name.
+- [`no-useless-rename`](https://eslint.org/docs/rules/no-useless-rename) which disallows renaming import, export, and destructured assignments to the same name.
 
 ## Options
 
diff --git a/lib/rules/require-jsdoc.js b/lib/rules/require-jsdoc.js
index 949314993..389bfb692 100644
--- a/lib/rules/require-jsdoc.js
+++ b/lib/rules/require-jsdoc.js
@@ -43,7 +43,10 @@ module.exports = {
                 },
                 additionalProperties: false
             }
-        ]
+        ],
+
+        deprecated: true,
+        replacedBy: []
     },
 
     create(context) {
diff --git a/lib/rules/valid-jsdoc.js b/lib/rules/valid-jsdoc.js
index b434491bf..b40a20f6b 100644
--- a/lib/rules/valid-jsdoc.js
+++ b/lib/rules/valid-jsdoc.js
@@ -64,7 +64,10 @@ module.exports = {
             }
         ],
 
-        fixable: "code"
+        fixable: "code",
+
+        deprecated: true,
+        replacedBy: []
     },
 
     create(context) {
diff --git a/lib/util/source-code.js b/lib/util/source-code.js
index 765fde725..4e90ac1aa 100644
--- a/lib/util/source-code.js
+++ b/lib/util/source-code.js
@@ -316,6 +316,7 @@ class SourceCode extends TokenStore {
      * @returns {Token|null} The Block comment token containing the JSDoc comment
      *      for the given node or null if not found.
      * @public
+     * @deprecated
      */
     getJSDocComment(node) {
 
diff --git a/package.json b/package.json
index 2cbe9f0b3..441828725 100644
--- a/package.json
+++ b/package.json
@@ -44,7 +44,7 @@
     "eslint-scope": "^4.0.0",
     "eslint-utils": "^1.3.1",
     "eslint-visitor-keys": "^1.0.0",
-    "espree": "^4.0.0",
+    "espree": "^5.0.0",
     "esquery": "^1.0.1",
     "esutils": "^2.0.2",
     "file-entry-cache": "^2.0.0",


Test patch:
diff --git a/tests/lib/cli-engine.js b/tests/lib/cli-engine.js
index d5b0b3728..9a57e86df 100644
--- a/tests/lib/cli-engine.js
+++ b/tests/lib/cli-engine.js
@@ -733,6 +733,7 @@ describe("CLIEngine", () => {
         it("should warn when deprecated rules are found in a config", () => {
             engine = new CLIEngine({
                 cwd: originalDir,
+                useEslintrc: false,
                 configFile: "tests/fixtures/cli-engine/deprecated-rule-config/.eslintrc.yml"
             });
 
@@ -1530,7 +1531,11 @@ describe("CLIEngine", () => {
 
             assert.deepStrictEqual(
                 report.usedDeprecatedRules,
-                [{ ruleId: "indent-legacy", replacedBy: ["indent"] }]
+                [
+                    { ruleId: "indent-legacy", replacedBy: ["indent"] },
+                    { ruleId: "require-jsdoc", replacedBy: [] },
+                    { ruleId: "valid-jsdoc", replacedBy: [] }
+                ]
             );
         });
 
@@ -1538,7 +1543,7 @@ describe("CLIEngine", () => {
             engine = new CLIEngine({
                 cwd: originalDir,
                 configFile: ".eslintrc.js",
-                rules: { indent: 1 }
+                rules: { indent: 1, "valid-jsdoc": 0, "require-jsdoc": 0 }
             });
 
             const report = engine.executeOnFiles(["lib/cli*.js"]);
@@ -1549,7 +1554,8 @@ describe("CLIEngine", () => {
         it("should warn when deprecated rules are found in a config", () => {
             engine = new CLIEngine({
                 cwd: originalDir,
-                configFile: "tests/fixtures/cli-engine/deprecated-rule-config/.eslintrc.yml"
+                configFile: "tests/fixtures/cli-engine/deprecated-rule-config/.eslintrc.yml",
+                useEslintrc: false
             });
 
             const report = engine.executeOnFiles(["lib/cli*.js"]);