diff --git a/.sass-lint.yml b/.sass-lint.yml new file mode 100644 index 000000000..05642086a --- /dev/null +++ b/.sass-lint.yml @@ -0,0 +1,154 @@ +# sass-lint config generated by make-sass-lint-config v0.1.2 +# +# The following scss-lint Linters are not yet supported by sass-lint: +# ChainedClasses, DisableLinterReason, ElsePlacement, PropertyCount +# PseudoElement, SelectorDepth, SpaceAroundOperator, TrailingWhitespace +# UnnecessaryParentReference, Compass::* +# +# The following settings/values are unsupported by sass-lint: +# Linter HexLength, option "enaled" +# Linter Indentation, option "allow_non_nested_indentation" +# Linter Indentation, option "character" +# Linter SpaceBeforeBrace, option "allow_single_line_padding" + +files: + include: '**/*.scss' +options: + formatter: stylish + merge-default-rules: false +rules: + bem-depth: + - 0 + - max-depth: 1 + border-zero: 0 + brace-style: 1 + class-name-format: + - 1 + - convention: hyphenatedbem + clean-import-paths: + - 1 + - filename-extension: false + leading-underscore: false + empty-line-between-blocks: + - 1 + - ignore-single-line-rulesets: true + extends-before-declarations: 1 + extends-before-mixins: 1 + final-newline: + - 1 + - include: true + force-attribute-nesting: 1 + force-element-nesting: 1 + force-pseudo-nesting: 1 + function-name-format: + - 0 + - convention: BEM + hex-length: + - 1 + - style: short + hex-notation: + - 1 + - style: lowercase + id-name-format: + - 1 + - convention: hyphenatedbem + indentation: + - 1 + - size: 2 + leading-zero: + - 1 + - include: false + mixin-name-format: + - 0 + - convention: BEM + mixins-before-declarations: 1 + nesting-depth: + - 1 + - max-depth: 4 + no-color-keywords: 1 + no-color-literals: 0 + no-css-comments: 0 + no-debug: 1 + no-duplicate-properties: 1 + no-empty-rulesets: 1 + no-extends: 0 + no-ids: 1 + no-important: 1 + no-invalid-hex: 1 + no-mergeable-selectors: 1 + no-misspelled-properties: 1 + no-qualifying-elements: + - 1 + - allow-element-with-attribute: false + allow-element-with-class: false + allow-element-with-id: false + no-trailing-zero: 1 + no-transition-all: 0 + no-url-protocols: 1 + no-vendor-prefixes: 0 + placeholder-in-extend: 1 + placeholder-name-format: + - 1 + - convention: hyphenatedbem + property-sort-order: 0 + property-units: + - 1 + - global: + - ch + - em + - ex + - rem + - cm + - in + - mm + - pc + - pt + - px + - q + - vh + - vw + - vmin + - vmax + - deg + - grad + - rad + - turn + - ms + - s + - Hz + - kHz + - dpi + - dpcm + - dppx + - '%' + quotes: + - 1 + - style: double + shorthand-values: 1 + single-line-per-selector: 1 + space-after-bang: + - 1 + - include: false + space-after-colon: + - 1 + - include: true + space-after-comma: + - 1 + - include: true + space-before-bang: + - 1 + - include: true + space-before-brace: + - 1 + - include: true + space-before-colon: 1 + space-between-parens: + - 1 + - include: false + trailing-semicolon: 1 + url-quotes: 1 + variable-for-property: 0 + variable-name-format: + - 0 + - convention: BEM + zero-unit: 1 diff --git a/.scss-lint.yml b/.scss-lint.yml deleted file mode 100644 index 895fe2c3f..000000000 --- a/.scss-lint.yml +++ /dev/null @@ -1,216 +0,0 @@ -# Documentation about rules https://github.com/causes/scss-lint/blob/master/lib/scss_lint/linter/README.md - -scss_files: "**/*.scss" - -linters: - BangFormat: - enabled: true - - BemDepth: - enabled: false - max_elements: 1 - - BorderZero: - enabled: false - - ChainedClasses: - enabled: false - - ColorKeyword: - enabled: true - - ColorVariable: - enabled: false - - Comment: - enabled: false - - DebugStatement: - enabled: true - - DeclarationOrder: - enabled: true - - DisableLinterReason: - enabled: false - - DuplicateProperty: - enabled: true - - ElsePlacement: - enabled: true - style: same_line - - EmptyLineBetweenBlocks: - enabled: true - ignore_single_line_blocks: true - - EmptyRule: - enabled: true - - ExtendDirective: - enabled: false - - FinalNewline: - enabled: true - present: true - - HexLength: - enaled: true - style: short - - HexNotation: - enabled: true - style: lowercase - - HexValidation: - enabled: true - - IdSelector: - enabled: true - - ImportantRule: - enabled: true - - ImportPath: - enabled: true - leading_underscore: false - filename_extension: false - - Indentation: - enabled: true - allow_non_nested_indentation: false - character: space # or 'tab' - width: 2 - - LeadingZero: - enabled: true - style: exclude_zero - - MergeableSelector: - enabled: true - force_nesting: true - - NameFormat: - enabled: false - convention: BEM - - NestingDepth: - enabled: true - max_depth: 4 - - PlaceholderInExtend: - enabled: true - - PropertyCount: - enabled: false - - PropertySortOrder: - enabled: false - - PropertySpelling: - enabled: true - - PropertyUnits: - enabled: true - global: [ - 'ch', 'em', 'ex', 'rem', # Font-relative lengths - 'cm', 'in', 'mm', 'pc', 'pt', 'px', 'q', # Absolute lengths - 'vh', 'vw', 'vmin', 'vmax', # Viewport-percentage lengths - 'deg', 'grad', 'rad', 'turn', # Angle - 'ms', 's', # Duration - 'Hz', 'kHz', # Frequency - 'dpi', 'dpcm', 'dppx', # Resolution - '%'] # Other - - PseudoElement: - enabled: true - - QualifyingElement: - enabled: true - allow_element_with_attribute: false - allow_element_with_class: false - allow_element_with_id: false - - SelectorDepth: - enabled: true - - SelectorFormat: - enalbed: true - convention: hyphenated_BEM - - Shorthand: - enabled: true - - SingleLinePerProperty: - enabled: true - - SingleLinePerSelector: - enabled: true - - SpaceAfterComma: - enabled: true - style: one_space - - SpaceAfterPropertyColon: - enabled: true - style: one_space - - SpaceAfterPropertyName: - enabled: true - - SpaceAfterVariableName: - enabled: true - - SpaceAroundOperator: - enabled: true - style: one_space - - SpaceBeforeBrace: - enabled: true - style: space - allow_single_line_padding: false - - SpaceBetweenParens: - enabled: true - spaces: 0 - - StringQuotes: - enabled: true - style: double_quotes # or single_quotes - - TrailingSemicolon: - enabled: true - - TrailingWhitespace: - enabled: true - - TrailingZero: - enabled: true - - TransitionAll: - enabled: false - - UnnecessaryMantissa: - enabled: true - - UnnecessaryParentReference: - enabled: true - - UrlFormat: - enabled: true - - UrlQuotes: - enabled: true - - VariableForProperty: - enabled: false - - VendorPrefix: - enabled: false - - ZeroUnit: - enabled: true - - Compass::*: - enabled: false diff --git a/.travis.yml b/.travis.yml index f9096322e..2eeddbc0d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,9 +11,7 @@ addons: packages: - g++-4.8 before_install: - - rvm install 2.3.1 - npm install -g grunt-cli - - gem update --system && gem install scss_lint -v 0.50.2 - export DISPLAY=:99.0 - sh -e /etc/init.d/xvfb start script: diff --git a/gruntfile.js b/gruntfile.js index 262269ca1..2438b9fb5 100644 --- a/gruntfile.js +++ b/gruntfile.js @@ -67,10 +67,10 @@ module.exports = function (grunt) { } }, - scsslint: { + sasslint: { files: ['src/stylesheets/*.scss', 'docs-site/src/*.scss'], options: { - config: '.scss-lint.yml', + config: '.sass-lint.yml', colorizeOutput: true, exclude: ['docs-site/src/higlight.scss', 'docs-site/src/reset.scss'] } @@ -133,15 +133,15 @@ module.exports = function (grunt) { } }) - grunt.loadNpmTasks('grunt-contrib-sass') - grunt.loadNpmTasks('grunt-scss-lint') + grunt.loadNpmTasks('grunt-sass') + grunt.loadNpmTasks('grunt-sass-lint') grunt.loadNpmTasks('grunt-contrib-watch') grunt.loadNpmTasks('grunt-babel') grunt.loadNpmTasks('grunt-webpack') grunt.loadNpmTasks('grunt-karma') grunt.loadNpmTasks('grunt-eslint') - grunt.registerTask('default', ['watch', 'scsslint']) - grunt.registerTask('travis', ['eslint', 'karma', 'scsslint']) - grunt.registerTask('build', ['scsslint', 'babel', 'webpack', 'sass']) + grunt.registerTask('default', ['watch', 'sasslint']) + grunt.registerTask('travis', ['eslint', 'karma', 'sasslint']) + grunt.registerTask('build', ['sasslint', 'babel', 'webpack', 'sass']) } diff --git a/package.json b/package.json index 7196b1d85..b322d331b 100644 --- a/package.json +++ b/package.json @@ -49,11 +49,11 @@ "grunt": "1.0.1", "grunt-babel": "^6.0.0", "grunt-cli": "^1.2.0", - "grunt-contrib-sass": "1.0.0", + "grunt-sass": "2.0.0", "grunt-contrib-watch": "1.0.0", "grunt-eslint": "^19.0.0", "grunt-karma": "^2.0.0", - "grunt-scss-lint": "^0.5.0", + "grunt-sass-lint": "^0.2.2", "grunt-webpack": "^1.0.11", "highlight.js": "^9.0.0", "isparta-loader": "^2.0.0",