
Product
Rust Support Now in Beta
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
@shopify/stylelint-plugin
Advanced tools
@shopify/stylelint-plugin
Shopify's stylelint rules and config
Install stylelint and @shopify/stylelint-plugin
:
With Yarn
yarn add --dev stylelint @shopify/stylelint-plugin
With npm
npm install stylelint @shopify/stylelint-plugin --save-dev
Shopify’s stylelint rules come bundled in @shopify/stylelint-plugin
. To enable these rules, add a stylelint
property in your package.json
. See the stylelint configuration docs for more details.
"stylelint": {
"extends": ["@shopify/stylelint-plugin"]
}
Now you can run stylelint by adding the following linting script to your package.json
. See the stylelint CLI docs for more details.
"scripts": {
"stylelint": "stylelint 'src/**/*.scss'"
}
Run it:
With Yarn
yarn run stylelint
With npm
npm run stylelint
This config also includes a prettier config which can be extended to format .scss
.
Using the stylelint-prettier
plugin, prettier changes are exposed as stylelint rule violations.
Install prettier
:
$ yarn add --dev prettier
Extend the config in your package.json
:
"stylelint": {
"extends": [
"@shopify/stylelint-plugin/prettier"
]
}
Add a prettier config in package.json
:
"prettier": {
"singleQuote": true,
"trailingComma": "es5",
"bracketSpacing": false
}
Prettier fixes shall be reported when you run stylelint **/*.css
and shall be autofixed when you run stylelint --fix **/*.scss
.
FAQs
Shopify's stylelint rules and config
The npm package @shopify/stylelint-plugin receives a total of 5,558 weekly downloads. As such, @shopify/stylelint-plugin popularity was classified as popular.
We found that @shopify/stylelint-plugin demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 8 open source maintainers collaborating on the project.
Did you know?
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.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.
Product
Socket Fix 2.0 brings targeted CVE remediation, smarter upgrade planning, and broader ecosystem support to help developers get to zero alerts.
Security News
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.