Stylelint Watch
See original GitHub issueBefore logging an issue:
Node version: v8.11.1
npm version: 5.6.0
Operating system: OSX 10.13.3
Command line used: Atom Terminal
I’m basically trying to incorporate Stylelint and Stylelint watch into my process. If I have errors it reports the lint errors and then fails.
src/styles/generic/_generic.scratch.scss 29:36 ✖ Unexpected named color “black” color-named
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! Alchemy@1.0.0 stylelint: stylelint "**/*.scss" --syntax scss
npm ERR! Exit status 2
npm ERR!
npm ERR! Failed at the Alchemy@1.0.0 stylelint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
If I have it on watch and there are no errors then it just returns me to the command line.
I appreciate that this may fall out of the scope of Slingshot, but I thought I would ask here to see if anyone else has a similar issue.
I have these packages installed:
“stylelint”: “9.2.0”, “stylelint-order”: “0.8.1”, “stylelint-scss”: “3.0.1”, “stylelint-webpack-plugin”: “0.10.4”,
These are my commands:
“stylelint”: “./node_modules/.bin/stylelint "**/*.scss" --syntax scss”, “stylelint:watch”: “npm run stylelint – --watch”
So when I run ‘npm run stylelint’ or ‘npm run stylelint:watch’ I get errors. It’s kind of doing its job but I’m trying to get it involved eventually with the single command that does the lot.
This is my plugin code: webpack.config.dev.js
new StyleLintPlugin({ configFile: ‘.stylelintrc’, failOnError: false, quiet: false, syntax: ‘scss’, }),
Issue Analytics
- State:
- Created 5 years ago
- Comments:5
Top GitHub Comments
I think the problem just went away,
Personally, I would recommend finding a way to incorporate this into an existing watching process, like
jest
orwebpack
. There is astylelint-webpack-plugin
.Additionally,
jest
is moving to be a bigger platform that can run other types of processes on watch. They have ajest-runner-stylelint
that should cover your needs.I recently added a new jest-runner to in this PR https://github.com/eventbrite/eventbrite-sdk-javascript/pull/19 and it was pretty smooth.
Update: After reviewing our lint, we are using eslint watch which takes in a webpack config. So webpack may be the right approach as it is closest to currently supported in react-slingshot.