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

fix: add apex rule msg referring to graphql and link rule doc #86

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

ben-zhang-at-salesforce
Copy link
Contributor

  1. polish apex rule to refer graphq.
  2. add doc link to md file.

@@ -23,12 +24,13 @@ export const rule = ESLintUtils.RuleCreator.withoutDocs({
},
meta: {
docs: {
url: getDocUrl(APEX_IMPORT_RULE_ID),
description:
'Using Apex in LWC Offline-enabled mobile apps requires additional considerations to ensure proper functioning in offline scenarios. See Use Apex While Mobile and Offline (https://developer.salesforce.com/docs/atlas.en-us.mobile_offline.meta/mobile_offline/apex.htm) for more details. GraphQL API is a new paradigm of sending and receiving data. This API allows developers to interact with the Salesforce Platform through GraphQL, a standard query language for APIs and a runtime for fulfilling those queries with your data. Learn more about creating SOQL queries with GraphQL that may work better for mobile offline use cases. https://developer.salesforce.com/docs/platform/graphql/guide/graphql-wire-lwc.html'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @khawkins, need your help on the message or description wording polish. thx

Copy link
Collaborator

Choose a reason for hiding this comment

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

It feels like in a world where we have backing "long-form" docs for each rule, saying less in the inline messaging is probably better, deferring the more detailed content to the long-form doc.

Copy link
Collaborator

Choose a reason for hiding this comment

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

So yeah, both meta > docs > description (here), and meta > messages > [APEX_IMPORT_RULE_ID] (below) are too long. These should effectively be one-liners. Consider ESLint's array-callback-return docs configuration as an example. Their description value shows up in their extended docs here:

image

Whereas clicking into the configured url link leads to a detailed doc page. We should be shooting for a similar approach, leaving the description value as something like:

Using Apex in LWC Offline-enabled mobile apps requires additional considerations to ensure proper functioning in offline scenarios.

And then using the backing doc to explain the rest of the details.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx @khawkins make sense to shorten the msg to short one line and link to a fat/meaty external doc.

@clivewong you are writing the meaty doc. Mind to give a one line for the written or to be written doc, thx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thx @clivewong the msg Using Apex in LWC Offline-enabled mobile apps requires additional considerations. Consider using GraphQL for mobile offline use cases. is nice!

@@ -23,6 +24,7 @@ export const rule: GraphQLESLintRule = {
hasSuggestions: false,
docs: {
category: 'Operations',
url: getDocUrl(NO_MORE_THAN_100_FIELDS_RULE_ID),
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @clivewong, need your help to create the md file for this rule. thx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants