exadel-inc/esl

View on GitHub
.stylelintrc.yml

Summary

Maintainability
Test Coverage
plugins:
  - stylelint-prettier
  # Custom plugin to disallow absolute import paths
  - ./build/import.stylelint.js
# Use LESS preprocessor
customSyntax: postcss-less

rules:
  # Prettier integration
  prettier/prettier:
    - true
    - severity: warning

  # Disallow unknown at-rules
  at-rule-no-unknown: true
  # Warn about empty selectors
  block-no-empty:
    - true
    - severity: warning
  # Disallow invalid hex colors
  color-hex-length: short
  # Disallow invalid hex colors
  color-no-invalid-hex: true
  # Disallow empty comments
  comment-no-empty: true
  # Disallow duplicate properties within declaration blocks
  declaration-block-no-duplicate-properties: true
  # Disallow absolute paths for imports in bounds of library files
  esl-less/import-root: never
  # Disallow duplicated font family reverencing
  font-family-no-duplicate-names: true
  # Disallow missing font family keyword
  font-family-no-missing-generic-family-keyword: true
  # Disallow an unspaced operator within `calc` functions
  function-calc-no-unspaced-operator: true
  # Disallow direction values in `linear-gradient()` calls that are not valid according to the standard syntax
  function-linear-gradient-no-nonstandard-direction: true
  # Disallow !important within keyframe declarations
  keyframe-declaration-no-important: true
  # Disallow duplicated at-rules
  no-duplicate-at-import-rules: true
  # Warn if empty sources
  no-empty-source:
    - true
    - severity: warning
  # Disallow double-slash comments `(//...)` for clear CSS, as they are not supported by CSS
  # and could lead to unexpected results
  no-invalid-double-slash-comments: true
  # Disallow unknown properties
  property-no-unknown: true
  # Use double colon notation for applicable pseudo-elements
  selector-pseudo-element-colon-notation: double
  # Disallow unknown pseudo-class selectors
  selector-pseudo-class-no-unknown: true
  # Disallow unknown pseudo-element selectors
  selector-pseudo-element-no-unknown:
   - true
   - ignorePseudoElements:
       - /^-webkit-/
       - /^-moz-/
  # Disallow unknown type selectors
  selector-type-no-unknown:
    - true
    - ignore:
        - custom-elements
  # Warn about newlines (unescaped) in strings
  string-no-newline:
    - true
    - severity: warning
  # Disallow unknown units
  unit-no-unknown: true


overrides:
  # Demo site pages sources
  - files: site/**/*.{css,less}
    rules:
      # Warn about duplicate properties within declaration blocks
      declaration-block-no-duplicate-properties:
        - true
        - severity: warning
      # No import restrictions
      esl-less/import-root: off