You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm wondering if there's a way to get stylelint to report this to sublimelinter, although it works great from the command line, it doesn't work actively while typing in sublime. Have you or anyone else had any luck with that? Also, @yisibl thanks for posting this, helped me get started.
@equinusocio The latest version of stylelint can directly support *.vue files, but you need to delete processors in the configuration file.
If you need to use other postcss tool, not just stylelint, you can use this way:
npm i --save postcss postcss-syntax postcss-html
postcss(plugins).process(source,{syntax: require('postcss-syntax')}).then((result)=>{// An alias for the result.css property. Use it with syntaxes that generate non-CSS output.result.content});
equinusocio, Jerome1337, escapedcat, resessh and AllanChain
Defining the syntax package break all the plugins. Removing it stylelint will throw errors parsing the html template. I'm using latest versions of all.
After trying many things, I got stylelint autofix to work with .vue files in vscode using SaveOnRun extension.
added below config in the settting.json:
Hey guys, can you help me?
I setup stylelint, and try fix my files use this command: "lint:style": "stylelint --fix **/*.{vue,css,scss,sass}"
I got this message: Autofix is incompatible with processors and will be disabled. Are you sure you need a processor?
my config:
Activity
xmoki commentedon Sep 5, 2016
I think is possible to do it with htmlhint, but currently only supports jshint and csslint, maybe if someone can make a htmlhint rule for stylelint.
JounQin commentedon Sep 5, 2016
Actually we could use
<style src="/path/of/style/file"/>
then just lint the style file as usual.yisibl commentedon Nov 9, 2016
Touch
.stylelintrc
Install
Add
lint:css
topackage.json
npm run lint:css
👻dan-gamble commentedon Nov 13, 2016
@yisibl that works for me, swear i tried this before!
scottsandersdev commentedon Dec 5, 2016
I'm wondering if there's a way to get stylelint to report this to sublimelinter, although it works great from the command line, it doesn't work actively while typing in sublime. Have you or anyone else had any luck with that? Also, @yisibl thanks for posting this, helped me get started.
bartkozal commentedon Feb 12, 2017
For the record, this is working configuration for webpack:
.stylelintrc
build/webpack.dev.conf.js
for Vue webpack template)I published an article which includes both solutions and explains two additional things (configuration rules and errors when starting the dev server).
KangdaOOLin commentedon Feb 14, 2017
@bkzl i follow your config, use the
stylelint-webpack-plugin
, it can work, but the line number of error reporter is incorrect for.vue
file.bartkozal commentedon Feb 15, 2017
@WenKangLin I immediately fix these errors while I code so I didn't even notice that. There is a corresponding issue: ccbikai/stylelint-processor-html/issues/1
repsac-by commentedon Feb 23, 2017
try
@mapbox/stylelint-processor-arbitrary-tags
insteadstylelint-processor-html
jing2si commentedon May 25, 2017
Can not add single quotation marks in windows. Otherwise it will report the following error.
The following setting worked well in windows 10
gucong3000 commentedon Jul 28, 2017
stylelint-webpack-plugin
orstylelint-processor-html
not support automatically fixes.Related:
#839
stylelint/stylelint#2596
8 remaining items
equinusocio commentedon Aug 9, 2018
Using the @yisibl solution i can't make it works using postcss.
gucong3000 commentedon Aug 13, 2018
@equinusocio The latest version of stylelint can directly support
*.vue
files, but you need to deleteprocessors
in the configuration file.If you need to use other postcss tool, not just stylelint, you can use this way:
equinusocio commentedon Aug 13, 2018
@gucong3000 Thank you man. This did the trick. There is a documentation somewhere about that?
gucong3000 commentedon Aug 14, 2018
Not at the moment.
hiendv commentedon Nov 20, 2018
@gucong3000 Hi, I cannot get stylelint autofix to work with .vue files? Any idea why?
gucong3000 commentedon Dec 4, 2018
@hiendv please update
stylelint
>= v9 then try this command:stylelint --fix `src/**/*.vue`
gucong3000 commentedon Dec 4, 2018
https://vue-loader.vuejs.org/guide/linting.html#stylelint
equinusocio commentedon Dec 19, 2018
@gucong3000 This solution doesn't works anymore
#303 (comment)
postcss.config.js
Defining the
syntax
package break all the plugins. Removing it stylelint will throw errors parsing the html template. I'm using latest versions of all.gucong3000 commentedon Dec 25, 2018
@equinusocio
Maybe you can upload a zip package that contains these errors so I could help you debug them.
stylelint
in the document? #839mudin commentedon Aug 3, 2019
After trying many things, I got stylelint autofix to work with .vue files in vscode using SaveOnRun extension.
added below config in the
settting.json
:Better solution would be appreciated!
humoyun commentedon Aug 6, 2019
@mudin good job, saved the day
VictorPulzz commentedon Jan 25, 2022
Hey guys, can you help me?
I setup stylelint, and try fix my files use this command:
"lint:style": "stylelint --fix **/*.{vue,css,scss,sass}"
I got this message:
Autofix is incompatible with processors and will be disabled. Are you sure you need a processor?
my config: