module.exports = {
  extends: ['stylelint-config-standard-scss', 'stylelint-prettier/recommended'],
  plugins: ['stylelint-prettier'],
  rules: {
    // Prettier
    'prettier/prettier': true,

    // SCSS правила
    'scss/at-rule-no-unknown': null,
    'scss/at-import-partial-extension': null,
    'scss/dollar-variable-pattern': '^[a-z][a-zA-Z0-9]*$',
    'scss/percent-placeholder-pattern': '^[a-z][a-zA-Z0-9]*$',

    // Общие правила
    'color-hex-case': 'lower',
    'color-hex-length': 'short',
    'declaration-block-trailing-semicolon': 'always',
    indentation: 2,
    'max-empty-lines': 2,
    'no-duplicate-selectors': true,
    'no-empty-source': null,

    // Селекторы
    'selector-class-pattern':
      '^[a-z]([a-z0-9-]+)?(__([a-z0-9]+-?)+)?(--([a-z0-9]+-?)+){0,2}$',
    'selector-max-id': 0,
    'selector-max-compound-selectors': 4,

    // Свойства
    'property-no-unknown': true,
    'declaration-no-important': true,

    // Единицы измерения
    'unit-allowed-list': [
      'px',
      'em',
      'rem',
      '%',
      'vh',
      'vw',
      'vmin',
      'vmax',
      'deg',
      's',
      'ms'
    ],

    // Функции
    'function-url-quotes': 'always'
  },
  ignoreFiles: ['dist/**/*', 'node_modules/**/*']
};
