Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore: Test on Node.js 15 #13844

Merged
merged 1 commit into from Nov 18, 2020
Merged

Chore: Test on Node.js 15 #13844

merged 1 commit into from Nov 18, 2020

Conversation

btmills
Copy link
Member

@btmills btmills commented Nov 15, 2020

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofixing to a rule
[ ] Add a CLI option
[ ] Add something to the core
[x] Other, please explain: Add Node.js 15 to the build matrix

What changes did you make? (Give an overview)

Running npm install in the repository with Node.js 15 currently requires the --legacy-peer-deps requirement because npm is resolving eslint-plugin-eslint-plugin's eslint peer dependency version as undefined.

Is there anything you'd like reviewers to focus on?

We can figure out later if that's an issue on our end or npm's, but in the meantime this will let us run CI on Node.js 15. I'm hoping this is a temporary situation so didn't update the contributing documentation to mention the flag.

Running `npm install` in the repository with Node.js 15 currently
requires the `--legacy-peer-deps` requirement because npm is resolving
`eslint-plugin-eslint-plugin`'s `eslint` peer dependency version as
`undefined`. We can figure out later if that's an issue on our end or
npm's, but in the meantime this will let us run CI on Node.js 15. I'm
hoping this is a temporary situation so didn't update the contributing
documentation to mention the flag.
@btmills btmills added build This change relates to ESLint's build process accepted There is consensus among the team that this change meets the criteria for inclusion chore This change is not user-facing labels Nov 15, 2020
@btmills
Copy link
Member Author

btmills commented Nov 15, 2020

Replacing the file: devDependencies with the new npm v7 workspaces feature resolves (heh) the peer resolution issues. With this diff (and an upgrade to eslint-plugin-jsdoc@^25.0.0 with a bumped eslint@^7.0.0 peerdep), npm install with npm v7 works without --legacy-peer-deps. Unfortunately it's mutually exclusive: we can't keep the file: devDependencies for npm v6 and have workspaces for npm v7, so we won't be able to do this until we can require at least npm v7 for dev environments. --legacy-peer-deps it is for the time being. (Unless the eslint@undefined version ends up being an npm bug.)

diff --git package.json package.json
index 3a90c63da..7f6d578f3 100644
--- package.json
+++ package.json
@@ -98,10 +98,7 @@
     "dateformat": "^3.0.3",
     "ejs": "^3.0.2",
     "escape-string-regexp": "^3.0.0",
-    "eslint": "file:.",
-    "eslint-config-eslint": "file:packages/eslint-config-eslint",
     "eslint-plugin-eslint-plugin": "^2.2.1",
-    "eslint-plugin-internal-rules": "file:tools/internal-rules",
     "eslint-plugin-jsdoc": "^22.1.0",
     "eslint-plugin-node": "^11.1.0",
     "eslint-release": "^2.0.0",
@@ -145,5 +142,10 @@
   "license": "MIT",
   "engines": {
     "node": "^10.12.0 || >=12.0.0"
-  }
+  },
+  "workspaces": [
+    ".",
+    "packages/eslint-config-eslint",
+    "tools/internal-rules"
+  ]
 }

Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

Running npm install in the repository with Node.js 15 currently requires the --legacy-peer-deps requirement because npm is resolving eslint-plugin-eslint-plugin's eslint peer dependency version as undefined.

Looks like a npm v7 bug to me.

@btmills
Copy link
Member Author

btmills commented Nov 19, 2020

Looks like a npm v7 bug to me.

Thanks for the double check on that. Opened npm/cli#2199 🤞

btmills added a commit that referenced this pull request Mar 23, 2021
`eslint-plugin-jsdoc` was the last upgrade needed to be compatible with
the new peer dependency resolution in npm v7.
mdjermanovic added a commit that referenced this pull request Mar 25, 2021
…ps (#14244)

* Chore: Upgrade eslint-plugin-jsdoc to v25

This is a Chore instead of an Upgrade because it's in `devDependencies`.
v25 is the first release of `eslint-plugin-jsdoc` to bump the `eslint`
peer dependency to allow `eslint@7`. Once it's upgraded, we won't have
to use `--legacy-peer-deps` to install dependencies with npm v7. The
newer version was unsatisfied with the `cliOptions` param to
`translateOptions` typed as just `Object`, so I turned our Optionator
config into a JSDoc typedef.

* Chore: npm v7 no longer needs --legacy-peer-deps (refs #13844)

`eslint-plugin-jsdoc` was the last upgrade needed to be compatible with
the new peer dependency resolution in npm v7.

* Docs: Make ParsedCLIOptions typedef name consistent

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

* Docs: Properties with default values are non-optional

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

* Docs: Add _ filenames/patterns to ParsedCLIOptions typedef

* Docs: ParsedCLIOptions.fixType is optional

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>

Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators May 18, 2021
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label May 18, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion build This change relates to ESLint's build process chore This change is not user-facing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants