-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add a command to install eslint plugin #62
Conversation
@maliroteh-sf @dbreese @khawkins May I get help from you on the text copies please? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
"commandPalette": [ | ||
{ | ||
"command": "salesforcedx-vscode-offline-app.configureLintingTools", | ||
"when": "sfdx_project_opened" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh cool, I didn't know about this functionality. That's a clean way to specify a precondition here.
package.json
Outdated
{ | ||
"command": "salesforcedx-vscode-offline-app.configureLintingTools", | ||
"title": "%extension.commands.config-linting-tools.title%", | ||
"category": "%extension.commands.config-wizard.category%" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm, I'm not sure about this. In theory this doesn't just apply to the Starter Kit—or really at all, because the Starter Kit already has the linting rules configured out of the box. I wonder if we should define a new category, perhaps called "Salesforce Mobile Offline"?
const configureLintingToolsCommand = | ||
'salesforcedx-vscode-offline-app.configureLintingTools'; | ||
const eslintDependencies = [ | ||
['@salesforce/eslint-plugin-lwc-graph-analyzer', '^0.9.0'], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are configuration items where at least the version values would be better represented in contributes.configuration settings. That way a) we take hard-coded data out of the code, and b) users can update these values in their own personal configuration settings, to override the versions we select.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
static async configure(): Promise<boolean> { | ||
try { | ||
if (!WorkspaceUtils.lwcFolderExists()) { | ||
await this.showMessage('LWC folder does not exist.'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do these messages need any further context? I don't know what the message title/header will look like, if any. But on their own, these messages seem a little sparse/ambiguous.
} | ||
|
||
try { | ||
this.updateEslintrc(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be tracking whether this file was updated or not too, and reporting to the user accordingly—even if the report is built into a single message. We could be updating this but not the devDependencies
, and vice versa. We should be clear to the user, exactly what's being updated and what is not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's all the feedback I have. Looks good over all!
Co-authored-by: Kevin Hawkins <khawkins@salesforce.com>
Co-authored-by: Kevin Hawkins <khawkins@salesforce.com>
Co-authored-by: Kevin Hawkins <khawkins@salesforce.com>
Co-authored-by: Kevin Hawkins <khawkins@salesforce.com>
"configuration": { | ||
"title": "%salesforce.mobile.extensions%", | ||
"properties": { | ||
"mobileOfflineLinting.eslint-plugin-lwc-graph-analyzer": { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! I had a couple more message edit suggestions, but overall this looks good to me. 👍
Co-authored-by: Kevin Hawkins <khawkins@salesforce.com>
Co-authored-by: Kevin Hawkins <khawkins@salesforce.com>
This command will add an item in
devDependencies
ofpackage.json
. That item iseslint-plugin-lwc-graph-analyzer
.If there is no
.eslintrc.json
or is missing to add configuration there that would be added too.