-
Notifications
You must be signed in to change notification settings - Fork 336
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
Introduce option to prevent underlining multiple lines #463
Conversation
@bsuh thanks for the PR. Actually I am pretty reluctant to add something like this even if it is behind a flag. I always stayed away from tempering with eslint error information. This might very likely lead to other problems. For example when running an ESLint task which will report a multi line error again which you can't temper with. Why do you want to have this feature. In addition such a setting must be a resource setting and not a global setting. It will avoid the need for reloading the window when the setting changes. |
The scope is set as "resource". I am evaluating switching editors from emacs to VSCode, so I am not familiar at all with VSCode or writing extensions. I couldn't get the setting to take effect, because the configuration is passed during server initialization. How can I pass the new configuration value to the server? I want this feature because I have to maintain a brownfield project that doesn't use default exports and my team decided to adopt a very opinionated ESLint configuration, with one of the rules being eslint-import/prefer-default-export, the one in the demo that underlines the entire object / class masking pretty much every other ESLint error / warning within the object / class. |
Resource level operations are resolved here: https://github.com/Microsoft/vscode-eslint/blob/master/client/src/extension.ts#L477 I still think tempering with error informatin caused more problems down the road even if behind a flag. |
Ok. Can you give actionable advice whether that is "Stop working on the PR, it won't be merged" or "Add a warning to the description of the setting"? |
I do see the problems with the huge red underlines. Since this extension has now knowledge about the AST it can only shorten the underline to one line. A better solution might be to have the underline only on a meaningful AST node (e.g.
Have you tried to talk to the ESLint people about this to see what they think. It could be a general option there. |
Seems like ESLint are leaning against adding such a thing. |
Are there any news about this? Instead, I'd even suggest having the ability to just show the error on the first token in the range, not even the entire single line, so to not cover subsequent errors in the same line. What is the argument against having this as an option? Without this option the extension is pretty much useless unless I use a very outdated version of |
I will close the PR since I am still not a fan to add this due to consistency |
Fixes #370
Demo