fixers/stylelint: enhance stylelint fixer#2745
Conversation
|
Please hold on review, I'm running into a bug where the error output is actually replacing the buffer when using stdin. Seems to affect other syntaxes (ie. SCSS): ❯ echo '.foo- {' | npx stylelint --fix --stdin-filename foo.scss
foo.scss
1:1 ✖ Unclosed block CssSyntaxError❯ echo '.foo- {' | npx stylelint --fix --stdin-filename foo.css
.foo- {
} |
|
According to stylelint/stylelint#3633, it seems to only happen when a non-CSS Without any ❯ echo '$color:red; .foo { &-bar { color:$color } }' | npx stylelint --fix --stdin-filename foo.css
$color:red; .foo { &-bar { color:$color } }With ❯ echo '$color:red; .foo { &-bar { color:$color } }' | npx stylelint --fix --stdin-filename foo.css
$color:
red; .foo { &-bar { color:$color } }With ❯ echo '.foo- {' | npx stylelint --fix --stdin-filename foo.css
.foo- {
}As such, I've made a change to force a |
|
Does this work acceptably well for other file formats? |
|
I have not yet tested with other file formats since I've found that this workaround still isn't a good enough solution. I'm still occasionally running into issues where Let me know how you want to proceed. My guess is that it's either a bug in |
|
If the |
Done. Two things worth noting:
Sounds good, stay tuned 📺 Thanks! |
* master: (39 commits) Fix the test issues with html-beautify Add support for html-beautify (dense-analysis#2788) fixers/stylelint: enhance `stylelint` fixer (dense-analysis#2745) Fix dense-analysis#2835 - Bump up the sign group version check for NeoVim Mention the disabled option for message severity Adding support for LSP `window/showMessage` method (dense-analysis#2652) Fix tsserver not returning details for items with empty source Allow code actions to work on callback based sources Add support for nimlsp (dense-analysis#2815) Add definition of c/clangd's language as C (dense-analysis#2791) Bump the ALE version Fix TCP server config example. Suboptimal fix to prevent variables from leaking out of new clangd test Hopefully fixed issue with Windows paths Added tests for clangd compile commands dectection Updated ale_linters/c/clangd.vim to match ale_linters/cpp/clangd.vim Fix dense-analysis#2800 - Ignore completion user data which is not a dictionary Fix dense-analysis#2821 - Fix the debride linter after merging older code Add the possiblity to add extra psalm options fix tflint handler for 0.11+ (dense-analysis#2775) ...
* Refactor stylelint fixer test * Support additional stylelint fixer options * Support changing working directory for stylelint fixer * Force css syntax for stylelint fixer
👋
This upgrades the
stylelintfixer. A few things have been done:let g:ale_stylelint_optionsfor custom flags--stdin-filename(available in 6.3.0)stylelint(much of this is inspired from
fixers/prettier)I believe the combination of 2 & 3 may resolve a few issues since it allows any
stylelintplugins to find project configuration files as expected (similar to #2622). This may fix:Local Prettier config .prettierrc ignored for prettier-eslint fixer #2227Probably won't fix, seems unrelated tostylelintprettieris being used withstylelintprettier-eslint can not find eslint dependency installed locally #1648Probably won't fix, seems unrelated tostylelint