apm-agent-nodejs icon indicating copy to clipboard operation
apm-agent-nodejs copied to clipboard

upgrade to eslint@8

Open trentm opened this issue 3 years ago • 2 comments

If after we switch to eslint (https://github.com/elastic/apm-agent-nodejs/pull/2579) is in, we should upgrade from the current eslint@6 to eslint@7. https://eslint.org/docs/user-guide/migrating-to-7.0.0

  • drops node v8 support
  • Deal with "no-var" rule. A quick run with the update to eslint-config-standard@16 results in ~2000 of these. I'm not sure if --fix will automatically fix these.
  167:7   warning  Unexpected var, use let or const instead  no-var

Note: Why not eslint@8 yet? The current latest is eslint@8, but eslint-config-standard and standard aren't ready for eslint@8 until eslint-config-standard@17 (https://github.com/standard/standard/blob/master/CHANGELOG.md#1700-0---2022-01-31), which is current in pre-release.

Update (2022-07-14): eslint-config-standard@17 is released now, so I believe moving to eslint@8 would be possible now. See https://github.com/elastic/apm-agent-nodejs/pull/2820 and https://github.com/elastic/apm-agent-nodejs/pull/2817

trentm avatar Feb 22 '22 19:02 trentm

The starter diff I had for this:

diff --git a/package.json b/package.json
index 4ddb8e38..e760f5f5 100644
--- a/package.json
+++ b/package.json
@@ -139,10 +139,10 @@
     "dashdash": "^2.0.0",
     "dependency-check": "^4.1.0",
     "elasticsearch": "^16.5.0",
-    "eslint": "^6.8.0",
-    "eslint-config-standard": "^14.1.1",
+    "eslint": "^7.32.0",
+    "eslint-config-standard": "^16.0.3",
     "eslint-plugin-import": "^2.25.4",
-    "eslint-plugin-node": "^10.0.0",
+    "eslint-plugin-node": "^11.1.0",
     "eslint-plugin-promise": "^4.3.1",
     "eslint-plugin-standard": "^4.1.0",
     "express": "^4.17.1",

trentm avatar Feb 22 '22 19:02 trentm

Consider eslint@8 now.

trentm avatar Jun 27 '22 18:06 trentm

Note all these dependabot PRs, many of which have been deferred to do as part of this update: https://github.com/elastic/apm-agent-nodejs/issues?q=label%3Adependencies+eslint+in%3Atitle

trentm avatar Sep 26 '22 16:09 trentm