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

How to use globally installed stylelint plugins with stylelint cli?

How can I use globally installed Stylelint plugins in Stylelint CLI? Can I set the configBasedir option as the node_modules/ path of those plugins?
Sivanatarajan
  • 86
  • 1
  • 10
0
votes
1 answer

Lint styles into Pug files

I want to lint CSS into Pug style. tag raw content (CSS) and style attribute content (CSS). Looks like Stylelint is a right tool to do this. Stylelint can lint CSS strings and code blocks in html files, working as expected. But if I try to do the…
0
votes
0 answers

Why am I getting no-descending-specificity error?

Here's an example: .something { & > * { &:not(:first-child) { margin-right: 16px; } &:not(:last-child) { margin-left: 16px; } } &-element { & > * { /* Expected selector ".something-element > *" to come before…
K. Sedunov
  • 11
  • 5
0
votes
1 answer

stylelint with gulp-stylelint - error: TypeError: Cannot read property 'warnings' of undefined in node_modules/gulp-stylelint/dist/index.js:177

I have searched and am unable to find an answer to my issue. It is saying 'warnings'is undefined in the gulp-stylelint/index.js file - to clarify, I have not touched this file as it is a "3rd-party" file. I get the same error whether I run it from…
0
votes
1 answer

Enforcing line spacing style guide rules with Stylelint and Prettier

I am working on a project with a large team of developers predominantly with SCSS and markdown files. Due to everyone having their own coding styles we now have a project where different files have different code comment styles and line spacing…
James Howell
  • 1,392
  • 5
  • 24
  • 42
0
votes
1 answer

Is possible to blacklist the height property from img tag only

I want to blacklist the height property for all img selectors in the stylesheet, so the aspect ratio of the image is always respected, is it possible with stylelint?
0
votes
1 answer

Programmatic/dynamic way to get all rules

Is there any way to access all existing rules of stylelint in a programatic way? For example some jsons I can parse or a method I can invoke? For instance the method through which the documentation files are created, if they are made automatically?
0
votes
1 answer

Align values of css attributes with eslint or stylelint

.backend-layout { background-image: linear-gradient(to bottom, white, #ccc); display: grid; grid-template-columns: auto; grid-template-rows: 0 40px minmax(40vh, 100vh) 40px; height: 100vh; } is it possible to…
DmitrySemenov
  • 9,204
  • 15
  • 76
  • 121
0
votes
1 answer

How come I'm getting unexpected name or hex number error?

I'm wondering why I can't add background-color: red; property on my scss file: #my_container { background-color: red; # Added this line and #efefef doesn't work either Error print on Grunt: src/sass/app_2/_common/layout/layouts.scss:7:27 ✖ …
merry-go-round
  • 4,533
  • 10
  • 54
  • 102
0
votes
2 answers

stylelint breaks for font namespace?

I have a file called foo.scss with contents: .foo { font: { family: arial; weight: 600; } } Linting with stylelint 8.4.0 on the command line results in this output: foo.scss 2:5 ✖ Cannot parse selector …
AlexMA
  • 9,842
  • 7
  • 42
  • 64
0
votes
0 answers

How to solve this stylelint issue?

"C:\Program Files\nodejs\node.exe" "E:/INSTALL MISHA/stylelint/stylelint-master/bin/stylelint.js" -f json --stdin-filename "..\..\..\..\..\:/Computer science/Web Site/HTML CSS JQuery website codecademy/untitled/style.css" module.js:549 throw…
GroxTheProgrammer
  • 431
  • 1
  • 6
  • 12
0
votes
1 answer

Need help to complete installation of linter-stylelint for Atom

I am really sorry for this newbie question but I can't see how solve that... I installed linter-stylelint and tried to configure it like it's said there: https://atom.io/packages/linter-stylelint So: - I placed a stylelint.config.js file in my…
Monsieur Paul
  • 91
  • 1
  • 4
0
votes
1 answer

Is it an error or feature in the stylelint rule "unit-no-unknown"?

Stylelint shows an error for the key in the Sass map, because Linter suspects that the number should have some units. https://stylelint.io/user-guide/rules/unit-no-unknown/ $resolutions: ( 2x: 2dppx, 3x: 3dppx );
dmin
  • 434
  • 4
  • 15
0
votes
1 answer

get stylelint report by broken rule instead of filename

I have implemented STYLELINT in my project. But currently this shows error by file name. fileone.scss Line 10:5 expected this 'rule-xyz' Line 15:5 expected this 'rule-abc' Line 25:5 expected this 'rule-123' anotherfile.scss Line 12:5 expected this…
ankitd
  • 1,967
  • 3
  • 26
  • 44
0
votes
1 answer

Stylelint validate declarations in SCSS mixin

I have a mixin that looks like this: @mixin offset($fraction: 1) { @if type-of($fraction) != number or not unitless($fraction) { @include error("#{$fraction} is not a unitless number"); } margin-left: percentage($fraction); } I also have…
CaribouCode
  • 13,998
  • 28
  • 102
  • 174