2025-11-19 10:14:39 +03:00
|
|
|
|
/**
|
|
|
|
|
|
* Конфигурация Stylelint для проверки CSS/SCSS кода
|
|
|
|
|
|
*
|
|
|
|
|
|
* Stylelint - это линтер для стилей, который помогает избежать ошибок
|
|
|
|
|
|
* и поддерживать единообразный стиль написания CSS/SCSS.
|
|
|
|
|
|
*
|
|
|
|
|
|
* Используемые плагины:
|
|
|
|
|
|
* - stylelint-config-standard-scss: базовые правила для SCSS
|
|
|
|
|
|
* - stylelint-order: контроль порядка свойств и селекторов
|
|
|
|
|
|
* - stylelint-semantic-groups: семантическая группировка CSS свойств
|
|
|
|
|
|
*
|
|
|
|
|
|
* Основные правила:
|
|
|
|
|
|
* - selector-class-pattern: отключен (разрешены любые имена классов)
|
|
|
|
|
|
* - order/order: упорядочивание селекторов по семантике
|
|
|
|
|
|
* - order/properties-order: упорядочивание CSS свойств по группам
|
|
|
|
|
|
* - declaration-empty-line-before: отключен (не требуются пустые строки)
|
|
|
|
|
|
*
|
|
|
|
|
|
* @example
|
|
|
|
|
|
* // Запуск проверки:
|
|
|
|
|
|
* pnpm lint:styles
|
|
|
|
|
|
*
|
|
|
|
|
|
* // Правильный порядок свойств:
|
|
|
|
|
|
* .button {
|
|
|
|
|
|
* // Позиционирование
|
|
|
|
|
|
* position: relative;
|
|
|
|
|
|
* top: 0;
|
|
|
|
|
|
*
|
|
|
|
|
|
* // Блочная модель
|
|
|
|
|
|
* display: flex;
|
|
|
|
|
|
* width: 100px;
|
|
|
|
|
|
* padding: 10px;
|
|
|
|
|
|
*
|
|
|
|
|
|
* // Типографика
|
|
|
|
|
|
* font-size: 14px;
|
|
|
|
|
|
*
|
|
|
|
|
|
* // Визуальное оформление
|
|
|
|
|
|
* color: blue;
|
|
|
|
|
|
* background: white;
|
|
|
|
|
|
* }
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
const {
|
|
|
|
|
|
propertyOrdering,
|
|
|
|
|
|
selectorOrdering,
|
|
|
|
|
|
} = require('stylelint-semantic-groups')
|
|
|
|
|
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
|
|
extends: 'stylelint-config-standard-scss',
|
2025-11-24 12:21:04 +03:00
|
|
|
|
plugins: [
|
|
|
|
|
|
'stylelint-order',
|
|
|
|
|
|
'@stylistic/stylelint-plugin',
|
|
|
|
|
|
],
|
2025-11-19 10:14:39 +03:00
|
|
|
|
rules: {
|
2025-11-24 12:21:04 +03:00
|
|
|
|
'@stylistic/indentation': 2,
|
2025-11-19 10:14:39 +03:00
|
|
|
|
'selector-class-pattern': null,
|
|
|
|
|
|
'order/order': selectorOrdering,
|
|
|
|
|
|
'order/properties-order': propertyOrdering,
|
|
|
|
|
|
'declaration-empty-line-before': null,
|
2025-11-19 18:40:16 +03:00
|
|
|
|
'no-descending-specificity': null, // Отключаем из-за конфликта с order/order
|
2025-11-23 13:31:46 +03:00
|
|
|
|
'selector-pseudo-class-no-unknown': [
|
|
|
|
|
|
true,
|
|
|
|
|
|
{
|
|
|
|
|
|
ignorePseudoClasses: ['global'],
|
|
|
|
|
|
},
|
|
|
|
|
|
],
|
2025-11-19 10:14:39 +03:00
|
|
|
|
},
|
|
|
|
|
|
}
|