Drupal core ESLint incorrect peer dependency - prettier

Created on 26 September 2023, 12 months ago
Updated 30 October 2023, 10 months ago

Problem/Motivation

I'm unable to configure core's version of ESLint. There seems to be an issue with the `eslint-plugin-prettier` package.

Steps to reproduce

  • Install core version 10.1.4
  • Install Node v18
  • In the ''core" directory, run
    yarn install
  • In the console, notice the warning.
yarn install v1.22.19
[1/5] Validating package.json...
[2/5] Resolving packages...
[3/5] Fetching packages...
[4/5] Linking dependencies...
warning " > eslint-plugin-prettier@5.0.0" has incorrect peer dependency "prettier@>=3.0.0".
[5/5] Building fresh packages...
Done in 29.18s.
  • Now run ESLint on a JS file:
./node_modules/.bin/eslint ../modules/custom/my-module/js/my-file.js
  • Notice the console output.
Oops! Something went wrong! :(

ESLint: 8.44.0

ESLint couldn't find the plugin "eslint-plugin-prettier".

(The package "eslint-plugin-prettier" was not found when loaded as a Node module from the directory "/var/www/html/docroot".)

It's likely that the plugin isn't installed correctly. Try reinstalling by running the following:

    npm install eslint-plugin-prettier@latest --save-dev

The plugin "eslint-plugin-prettier" was referenced from the config file in "../.eslintrc.json Β» ./core/.eslintrc.json".

If you still can't figure out the problem, please stop by https://eslint.org/chat/help to chat with the team.
πŸ› Bug report
Status

Active

Version

10.1 ✨

Component
JavascriptΒ  β†’

Last updated 1 day ago

Created by

πŸ‡¦πŸ‡ΊAustralia jaydee1818 Melbourne

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Production build 0.71.5 2024