Questions tagged [stylelint]

A modern CSS linter that helps you enforce consistent conventions and avoid errors in your stylesheets.

Links

284 questions
0
votes
1 answer

Regex for camel case BEM

I need a regex pattern to match camel case BEM classes following this structure: BlockName_elementName-modifierName I've created this regex to do the job: ([A-Z][a-z0-9]+)+(\_[a-z0-9]+[A-Z0-9]?[a-z0-9]*)?(\-[a-z0-9]+[A-Z0-9]?[a-z0-9]*)? Examples of…
CaribouCode
  • 13,998
  • 28
  • 102
  • 174
0
votes
1 answer

css stylelint rule to catch 'selector is expected' error

As part of my process I use stylelint to look for css errors before build and deploy for our site. However someone checked in the following which fails on the css parser / minifier but passed stylelint. .example-class , /*.example-class-two span*/…
Doug E Fresh
  • 820
  • 8
  • 22
0
votes
1 answer

Stylelint - Ensure class name prefix matches folder name

I am using the "selector-class-pattern" stylelint rule. The pattern I am using is to enforce the ECSS naming standard. The rule looks like this: "selector-class-pattern":…
tg'
  • 41
  • 4
0
votes
2 answers

updated Stylelint Undefined rule selector-no-id

Hi sorry if this is a dumb question, I'm not so familiar with webpack and packages. So I updated my Stylelint from 7.2.0 to 8.0.0 , but ever since I get this error when trying to run my project edit: I reverted my project to before the update but…
HoyHym Ho
  • 79
  • 1
  • 10
0
votes
1 answer

Expected a trailing semicolon (declaration-block-trailing-semicolon)

Trying to use nesting rules via postcss, but getting warnings below. What rules I need to add in stylelint file to fix these warnings? Here is the css: .count-sec { height: 520px; & p { color:#fff; margin: 0; …
FarazShuja
  • 2,287
  • 2
  • 23
  • 34
0
votes
1 answer

How to check css syntastic error with styleline?

To install styleline with npm. sudo npm install -g stylelint To install config file for stylelint. sudo npm install stylelint-config-standard --save-dev -g npm WARN stylelint-config-standard@16.0.0 requires a peer of stylelint@^7.8.0 but none was…
showkey
  • 482
  • 42
  • 140
  • 295
0
votes
1 answer

Disable stylelint warnings in certain cases

I'm trying to use autoprefixer in a project. And I'm setting indentation to 2 spaces and max line lenght to 80 characters. The thing is that these two settings seem to conflict with one another in several cases. Let's say i have: @mixin…
Rigil Kent
  • 75
  • 10
0
votes
1 answer

WebStorm 2016 + stylelint

I have installed WebStorm 2016. Today I've installed stylelint, but I cant make it work. I got error: "C:\Program Files\nodejs\node.exe" "T:/project/html/node_modules/stylelint/bin/stylelint.js" -f json Error: No configuration provided for…
Sam3000
  • 11
  • 2
0
votes
2 answers

Not able to set stylelint rule for Check this potential box model size issue

I am working on Angular2 application with webpack. I am using sonarqube for code quality metrics. I use VS Code as IDE. Below css gives me a warning on sonarqube "Check this potential box model size issue" which is correct. .popup-dock-button { …
Hardik Patel
  • 3,868
  • 1
  • 23
  • 37
0
votes
1 answer

stylelint + gulp doesn't work for subfolders

I use gulp 3.9.1 and stylelint 7.6.0 for SCSS linting. OS is Ubuntu. A related part of my gulp config looks like this: var postcss = require('gulp-postcss'); var stylelint = require('stylelint'); var postcssReporter =…
0
votes
1 answer

Setting up stylelint with Sublime Text 3

I'm trying to hook up https://github.com/kungfusheep/SublimeLinter-contrib-stylelint to sublime... I've used SublimeLinter with the eslint and csslint addons before and they've worked perfectly. After installing the stylelint everything seems to be…
Willy G
  • 1,172
  • 1
  • 12
  • 26
0
votes
1 answer

SCSS variables are rendered as browser hacks

I've configured stylelint to read SCSS and I keep getting browser hack warnings on SCSS items like $variables and !default. I loaded in the stylelint-scss plugin thinking this might fix it but it hasn't. I want the browser hacks rule to be enabled…
Brandon Parker
  • 762
  • 7
  • 18
0
votes
1 answer

Is it possible to show warning in stylelint if already used class being used again?

In stylelint or with any other tool is it possible if a developer is writing a class name in CSS file, for example, .somethingRed {} he gets a message that this class name has been already used if the similar class name has been used already in the…
Jitendra Vyas
  • 148,487
  • 229
  • 573
  • 852
0
votes
1 answer

transitioning routes with additional props on components with react router 4

In React Router 4, one can easily append additional props to a component being passed to by using render instead of component. ( ) } /> On the other…
Jerome Indefenzo
  • 967
  • 6
  • 25
0
votes
2 answers

Configuration of stylelint in Gruntfile

I'm trying to create a separate task called stylelint because for reasons I do not want it to be part of the postcss task. In the gruntfile I'm writing: stylelint: { options: {}, src: './assets/css/precss/**' } When I run grunt stylelint it…
1 2 3
18
19