stylelint-config-rational-order icon indicating copy to clipboard operation
stylelint-config-rational-order copied to clipboard

rule conflict with `stylelint-config-standard`

Open lovelope opened this issue 6 years ago • 2 comments
trafficstars

stylelint.config.js file like this:

module.exports = {
  extends: ['stylelint-config-standard', 'stylelint-prettier/recommended'],
  plugins: ['stylelint-order', 'stylelint-config-rational-order/plugin'],
  rules: {
    // `standard` conflict with `rational-order`
    'declaration-empty-line-before': [
      'never',
      {
        except: ['after-comment', 'after-declaration', 'first-nested'],
        ignore: [
          'after-comment',
          'after-declaration',
          'first-nested',
          'inside-single-line-block',
        ],
      },
    ],
    'order/properties-order': [],
    'plugin/rational-order': [
      true,
      {
        'border-in-box-model': false,
        'empty-line-between-groups': true,
      },
    ],
  },
};

When I using declaration-empty-line-before with empty-line-between-groups: true, one of the two rules not work.

So, If I only hope empty-line-between-groups: true rule works, how to configure it?

lovelope avatar Jul 20 '19 14:07 lovelope

I don't know if this is the correct/best way to do it, but it's at least a workaround. Here's a sample .stylelintrc which "fixes" the problem:

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-rational-order",
    "stylelint-config-css-modules"
  ],
  "rules": {
    "declaration-empty-line-before": null, //<----------------------------------
    "indentation": 4,
    "order/properties-order": [],
    "plugin/rational-order": [
      true,
      {
        "empty-line-between-groups": true
      }
    ]
  }
}

rfgamaral avatar Aug 09 '20 21:08 rfgamaral

I don't know if this is the correct/best way to do it, but it's at least a workaround. Here's a sample .stylelintrc which "fixes" the problem:

{
  "extends": [
    "stylelint-config-standard",
    "stylelint-config-rational-order",
    "stylelint-config-css-modules"
  ],
  "rules": {
    "declaration-empty-line-before": null, //<----------------------------------
    "indentation": 4,
    "order/properties-order": [],
    "plugin/rational-order": [
      true,
      {
        "empty-line-between-groups": true
      }
    ]
  }
}

Thank you, it's worked.

lovelope avatar Aug 13 '20 03:08 lovelope