forcedotcom / lightning-language-server

LWC and Aura Language Servers - shipped as part of the Salesforce VSCode Extensions
https://forcedotcom.github.io/salesforcedx-vscode/
BSD 3-Clause "New" or "Revised" License
33 stars 49 forks source link

messageService.d.ts file contains incorrect default parameter values for subscribe method #545

Closed jlawrence124 closed 1 year ago

jlawrence124 commented 1 year ago

Summary

The TS definition file for lightning/messageService provides type information for the lightning/messageService. The subscribe function within that file indicates that subscriberOptions is a required parameter. According to the documentation subscriberOptions is an optional parameter.

Steps To Reproduce:

  1. Launch a SFDX project in VSCode with the Salesforce Extension Pack (I'm using ebikes here)
  2. Set the checkJS option to true in the "compilerOptions" object and add "../../../../.sfdx/typings/*/.d.ts" to the "include" array in the jsconfig.json image
  3. Navigate to a file that has a subscribe() function from lightning/messageService (productTileList.js in ebikes)
  4. Mouse over the subscribe function, scroll down within the and view the message that indicates a 4th parameter is expected image

Expected result

  1. No message should be displayed. The subscriberOptions parameter is optional according to the documentation. https://developer.salesforce.com/docs/component-library/bundle/lightning-message-service/documentation image

Actual result

  1. A linting message is displayed expecting a 4th parameter 2023-02-22_19h04_41

Additional information

Salesforce Extension Version in VS Code: v57.2.1

SFDX CLI Version: 7.188.1-4a4bb9c

OS and version: Windows 10 19044.2486