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

Unable to update to ESLint 9 as @lwc/eslint-plugin-lwc don't support it. #2986

Closed
PawelWozniak opened this issue Aug 19, 2024 · 3 comments
Closed
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated

Comments

@PawelWozniak
Copy link

Summary

I am keeping npm modules updated in my project but have stuck with ESLint 8.57.0 as @lwc/eslint-plugin-lwc don't support version 9.

Steps To Reproduce

In the project folder context type in CLI npm outdated

Package  Current  Wanted  Latest  Location             Depended by
eslint    8.57.0  8.57.0   9.9.0  node_modules/eslint  MyProject

then npm upgrade gives this result:

npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/eslint
npm error   dev eslint@"^9.9.0" from the root project
npm error   peer eslint@"^7.5.0 || ^8.0.0 || ^9.0.0" from @babel/[email protected]
npm error   node_modules/@babel/eslint-parser
npm error     dev @babel/eslint-parser@"^7.25.1" from the root project
npm error     peer @babel/eslint-parser@"^7" from @lwc/[email protected]
npm error     node_modules/@lwc/eslint-plugin-lwc
npm error       dev @lwc/eslint-plugin-lwc@"^1.8.2" from the root project
npm error
npm error Could not resolve dependency:
npm error peer eslint@"^7 || ^8" from @lwc/[email protected]
npm error node_modules/@lwc/eslint-plugin-lwc
npm error   dev @lwc/eslint-plugin-lwc@"^1.8.2" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error -----\npm-cache\_logs\2024-08-19T12_34_58_143Z-eresolve-report.txt
npm error A complete log of this run can be found in: -----\npm-cache\_logs\2024-08-19T12_34_58_143Z-debug-0.log

It seems that lwc/eslint-plugin-lwc is not supporting version 9 of ESLint.

In the context of upcoming typescript support, I would like to have the latest version installed and supported. https://developer.salesforce.com/docs/platform/lwc/guide/ts.html

Expected result

It is possible to install the latest ESLint.

Actual result

Unable to update ESLint due to dependency issues.

System Information

Windows 11, powershell 7.4.4

{
  "architecture": "win32-x64",
  "cliVersion": "@salesforce/cli/2.54.6",
  "nodeVersion": "node-v20.16.0",
  "osVersion": "Windows_NT 10.0.22631",
  "rootPath": "C:\\Users\\pwozn\\AppData\\Local\\sf\\client\\2.54.6-b1d011f",
  "shell": "powershell",
  "pluginVersions": [
    "@oclif/plugin-autocomplete 3.2.0 (core)",
    "@oclif/plugin-commands 4.0.10 (core)",
    "@oclif/plugin-help 6.2.8 (core)",
    "@oclif/plugin-not-found 3.2.15 (core)",
    "@oclif/plugin-plugins 5.4.2 (core)",
    "@oclif/plugin-search 1.2.5 (core)",
    "@oclif/plugin-update 4.5.2 (core)",
    "@oclif/plugin-version 2.2.10 (core)",
    "@oclif/plugin-warn-if-update-available 3.1.11 (core)",
    "@oclif/plugin-which 3.2.10 (core)",
    "@salesforce/cli 2.54.6 (core)",
    "apex 3.3.4 (core)",
    "auth 3.6.44 (core)",
    "data 3.5.14 (core)",
    "deploy-retrieve 3.9.25 (core)",
    "info 3.3.26 (core)",
    "limits 3.3.22 (core)",
    "marketplace 1.2.22 (core)",
    "org 4.4.5 (core)",
    "packaging 2.7.4 (core)",
    "schema 3.3.22 (core)",
    "settings 2.3.11 (core)",
    "sobject 1.4.26 (core)",
    "source 3.5.11 (core)",
    "telemetry 3.6.4 (core)",
    "templates 56.3.8 (core)",
    "trust 3.7.19 (core)",
    "user 3.5.22 (core)",
    "@salesforce/sfdx-scanner 4.4.0 (user) published 19 days ago (Tue Jul 30 2024)",
    "sfdmu 4.35.1 (user) published 0 days ago (Sun Aug 18 2024)",
    "sfdx-git-delta 5.42.0 (user) published 13 days ago (Mon Aug 05 2024)"
  ]
}

Additional information

@PawelWozniak PawelWozniak added the investigating We're actively investigating this issue label Aug 19, 2024
Copy link

Thank you for filing this issue. We appreciate your feedback and will review the issue as soon as possible. Remember, however, that GitHub isn't a mechanism for receiving support under any agreement or SLA. If you require immediate assistance, contact Salesforce Customer Support.

@github-actions github-actions bot added the validated Version information for this issue has been validated label Aug 19, 2024
@iowillhoit
Copy link
Contributor

Hello @PawelWozniak, the Salesforce CLI team does not own the @lwc/eslint-plugin-lwc package. It looks like that team is aware of the issue and has it on their roadmap. Feel free to comment on this existing issue: salesforce/eslint-config-lwc#128

@theperiscope
Copy link

Hello, I think this is also a CLI issue as it is the CLI that creates ESLint ^9.9.1 dependency for a new standard project. I've been having lots of issues issues with template setup lately, need to run npm install --legacy-peer-deps also due to ESLint 9 issue.

SF CLI version: latest, 2.59.6 from 2024-09-25

sf project generate --name test1 --template standard --output-dir .\
npm install 
npm install --legacy-peer-deps

package.json

{
  "name": "salesforce-app",
  "private": true,
  "version": "1.0.0",
  "description": "Salesforce App",
  "scripts": {
    "lint": "eslint **/{aura,lwc}/**/*.js",
    "test": "npm run test:unit",
    "test:unit": "sfdx-lwc-jest",
    "test:unit:watch": "sfdx-lwc-jest --watch",
    "test:unit:debug": "sfdx-lwc-jest --debug",
    "test:unit:coverage": "sfdx-lwc-jest --coverage",
    "prettier": "prettier --write \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
    "prettier:verify": "prettier --check \"**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}\"",
    "postinstall": "husky install",
    "precommit": "lint-staged"
  },
  "devDependencies": {
    "@lwc/eslint-plugin-lwc": "^1.1.2",
    "@prettier/plugin-xml": "^3.2.2",
    "@salesforce/eslint-config-lwc": "^3.2.3",
    "@salesforce/eslint-plugin-aura": "^2.0.0",
    "@salesforce/eslint-plugin-lightning": "^1.0.0",
    "@salesforce/sfdx-lwc-jest": "^5.1.0",
    "eslint": "^9.9.1",
    "eslint-plugin-import": "^2.25.4",
    "eslint-plugin-jest": "^28.8.1",
    "husky": "^9.1.5",
    "lint-staged": "^15.1.0",
    "prettier": "^3.1.0",
    "prettier-plugin-apex": "^2.0.1"
  },
  "lint-staged": {
    "**/*.{cls,cmp,component,css,html,js,json,md,page,trigger,xml,yaml,yml}": [
      "prettier --write"
    ],
    "**/{aura,lwc}/**/*.js": [
      "eslint"
    ]
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
investigating We're actively investigating this issue validated Version information for this issue has been validated
Projects
None yet
Development

No branches or pull requests

3 participants