Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom configs and merge rules not working #309

Closed
DanPurdy opened this issue Oct 16, 2015 · 0 comments
Closed

Custom configs and merge rules not working #309

DanPurdy opened this issue Oct 16, 2015 · 0 comments
Labels

Comments

@DanPurdy
Copy link
Member

Currently custom sass-lint configurations will be ignored when a custom configuration has merge-default-rules set to false. The only way to actually override the defaults is to set merge to true and provide every rule with a 0.

This was brought to light here DanPurdy/linter-sass-lint#9

I'm guessing the reason we haven't picked up on it for so long is that our config file matches the default config file or was set to merge and contained every rule we didn't want to use zeroed out.

To try this out use the config @mik01aj posted

options:
    merge-default-rules: true 

files:
    include: 'mockups/**/*.scss'
    ignore:
          - 'app/styles/legacy/**/*.*'
          - 'mockups/**/vendor/**/*'

rules:
    # ignoring EVERYTHING
    border-zero: 0
    brace-style: 0
    clean-import-paths: 0
    empty-args: 0
    empty-line-between-blocks: 0
    extends-before-declarations: 0
    extends-before-mixins: 0
    final-newline: 0
    force-attribute-nesting: 0
    force-element-nesting: 0
    force-pseudo-nesting: 0
    function-name-format: 0
    hex-length: 0
    hex-notation: 0
    indentation: 0
    leading-zero: 0
    mixin-name-format: 0
    mixins-before-declarations: 0
    nesting-depth: 0
    no-color-keywords: 0
    no-color-literals: 0
    no-css-comments: 0
    no-debug: 0
    no-duplicate-properties: 0
    no-empty-rulesets: 0
    no-extends: 0
    no-ids: 0
    no-important: 0
    no-invalid-hex: 0
    no-mergeable-selectors: 0
    no-misspelled-properties: 0
    no-qualifying-elements: 0
    no-trailing-zero: 0
    no-transition-all: 0
    no-url-protocols: 0
    no-vendor-prefixes: 0
    no-warn: 0
    one-declaration-per-line: 0
    placeholder-in-extend: 0
    placeholder-name-format: 0
    property-sort-order: 0
    quotes: 0
    shorthand-values: 0
    single-line-per-selector: 0
    space-after-bang: 0
    space-after-colon: 0
    space-after-comma: 0
    space-before-bang: 0
    space-before-brace: 0
    space-before-colon: 0
    space-between-parens: 0
    trailing-semicolon: 0
    url-quotes: 0
    variable-for-property: 0
    variable-name-format: 0
    zero-unit: 0

then try this

options:
    merge-default-rules: false 

files:
    include: 'mockups/**/*.scss'
    ignore:
        - 'app/styles/legacy/**/*.*'
        - 'mockups/**/vendor/**/*'

rules:
    no-color-keywords: 0

on this file

a {
  color: red;
}

.test .test {
  color: red;
}

.test {
  color: blue;
}

Looks like an error in checking for configMerge here https://github.com/sasstools/sass-lint/blob/develop/lib/config.js#L77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant