We are running static analysis tests on two points:
On Git pre-commit hook, and in that case we are using phpcs, phpmd, stylelint and eslint engines (vanilla installations + Drupal Coder for Drupal standards addition)
Once in a week we are updating…
I'm using stylelint and I need a regex expression for it's max-nesting-depth rule to ignore selectors which begin with both &: and @media
https://stylelint.io/user-guide/rules/max-nesting-depth/
So far I've tried the below without…
Hi want to ignore certain files for a specific rule in style lint config js like below
'color-named': [
'never', {
'ignore': [ 'library/styles/**/*.css', 'components/**/styles/variable.css' ]
}
],
However this is not…
I have gone to the stylelint website, github and downloaded locally via npm. The stylelint website advises that to create my own plugin I should use this format:
var myPluginRule = stylelint.createPlugin(ruleName, function(primaryOption,…
I'd like to warn/error when using max-width in media queries and encourage a mobile-first approach with min-width.
Can I warn/error on...
@media (max-width: 50em) {
padding: 1rem;
}
But allow...
@media (min-width: 50em) {
padding: 1rem;
}
Given the following in package.json:
"stylelint": {
"extends": "stylelint-config-standard",
"rules": {
"string-quotes": "single",
"block-no-empty": false,
"indentation": 2
}
}
I'm having trouble figuring out how to…
I've setup a little repo with my own CSS code style.
In this repo I've setup a minimal stylelint config just to check I haven't error about unknow rules, no more supported rules, etc.
When I run my $ npm check locally, it run just fine.
But…
I'm running stylelint on my files and this is the last error I'm left with:
1:1 ✖ Unknown rule function-calc-no-invalid function-calc-no-invalid
The first line:
@import url('https://fonts.googleapis.com/css?family=Poppins:400,700,900');
I need…
I am using styled-components, prettier and stylelint. Here is my .stylelintrc.json:
{
"extends": [
"stylelint-config-standard",
"stylelint-prettier",
"stylelint-config-prettier",
"stylelint-config-rational-order"
],
"plugins":…
Aiming to avoid unnecessary code reviews. So I have a case when someone added rules without reusing the previous selector:
.games-lib-table {
// ...
&__info {
// ...
}
}
// later in the file someone added
.games-lib-table__info_filters…
I'm trying to configure my .stylelintrc.json to work where there is always an empty line between selectors except for the first nested selector.
Example
This is what I have after linting with --fix
.class {
.is-active {
…
In the stylelint config file, I have added the ignoreFiles array. but on pre-commit it's throwing the error from ignored file path.
here is my stylelint.config.cjs:
/*eslint-env node*/
module.exports = {
extends: [
…
This small SCSS block
a {
color: red;
&:hover {
color: green;
}
}
i {
a {
text-decoration: none;
}
}
Gives this error
Expected selector "i a" to come before selector "a:hover" no-descending-specificity
But if I reverse the…