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

stylelint rule not working for the function URL

Am trying to add the rule for the background-image URL should start with images background-image: url(ssasimages/dummy.svg); Please find below the screenshot FYR. It's not giving error, please someone help me to find what did wrong.
tamilmani
  • 591
  • 6
  • 13
0
votes
1 answer

SugarSS throwing unecessary `CssSyntaxError`

I have defined a mixin for adding styles to an element. This compiles perfectly but is throwing an error when I run stylelint over it. My stylelint configuration is as follows: { "plugins": [ "stylelint-scss" ], "extends":…
AMAN SHARMA
  • 331
  • 3
  • 10
0
votes
0 answers

How to prevent "sourceMappingURL" removal when using Stylelint

I customize Bootstrap 4 with node-sass and autoprefixer My next step is to use Stylelint to set properly indentation My .stylelintrc.json file: { "rules": { "indentation": 2 } } The problem is that Stylelint deletes the last line in the…
kanlukasz
  • 1,103
  • 19
  • 34
0
votes
1 answer

How can i fix the css stylelint errors caused by sass / scss?

I am using Sass(scss) as the css pre-processor for my project. But when i run stylelint for the .css files compiled by sass, it returns very many errors which you cant fix directly in the .css files because these files are compiled by sass. Anything…
Phillip Musiime
  • 167
  • 2
  • 12
0
votes
1 answer

How to set a global/default font-family without universal selectors?

I am in a conundrum: the stylelint rule "selector-max-universal": 0 is required and, at the same time, I need to provide a default font family to text elements within a certain class. Therefore I am not able to use this: * { font-family: Somefont;…
CPHPython
  • 12,379
  • 5
  • 59
  • 71
0
votes
1 answer

How to show error console log for stylelint Node API?

When using the stylelint on the CLI like stylelint "**/_main.scss" and there's an error in the file, it errors out and logs something like However when using the Node API for it, the log is just an output with some key values with the error as a…
joshua1991
  • 119
  • 2
  • 10
0
votes
0 answers

BEM Post CSS Stylelint plugin cannot ignore "*:last-child" selector

I have an Angular project in which BEM CSS methodology is being used. I have stylelint set up to lint my CSS. I also have incorporated the stylelint-selector-bem-pattern plugin to lint my selectors to ensure they adhere to a custom BEM pattern. Note…
shrewdbeans
  • 11,971
  • 23
  • 69
  • 115
0
votes
3 answers

Exclude imported vendor files from linting with stylelint

I want to properly exclude imported vendor files from linting with stylelint. I have this app.scss: @import '~bootstrap'; @import '~bootstrap-vue'; body { background: gray; } and this .stylelintrc.json: { "extends":…
Michael Käfer
  • 1,597
  • 2
  • 19
  • 37
0
votes
1 answer

Stylelint: background-size after background-position in background shortcut rule

According to MDN: The value may only be included immediately after , separated with the '/' character, like this: "center/80%". Is there any way to check this rule?
Vail
  • 3
  • 2
0
votes
1 answer

Integration of prettier with Intellij Idea and NPM

What I wanna achieve Intellij - show error via red underline Validate formating via NPM Autoformating via save Override printWidth to 140 Integrate with stylelint and tslint and file watcher What I have done stylelint.config.js const regex = { …
Oskar Woźniak
  • 715
  • 2
  • 10
  • 25
0
votes
1 answer

map.get($foo, bar) is flagged with "semi-colon expectedscss(css-semicolonexpected)"

I am getting linting error when trying to use SCSS maps, specifically map.get(). I am currently using the "stylelint" extension for Visual Studio Code in combination with Create React App build environment. map.get($foo, bar); stylint is returning…
0
votes
1 answer

custom formatting rule for css modules

i'm try to find some tools which can help me with some code formatting issues. I'm try to split css rulesets at logically blocks, but actually, i'am can't find any tooling for this, i'm check tools like prettier, stylefmt, http://csscomb.com and…
0
votes
1 answer

Stylelint - new line before first nested block

How can I use the stylelint 'rule-empty-line-before' to generate a new line for only the first nested block: Example: a { margin: 0; padding: 0; b { margin: 0; } c { margin: 0; } } The following adds new lines…
Alex
  • 2,651
  • 2
  • 25
  • 45
0
votes
1 answer

How to ignore the stylelint errors when run webpack-dev-server

I have trouble when I run webpack-dev-server along with stylelint-webpack-plugin, but webpack-dev-server has crashed with even only the stylelint errors My webpack-dev-server version : 3.2.1 My webpack.config.js file : /* eslint-disable max-len…
LocV's Nest
  • 118
  • 1
  • 7
0
votes
1 answer

How to check the maximum number of selectors in stylelint?

I need to check that there is one root class in one file. Is it possible? // Error .a { } .b { } Expected // Success .a {}