question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Before 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:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
NickToyecommented, Jun 15, 2018

I think the problem just went away,

1reaction
kwelchcommented, Apr 19, 2018

Personally, I would recommend finding a way to incorporate this into an existing watching process, like jest or webpack. There is a stylelint-webpack-plugin.

Additionally, jest is moving to be a bigger platform that can run other types of processes on watch. They have a jest-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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Options - Stylelint
Automatically fix, where possible, problems reported by rules. For CSS with standard syntax, Stylelint uses postcss-safe-parser to fix syntax errors. When using ...
Read more >
Feature request: --watch mode · Issue #2585 · stylelint/ ...
I don't see a need for watch mode in the stylelint core because most users already have it when using their build tools...
Read more >
Stylelint Tutorial - YouTube
0:00 · New! Watch ads now so you can enjoy fewer interruptions. Got it ...
Read more >
StylelintWebpackPlugin | webpack
This plugin uses stylelint that helps you avoid errors and enforce conventions in your styles. Getting Started. To begin, you'll need to install...
Read more >
@yutahaga/stylelint-watch-autofix - npm
stylelint -watch-autofix. ファイルを監視して変更があったら自動で Stylelint で行う CLI です。 Install. npm i @yutahaga/stylelint-watch-autofix ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found