New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@captive/stylelint-config

Package Overview
Dependencies
Maintainers
0
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@captive/stylelint-config

StyleLint configuration presets

3.1.0
latest
npm
Version published
Weekly downloads
168
-41.87%
Maintainers
0
Weekly downloads
 
Created
Source

Captive StyleLint configuration (@captive/stylelint-config)

NPM Version License

StyleLint configuration presets

Installation

npm install --save-dev @captive/stylelint-config stylelint

Update your package.json :

{
  ...
  "scripts": {
    ...
    "lint:style": "stylelint \"app/**/*.{css,scss}\"",
    "format:style": "stylelint \"app/**/*.{css,scss}\" --fix"
  },
  "stylelint": {
    "extends": [
      "@captive/stylelint-config"
    ]
  }
}

add stylelintignore file :

/public
/node_modules
/tmp
/log
/vendor

/www
**/*.bundle.scss
**/generateur/**/*.scss
**/vendor/**/*.scss
**/root/**/*.scss

/app/assets/builds
**/*.min.css

Usage

To check your style :

npm run lint:style

To autocorrect your style :

npm run format:style

Features :

  • CSS and SCSS validation

Common Errors

😩 My project has too many errors

Explanation

the configuration is very strict, it is normal to have many errors

Solution

Solution 1 : Auto-correct all errors

npm run format:style

Solution 2 : Ignore errors and progressively fix them

create .stylelint_todo.cjs for all non passing rules. It is advised to fix them later, rule by rule :

module.exports = {
  rules: {}
}

update your package.json :

{
  ...
  "stylelint": {
    "extends": [
      "@captive/stylelint-config",
+     "./.stylelint_todo.cjs"
    ]
  }
}

License

MIT © Julien Polo julien.polo@captive.fr

About Captive

captive

@captive/stylelint-config is maintained and funded by Captive. The names and logos for captive are trademarks of captive-studio.

We love open source software! See our other projects or hire us to design, develop, and grow your product.

Keywords

stylelint

FAQs

Package last updated on 06 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts