matype / stylefmt

stylefmt is a tool that automatically formats stylesheets.
Other
2.1k stars 89 forks source link

Remove comments at the end of selector #217

Open emri99 opened 7 years ago

emri99 commented 7 years ago

Hi,

Just found that comments are removed when they are placed at the end of a css rule:

.content {
    // this comment remains
    margin-left: 20px
    // this comment line and next ones are removed   <===
    // other comment line                            <===
}

This happens only when there is no other rules (nested or not) after.

Rules used

var rulesOrder = require('./build/css-rules-order')[0];

module.exports = {
  extends: [
    'stylelint-config-suitcss'
  ],
  plugins: [
    'stylelint-scss'
  ],
  rules: {
    'at-rule-empty-line-before': null, 
    'at-rule-name-space-after': 'always',
    'function-max-empty-lines': null,
    'declaration-block-properties-order': rulesOrder,
    indentation: 4,
    'rule-nested-empty-line-before': ['always', { except: ['first-nested'], ignore: ['after-comment']}],
    'rule-non-nested-empty-line-before': ['always', {except: ['after-single-line-comment'], ignore: ['after-comment']}]
  }
};

Packages versions

├─┬ stylefmt@4.3.1
│ ├─┬ cosmiconfig@1.1.0
│ │ ├── minimist@1.2.0
│ │ ├─┬ parse-json@2.2.0
│ │ │ └─┬ error-ex@1.3.0
│ │ │   └── is-arrayish@0.2.1
│ │ └── require-from-string@1.2.1
│ ├─┬ css-color-list@0.0.1
│ │ └── css-color-names@0.0.1
│ ├─┬ editorconfig@0.13.2
│ │ ├── lru-cache@3.2.0
│ │ └── sigmund@1.0.1
│ ├── minimist@1.2.0
│ ├── postcss-scss@0.1.9
│ ├─┬ recursive-readdir@2.1.0
│ │ └── minimatch@3.0.2
│ ├── resolve-from@2.0.0
│ ├── stdin@0.0.1
│ └── tmp@0.0.28