Questions tagged [stylelint]

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

Links

284 questions
5
votes
2 answers

stylelint ignore rule for specific folder/file

I looked at stylelint's docs and only saw a way to disable stylelint for running on for specific files/directories but what I really want is a way to disable specific rules) for specific files/directories. Is there a way to achieve that? I don't…
Yangshun Tay
  • 49,270
  • 33
  • 114
  • 141
5
votes
1 answer

Can't get VS Code Stylelint extension to lint in .ts files

I'm setting up a React project with TypeScript and Styled Components from scratch. I've already done this before and in the previous project the VS Code Stylelint extension worked great. However, in my new project I can't get it to work in .ts or…
5
votes
1 answer

Lint multiple directories with stylelint

I'm trying to lint more than one directory at once with stylelint. In my package.json file I have: "scripts": { "lint": "stylelint 'pages/**/*.scss', 'global/components/**/*.scss' ; exit 0" }, If I remove either 'pages/**/*.scss' or…
Eli Nathan
  • 1,020
  • 2
  • 13
  • 35
5
votes
2 answers

Disable VS Code Stylelint errors in React JavaScript files

[stylelint] Unexpected missing end-of-source newline (no-missing-end-of-source-newline) [stylelint] Expected "backgroundColor" to be "backgroundcolor" (value-keyword-case) [stylelint] Expected a trailing semicolon…
jjenzz
  • 1,519
  • 1
  • 14
  • 19
5
votes
0 answers

Sass-lint vs Style-lint?

Which one would you recommend, Sass-lint or Style-lint? Why? (They seem to be very similar to me)
ivanasetiawan
  • 879
  • 1
  • 10
  • 26
5
votes
1 answer

Can i use my own plugin or extend in stylelint engine with CodeClimate

In my stylelintrc.js module.exports = { "extends": [ "stylelint-config-standard", "stylelint-config-css-modules", ], "plugins": [ "stylelint-performance-animation", ], ... In codeclimat.yaml i turn on stylelint engine and take…
Konstantin
  • 73
  • 6
5
votes
1 answer

I want to automatically fix my CSS source files, but I get an endless loop

I use gulp-stylefmt and it run every time I save any CSS file: function stylelint () { return gulp.src('src/**/*.css') .pipe($.stylefmt()) .pipe(gulp.dest('src/')); } Same time gulp.watch watches the path src/**/*.css and run stylelint…
dmin
  • 434
  • 4
  • 15
5
votes
1 answer

How to use stylelint with Grunt?

I'm trying to replace grunt-scss-lint (because of its Ruby dependency and silent failure when you don't have the gem installed) with stylelint. The problem I'm running into is the following error: $ grunt …
Trey Piepmeier
  • 1,006
  • 2
  • 13
  • 21
4
votes
1 answer

Stylelint error in Nuxt (class based): Unexpected empty source (no-empty-source)

I get this Stylelint error suddenly in two of my components, I don't know why. Unexpected empty source (no-empty-source) I created a third component and removed content to the point where there is no content left, and the error still shows for that…
Galivan
  • 4,842
  • 9
  • 44
  • 76
4
votes
0 answers

Make links in stylelint report in bash output clickable

I am using stylelint and eslint and I just mentioned that it is possible to click on a line in eslint to directly open the file in my IDE and jump to that selected line. I was wondering if it is possible to add a similar feature to stylelint since…
Thomas Kekeisen
  • 4,355
  • 4
  • 35
  • 54
4
votes
1 answer

Stylelint disable rule, "no-descending-specificity" null does not work

Not able to disable the styelint rule "no-descending-specificity" by assigning null value within the stylelintric.json file "rules": { "no-descending-specificity": null } Instead I had to write the below line to the top of my scss file /*…
techloris_109
  • 547
  • 5
  • 13
4
votes
2 answers

Format SCSS/CSS/LESS with Prettier with rules of Stylelint

Right now, I'm trying to format my SCSS code with Prettier, with the rules of Stylelint. I'm having a hard time getting these two to line up. For example, I keep getting declaration-colon-new-line error with stylelint (which is correct) for the…
drewkiimon
  • 591
  • 1
  • 9
  • 16
4
votes
1 answer

how to respect css no-descending-specificity

I have the following code : radio.component
Bobby
  • 4,372
  • 8
  • 47
  • 103
4
votes
1 answer

Rule for obsolete CSS properties?

I'm looking for a Stylelint (and/or ESLint) plugin/rule that has a rule for avoiding the usage of obsolete CSS properties like grid-row-gap. I'd like to believe someone already made this, but I couldn't find anything like it via Google, GitHub, or…
bengr
  • 316
  • 3
  • 8
4
votes
0 answers

Why is SCSS complaining when I use `list.nth` when `stylelint-scss` is telling me to?

I have a bit of a situation here. I'm using SCSS in a React app using sass-loader and I lint my SCSS/CSS using stylelint and the extension for it stylelint-scss. I borrowed some code from here:…
OmriSama
  • 302
  • 5
  • 11
1 2
3
18 19