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

Add eslint.codeActionsOnSave.options #1945

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JavaScriptBach
Copy link

@JavaScriptBach JavaScriptBach commented Oct 30, 2024

Add an eslint.codeActionsOnSave.options that allows users to customize the options that ESLint runs with on save. This allows passing in a different set of options to ESLint on save, allowing a greater degree of customization than eslint.codeActionsOnSave.rules.

See motivation in #1938 (comment).

@JavaScriptBach
Copy link
Author

@microsoft-github-policy-service agree [company="Vanta"]

@JavaScriptBach
Copy link
Author

@microsoft-github-policy-service agree company="Vanta"

@JavaScriptBach JavaScriptBach marked this pull request as ready for review October 30, 2024 02:35
@JavaScriptBach
Copy link
Author

@dbaeumer I think I've followed your instructions correctly in #1938 (comment). Is there a way I can build and install this extension locally so I can test whether the setting works?

@dbaeumer
Copy link
Member

You can run from source

  • debug viewlet
  • Run Client lauch config

To build and install locally do the following:

  • dump the version number 3.0.15
  • npm run compile
  • install vsce globally
  • run vsce package This produces a local vsix file
  • Run command: Install from VSIX
  • Select the local vsix file

Let me know how it goes.

@dbaeumer
Copy link
Member

I did a first quick look and one thing I noticed is: do we want to support to only provide options without any rule modifications. That would have an impact on the code here: https://github.com/microsoft/vscode-eslint/blob/main/server/src/eslint.ts#L515

@JavaScriptBach
Copy link
Author

I was thinking if eslint.codeActionsOnSave.options is set, then eslint.codeActionsOnSave.rules should be ignored. The user can supply their own config in options, which means they should still be able to customize the rules.

@JavaScriptBach JavaScriptBach marked this pull request as draft October 31, 2024 04:59
@dbaeumer
Copy link
Member

I was thinking if eslint.codeActionsOnSave.options is set, then eslint.codeActionsOnSave.rules should be ignored. The user can supply their own config in options, which means they should still be able to customize the rules.

I think we should still allow this. If users already customized this and he simply wants to add some basic options I would still prefer to allow this.

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