Questions tagged [stylelint]

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

Links

284 questions
2
votes
0 answers

Expected CSS spec value type for each property in JavaScript

Is there an npm package somewhere (or an open source JavaScript repo I can use) that maps CSS property names to their expected value data types? I'm looking for something like the following: import {getCssPropertyTypes} from…
derpedy-doo
  • 1,097
  • 1
  • 18
  • 22
2
votes
2 answers

running tailwind / postcss

I'm trying to install Tailwind to practice some basic stuff to learn how this framework works. I followed every step that Adam Wathan the creator of the framework provided and when it comes to running I face command line error: You must pass a valid…
Alaa El Saedy
  • 368
  • 3
  • 13
2
votes
1 answer

How to configure the stylelint extension in vscode?

I created a project using the create-react-app --template typescript. Now I wanted to try out the css linter stylelint. And, so I have installed the npm packages stylelint and stylelint-config-standard as dev dependency using yarn. I have also…
Nafiz Ahmed
  • 567
  • 3
  • 10
2
votes
1 answer

Stylelint output does not show the name of the file where warnings occur

When running stylelint the output of warnings does not show the name of the file where the error occurs (with errors it does work fine). My files look like this: app.scss @import './_file-with-error'; _file-with-error.scss html body { color:…
Michael Käfer
  • 1,597
  • 2
  • 19
  • 37
2
votes
2 answers

Integrate stylelint with angular build and make it failed on error?

I want to use stylelint in angular application to enforce class name for example (they should be in lowercase and dash if if necessary, not camel case or uppercase). How to configure stylelint to run in Angular build time (just like Angular run…
Jon Sud
  • 10,211
  • 17
  • 76
  • 174
2
votes
2 answers

cli: stylelint --help : command not found (mac)

I've been using stylelint-gulp for some time now without issue. I have stylelint loaded as a npm devDependancy(ie not global, as I dont want it to be global) in my project, and following the instructions I should have the CLI available as…
orionrush
  • 566
  • 6
  • 30
2
votes
1 answer

Error: `severity` property of a stylelint warning must be either 'error' or 'warning', but it was 'ignore' (string)

VSCode-Stylelint showing meaningless error: Error: severity property of a stylelint warning must be either 'error' or 'warning', but it was 'ignore' (string). at stylelintWarningToVscodeDiagnostic…
林东吴
  • 171
  • 1
  • 8
2
votes
0 answers

Linting only newly added files

I'm using lint-staged along with husky to run linters against all the staged files before commit. But my codebase is old; so don't want to run linters against existing (modified) files for now. Is there a way to run linters only against newly…
karthikaruna
  • 3,042
  • 7
  • 26
  • 37
2
votes
1 answer

Alternatives to Webpack styelint-webpack-plugin? Looking for a maintained project

I'm looking to install Webpack4 for a project. Part of what I want it to do is lint css. Just about every resource I find points to "stylelint-webpack-plugin" (https://github.com/JaKXz/stylelint-webpack-plugin). That project's not been getting…
BarryLon
  • 21
  • 2
2
votes
1 answer

How do I uninstall a folder of node modules that's been installed in the wrong directory (Mac)?

I have accidentally installed 409 node modules in a project directory, while trying to install the 'stylelint' module. I'm unfamiliar with this and thought it was going into a 'global' place (wherever that is) but instead it's installed it and 408…
user231207
  • 33
  • 3
2
votes
1 answer

Stylelint multiline comments rule

Today we use style validation with the sass-lint module, but we're migrating to stylelint. One of the validations that sass-lint does in our projects is not allowing multi-line comments but allow one-line comments. I need to know if there is any…
2
votes
1 answer

How to specify messages for single rules within a declaration

I am trying to adjust my property-blacklist in stylelint and want to provide a message to each property that is blacklisted, like I did below with the top-property. "property-blacklist": [ "top", { "message": "Use translateY instead." …
Dominik Spiertz
  • 156
  • 2
  • 6
2
votes
2 answers

How to generate a checkstyle.xml for Jenkins with stylelint?

I wonder how to generate a checkstyle.xml for Jenkins with stylelint. Searched around the web and sadly found just stylelint-checkstyle-formatter, but only the following "instruction": Simply read the stylelint documentation about using formatters…
roNn23
  • 1,532
  • 1
  • 15
  • 32
2
votes
1 answer

Issues running stylelint from CLI

I'm trying to run stylelint plugin in one of my projects ( ) I don't wanna use gulp but just an npm script (I'm currently doing that with esLint) but I'm getting a "cannot find module" error everytime I run the script. This is the error: > stylelint…
DJ22T
  • 1,628
  • 3
  • 34
  • 66
2
votes
1 answer

How to keep this CSS code DRY along with satisfying no-descending-specificity

Here's my CSS block: :global { table, .table { border-collapse: collapse; border-spacing: 0; width: 100%; font-size: 0.8em; font-family: var(--font-family-roboto); font-weight: normal; letter-spacing: .25px; …
Mrchief
  • 75,126
  • 20
  • 142
  • 189