Drupal core ESLint incorrect peer dependency - prettier

Created on 26 September 2023, over 1 year ago
Updated 30 October 2023, about 1 year 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 5 days ago

  • Maintained by
  • ๐Ÿ‡ฌ๐Ÿ‡งUnited Kingdom @justafish
  • ๐Ÿ‡ซ๐Ÿ‡ทFrance @nod_
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