Files
gsap-carousel/stylelint.config.js

68 lines
2.2 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* Конфигурация 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',
plugins: [
'stylelint-order',
'@stylistic/stylelint-plugin',
],
rules: {
'@stylistic/indentation': 2,
'selector-class-pattern': null,
'order/order': selectorOrdering,
'order/properties-order': propertyOrdering,
'declaration-empty-line-before': null,
'no-descending-specificity': null, // Отключаем из-за конфликта с order/order
'selector-pseudo-class-no-unknown': [
true,
{
ignorePseudoClasses: ['global'],
},
],
},
}