Comments (5)
It is possible to opt out of a specific language by excluding it from the setting of the "stylelint.validate"
option in #79.
However, specific languages can also be excluded from codeActionsOnSave
using the options currently available.
"[javascript]": {
"editor.codeActionsOnSave": {
"source.fixAll.stylelint": false
}
}
https://github.com/stylelint/vscode-stylelint#editorcodeactionsonsave
I think the problem is that non-CSS-like languages are targeted by default. So I think it is necessary to change the default option of "stylelint.validate"
.
I think "stylelint.validate"
should be configured with css
, scss
, sass
, less
, html
, vue
, postcss
and sugarss
by default.
Users can add javascript
, markdown
and etc. by configuration according to their needs.
However, this will be a breaking change.
from vscode-stylelint.
With the latest version of VSCode, editor.codeActionsOnSaveTimeout
is now deprecated. VSCode no longers stops all formatting when stylelint takes too long; instead, it shows a popup when the formatting starts taking too long. It doesn't remove the issue, especially not when it comes to all file types being affected.
from vscode-stylelint.
Thanks, @axelboc, will try to debug this via some tests today if possible
We had added this to our docs, so I'll remove that now:
https://github.com/stylelint/vscode-stylelint#commands
Also note that there is a time budget of 750ms to run code actions on save which might not be enough for large files. You can increase the time budget using theeditor.codeActionsOnSaveTimeout
setting.
And for reference:
https://code.visualstudio.com/updates/v1_42#_handling-slow-save-operations
Handling slow save operations#VS Code allows extensions to change a file's contents when saving files to disk. Features like Format on Save and Fix on Save are examples. However, saving is a critical operation and extensions doing processing during a save must finish quickly so that the actual save operation can proceed. "Quickly" used to be enforced by VS Code, where VS Code would cancel extension save operations after a timeout. That enforcement guaranteed speedy saving but could be frustrating because sometimes expected processing would not happen.
With this release, we have given up the timeout-based approach and instead show a progress notification that allows you to cancel extensions participating in save ("Save Participants"). The notification lets you know that save operations are running and you can decide if you want to wait for a save participant to finish or not.
from vscode-stylelint.
What's most surprising to me is that it affects non-CSS files
stylelint supports more languages than just CSS.
and it shouldn't take so long on CSS files either anyway
We're tracking this in stylelint/stylelint#2454
It doesn't remove the issue, especially not when it comes to all file types being affected.
I agree. We need to make it easy for users to opt-out of certain language support.
@ota-meshi Will #79 resolve this? If so, I think we can close this once we've merged and documented this feature.
from vscode-stylelint.
v1 will only enable validation/actions/formatting for documents with language identifiers css
, less
, and postcss
by default, following in line with changes in Stylelint 14 which remove the syntax
option and require explicitly opting in to validating non-CSS files using customSyntax
and overrides
. I think this should resolve this issue, so I'm going to close it. Post-v1 release, which should be happening shortly, if this is not addressed, please feel free to reopen the issue.
from vscode-stylelint.
Related Issues (20)
- [Feature]: Configure when linting runs
- [Bug]: Setting the path to Stylelint fails HOT 2
- [Bug]: HOT 2
- Error not recognised in vscode HOT 3
- Code Helper HOT 1
- [Feature]: Add .scss to the Stylelint extension fix on save and error lens. HOT 2
- [Bug]: Error with prettier 3.0.0 HOT 1
- [Bug]: Not updating settings after editing the config file `.stylelintrc.json` HOT 4
- [Feature]: Update bundled StyleLint to version 15. HOT 1
- [Bug]: ESM-only stylelint plugins fail to import with Yarn PnP HOT 8
- [Feature]: enable markdown in error messages
- [Bug]: Prettier plugins cannot be resolved when package.json is not in the root folder HOT 1
- stylelint slowing down VS Code when saving files HOT 1
- VSCode extension does not respect folder settings! HOT 2
- [Bug]: format can't trigger auto fix HOT 13
- [Feature]: Surface "Error: No rules found within configuration. Have you provided a "rules" property?"
- The JS/TS language service immediately crashed 5 times. The service will not be restarted HOT 1
- CSS properties in comments increase indefinitely. HOT 24
- Fix double slash comments being appended to the nearest property in VSCode HOT 21
- Standardize labels HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-stylelint.