@front-cmdt/format 1.2.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md ADDED
@@ -0,0 +1,23 @@
1
+ # Changelog
2
+
3
+ Все значимые изменения этого проекта будут задокументированы в этом файле.
4
+
5
+ ## [1.3.1] - 2026-02-09
6
+
7
+ ### Добавлено
8
+
9
+ - Общая конфигурация Stylelint с поддержкой SCSS, включая порядок CSS-свойств и базовые правила
10
+ - Поддержка форматирования файлов `.astro` через `prettier-plugin-astro`
11
+
12
+ ## [1.2.2] - 2026-01-30
13
+
14
+ ### Добавлено
15
+
16
+ - Автоматическая сортировка Tailwind CSS классов через `prettier-plugin-tailwindcss`
17
+
18
+ ---
19
+
20
+ ## [1.2.1] и ранее
21
+
22
+ - Сортировка импортов через `@trivago/prettier-plugin-sort-imports`
23
+ - Базовая конфигурация Prettier для проектов
package/README.md CHANGED
@@ -1,79 +1,171 @@
1
1
  # @front-cmdt/format
2
2
 
3
- Общий **Prettier config** для проектов. Включает сортировку импортов через `@trivago/prettier-plugin-sort-imports`.
4
-
5
- ## Требования
6
-
7
- - `prettier` (peer dependency): `^3.0.0`
8
-
9
3
  ## Установка
10
4
 
11
5
  ```bash
12
- npm i -D @front-cmdt/format prettier
6
+ npm i -D @front-cmdt/format
13
7
  # или
14
- yarn add -D @front-cmdt/format prettier
8
+ yarn add -D @front-cmdt/format
15
9
  # или
16
- pnpm add -D @front-cmdt/format prettier
10
+ pnpm add -D @front-cmdt/format
17
11
  ```
18
12
 
19
- ### Создайте: `prettier.config.js` в проекте
13
+ ## Prettier
14
+
15
+ Общий **Prettier config** для проектов. Включает:
16
+
17
+ - Сортировку импортов через `@trivago/prettier-plugin-sort-imports`
18
+ - Автоматическую сортировку Tailwind CSS классов через `prettier-plugin-tailwindcss`
19
+ - Поддержку форматирования файлов `.astro` через `prettier-plugin-astro`
20
+
21
+ ### Создайте: `prettier.config.mjs` в проекте
20
22
 
21
23
  ```js
22
- import config from "@front-cmdt/format/prettier"
24
+ import config from '@front-cmdt/format/prettier';
23
25
 
24
- export default config
26
+ export default config;
25
27
  ```
26
28
 
27
- ## Пример скриптов
29
+ ### Пример скриптов
28
30
 
29
31
  `package.json`:
30
32
 
31
33
  ```json
32
34
  {
33
35
  "scripts": {
34
- "format": "prettier . --write",
35
- "format:check": "prettier . --check"
36
+ "prettier:fix": "prettier . --write",
37
+ "prettier:check": "prettier . --check"
36
38
  }
37
39
  }
38
40
  ```
39
41
 
40
42
  ---
41
43
 
42
- # @front-cmdt/format (EN)
44
+ ## Stylelint
45
+
46
+ Общий **stylelint** для проектов. Включает:
47
+
48
+ - Автоматическую очистку и сортировку свойств через `stylelint-config-clean-order`
49
+ - Поддержку SCSS через `stylelint-scss` и `postcss-scss`
50
+ - Базовые правила для предотвращения ошибок (пустые блоки, дубликаты селекторов и т.д.)
43
51
 
44
- Shared **Prettier config** for projects. Includes import sorting via `@trivago/prettier-plugin-sort-imports`.
52
+ ### Создайте: `stylelint.config.mjs` в проекте
45
53
 
46
- ## Requirements
54
+ ```js
55
+ import config from '@front-cmdt/format/stylelint';
56
+
57
+ export default config;
58
+ ```
47
59
 
48
- - `prettier` (peer dependency): `^3.0.0`
60
+ ### Пример скриптов
61
+
62
+ `package.json`:
63
+
64
+ ```json
65
+ {
66
+ "scripts": {
67
+ "stylelint:fix": "stylelint '**/*.{css,scss}' --fix",
68
+ "stylelint:check": "stylelint '**/*.{css,scss}'"
69
+ }
70
+ }
71
+ ```
72
+
73
+ ## Пример общего скрипта для форматирования
74
+
75
+ `package.json`:
76
+
77
+ ```json
78
+ {
79
+ "scripts": {
80
+ "format": "npm run stylelint:fix && npm run prettier:fix"
81
+ }
82
+ }
83
+ ```
84
+
85
+ ---
86
+
87
+ # @front-cmdt/format (EN)
49
88
 
50
- ## Install
89
+ ## Installation
51
90
 
52
91
  ```bash
53
- npm i -D @front-cmdt/format prettier
92
+ npm i -D @front-cmdt/format
54
93
  # or
55
- yarn add -D @front-cmdt/format prettier
94
+ yarn add -D @front-cmdt/format
56
95
  # or
57
- pnpm add -D @front-cmdt/format prettier
96
+ pnpm add -D @front-cmdt/format
58
97
  ```
59
98
 
60
- ### Create: `prettier.config.js` in your project
99
+ ---
100
+
101
+ ## Prettier
102
+
103
+ Shared **Prettier config** for projects. Includes:
104
+
105
+ - Import sorting via `@trivago/prettier-plugin-sort-imports`
106
+ - Automatic Tailwind CSS class sorting via `prettier-plugin-tailwindcss`
107
+ - `.astro` file formatting support via `prettier-plugin-astro`
108
+
109
+ ### Create: `prettier.config.mjs` in your project
61
110
 
62
111
  ```js
63
- import config from "@front-cmdt/format/prettier"
112
+ import config from '@front-cmdt/format/prettier';
113
+
114
+ export default config;
115
+ ```
116
+
117
+ ### Script examples
118
+
119
+ `package.json`:
64
120
 
65
- export default config
121
+ ```json
122
+ {
123
+ "scripts": {
124
+ "prettier:fix": "prettier . --write",
125
+ "prettier:check": "prettier . --check"
126
+ }
127
+ }
128
+ ```
129
+
130
+ ---
131
+
132
+ ## Stylelint
133
+
134
+ Shared **Stylelint config** for projects. Includes:
135
+
136
+ - Automatic property ordering and cleaning via `stylelint-config-clean-order`
137
+ - SCSS support via `stylelint-scss` and `postcss-scss`
138
+ - Core rules for error prevention (empty blocks, duplicate selectors, etc.)
139
+
140
+ ### Create: `stylelint.config.mjs` in your project
141
+
142
+ ```js
143
+ import config from '@front-cmdt/format/stylelint';
144
+
145
+ export default config;
146
+ ```
147
+
148
+ ### Script examples
149
+
150
+ `package.json`:
151
+
152
+ ```json
153
+ {
154
+ "scripts": {
155
+ "stylelint:fix": "stylelint '**/*.{css,scss}' --fix",
156
+ "stylelint:check": "stylelint '**/*.{css,scss}'"
157
+ }
158
+ }
66
159
  ```
67
160
 
68
- ## Script examples
161
+ ## Shared formatting script example
69
162
 
70
163
  `package.json`:
71
164
 
72
165
  ```json
73
166
  {
74
167
  "scripts": {
75
- "format": "prettier . --write",
76
- "format:check": "prettier . --check"
168
+ "format": "npm run stylelint:fix && npm run prettier:fix"
77
169
  }
78
170
  }
79
171
  ```
@@ -0,0 +1,2 @@
1
+ dist
2
+ dist-scripts
@@ -0,0 +1,90 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/prettier.config.mjs
20
+ var prettier_config_exports = {};
21
+ __export(prettier_config_exports, {
22
+ default: () => prettier_config_default
23
+ });
24
+ module.exports = __toCommonJS(prettier_config_exports);
25
+ var prettier_config_default = {
26
+ // Запятые в конце: "none" - без запятых, "es5" - где допустимо в ES5, "all" - везде
27
+ trailingComma: "none",
28
+ // Количество пробелов для отступа
29
+ tabWidth: 2,
30
+ // Использовать табы вместо пробелов
31
+ useTabs: false,
32
+ // Добавлять точку с запятой в конце выражений
33
+ semi: false,
34
+ // Использовать одинарные кавычки вместо двойных
35
+ singleQuote: true,
36
+ // Одинарные кавычки в JSX
37
+ jsxSingleQuote: true,
38
+ // Скобки вокруг единственного параметра стрелочной функции: "avoid" - убирать, "always" - всегда
39
+ arrowParens: "avoid",
40
+ // Максимальная длина строки перед переносом
41
+ printWidth: 120,
42
+ // Пробелы внутри фигурных скобок объектов: { foo: bar }
43
+ bracketSpacing: true,
44
+ // Кавычки вокруг ключей объекта: "as-needed" - только когда необходимо
45
+ quoteProps: "as-needed",
46
+ // Закрывающая скобка > на той же строке что и последний атрибут
47
+ bracketSameLine: false,
48
+ // Чувствительность к пробелам в HTML: "css" - как в CSS display свойстве
49
+ htmlWhitespaceSensitivity: "css",
50
+ // --- Настройки плагина сортировки импортов (@trivago/prettier-plugin-sort-imports) ---
51
+ // Добавлять пустую строку между группами импортов
52
+ importOrderSeparation: true,
53
+ // Каждый атрибут JSX на отдельной строке
54
+ singleAttributePerLine: true,
55
+ // Сортировать спецификаторы внутри импорта: import { a, b, c } from 'module'
56
+ importOrderSortSpecifiers: true,
57
+ // Сортировка без учёта регистра
58
+ importOrderCaseInsensitive: true,
59
+ // Плагины парсера для корректной обработки синтаксиса
60
+ importOrderParserPlugins: ["classProperties", "decorators-legacy", "typescript", "jsx"],
61
+ // Порядок группировки импортов (регулярные выражения)
62
+ importOrder: [
63
+ "<THIRD_PARTY_MODULES>",
64
+ // Сторонние модули (node_modules)
65
+ "^react$",
66
+ // React отдельно
67
+ // "^@/app/(.*)$",
68
+ // "^@/pages/(.*)$",
69
+ // "^@/widgets/(.*)$",
70
+ // "^@/features/(.*)$",
71
+ // "^@/entities/(.*)$",
72
+ // "^@/shared/(.*)$",
73
+ "^@/(.*)$",
74
+ // Алиасы проекта (@/)
75
+ "^../(.*)$",
76
+ // Относительные импорты из родительских директорий
77
+ "^./(.*)$"
78
+ // Относительные импорты из текущей директории
79
+ ],
80
+ // Подключённые плагины Prettier
81
+ plugins: ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-astro", "prettier-plugin-tailwindcss"],
82
+ overrides: [
83
+ {
84
+ files: "*.astro",
85
+ options: {
86
+ parser: "astro"
87
+ }
88
+ }
89
+ ]
90
+ };
@@ -0,0 +1,66 @@
1
+ /** @type {import("prettier").Config} */
2
+
3
+ var prettier_config = {
4
+ // Запятые в конце: "none" - без запятых, "es5" - где допустимо в ES5, "all" - везде
5
+ trailingComma: 'none',
6
+ // Количество пробелов для отступа
7
+ tabWidth: 2,
8
+ // Использовать табы вместо пробелов
9
+ useTabs: false,
10
+ // Добавлять точку с запятой в конце выражений
11
+ semi: false,
12
+ // Использовать одинарные кавычки вместо двойных
13
+ singleQuote: true,
14
+ // Одинарные кавычки в JSX
15
+ jsxSingleQuote: true,
16
+ // Скобки вокруг единственного параметра стрелочной функции: "avoid" - убирать, "always" - всегда
17
+ arrowParens: 'avoid',
18
+ // Максимальная длина строки перед переносом
19
+ printWidth: 120,
20
+ // Пробелы внутри фигурных скобок объектов: { foo: bar }
21
+ bracketSpacing: true,
22
+ // Кавычки вокруг ключей объекта: "as-needed" - только когда необходимо
23
+ quoteProps: 'as-needed',
24
+ // Закрывающая скобка > на той же строке что и последний атрибут
25
+ bracketSameLine: false,
26
+ // Чувствительность к пробелам в HTML: "css" - как в CSS display свойстве
27
+ htmlWhitespaceSensitivity: 'css',
28
+
29
+ // --- Настройки плагина сортировки импортов (@trivago/prettier-plugin-sort-imports) ---
30
+ // Добавлять пустую строку между группами импортов
31
+ importOrderSeparation: true,
32
+ // Каждый атрибут JSX на отдельной строке
33
+ singleAttributePerLine: true,
34
+ // Сортировать спецификаторы внутри импорта: import { a, b, c } from 'module'
35
+ importOrderSortSpecifiers: true,
36
+ // Сортировка без учёта регистра
37
+ importOrderCaseInsensitive: true,
38
+ // Плагины парсера для корректной обработки синтаксиса
39
+ importOrderParserPlugins: ['classProperties', 'decorators-legacy', 'typescript', 'jsx'],
40
+ // Порядок группировки импортов (регулярные выражения)
41
+ importOrder: [
42
+ '<THIRD_PARTY_MODULES>', // Сторонние модули (node_modules)
43
+ '^react$', // React отдельно
44
+ // "^@/app/(.*)$",
45
+ // "^@/pages/(.*)$",
46
+ // "^@/widgets/(.*)$",
47
+ // "^@/features/(.*)$",
48
+ // "^@/entities/(.*)$",
49
+ // "^@/shared/(.*)$",
50
+ '^@/(.*)$', // Алиасы проекта (@/)
51
+ '^../(.*)$', // Относительные импорты из родительских директорий
52
+ '^./(.*)$' // Относительные импорты из текущей директории
53
+ ],
54
+ // Подключённые плагины Prettier
55
+ plugins: ['@trivago/prettier-plugin-sort-imports', 'prettier-plugin-astro', 'prettier-plugin-tailwindcss'],
56
+ overrides: [
57
+ {
58
+ files: '*.astro',
59
+ options: {
60
+ parser: 'astro'
61
+ }
62
+ }
63
+ ]
64
+ };
65
+
66
+ export { prettier_config as default };
@@ -0,0 +1,66 @@
1
+ /** @type {import("prettier").Config} */
2
+
3
+ var prettier_config = {
4
+ // Запятые в конце: "none" - без запятых, "es5" - где допустимо в ES5, "all" - везде
5
+ trailingComma: 'none',
6
+ // Количество пробелов для отступа
7
+ tabWidth: 2,
8
+ // Использовать табы вместо пробелов
9
+ useTabs: false,
10
+ // Добавлять точку с запятой в конце выражений
11
+ semi: false,
12
+ // Использовать одинарные кавычки вместо двойных
13
+ singleQuote: true,
14
+ // Одинарные кавычки в JSX
15
+ jsxSingleQuote: true,
16
+ // Скобки вокруг единственного параметра стрелочной функции: "avoid" - убирать, "always" - всегда
17
+ arrowParens: 'avoid',
18
+ // Максимальная длина строки перед переносом
19
+ printWidth: 120,
20
+ // Пробелы внутри фигурных скобок объектов: { foo: bar }
21
+ bracketSpacing: true,
22
+ // Кавычки вокруг ключей объекта: "as-needed" - только когда необходимо
23
+ quoteProps: 'as-needed',
24
+ // Закрывающая скобка > на той же строке что и последний атрибут
25
+ bracketSameLine: false,
26
+ // Чувствительность к пробелам в HTML: "css" - как в CSS display свойстве
27
+ htmlWhitespaceSensitivity: 'css',
28
+
29
+ // --- Настройки плагина сортировки импортов (@trivago/prettier-plugin-sort-imports) ---
30
+ // Добавлять пустую строку между группами импортов
31
+ importOrderSeparation: true,
32
+ // Каждый атрибут JSX на отдельной строке
33
+ singleAttributePerLine: true,
34
+ // Сортировать спецификаторы внутри импорта: import { a, b, c } from 'module'
35
+ importOrderSortSpecifiers: true,
36
+ // Сортировка без учёта регистра
37
+ importOrderCaseInsensitive: true,
38
+ // Плагины парсера для корректной обработки синтаксиса
39
+ importOrderParserPlugins: ['classProperties', 'decorators-legacy', 'typescript', 'jsx'],
40
+ // Порядок группировки импортов (регулярные выражения)
41
+ importOrder: [
42
+ '<THIRD_PARTY_MODULES>', // Сторонние модули (node_modules)
43
+ '^react$', // React отдельно
44
+ // "^@/app/(.*)$",
45
+ // "^@/pages/(.*)$",
46
+ // "^@/widgets/(.*)$",
47
+ // "^@/features/(.*)$",
48
+ // "^@/entities/(.*)$",
49
+ // "^@/shared/(.*)$",
50
+ '^@/(.*)$', // Алиасы проекта (@/)
51
+ '^../(.*)$', // Относительные импорты из родительских директорий
52
+ '^./(.*)$' // Относительные импорты из текущей директории
53
+ ],
54
+ // Подключённые плагины Prettier
55
+ plugins: ['@trivago/prettier-plugin-sort-imports', 'prettier-plugin-astro', 'prettier-plugin-tailwindcss'],
56
+ overrides: [
57
+ {
58
+ files: '*.astro',
59
+ options: {
60
+ parser: 'astro'
61
+ }
62
+ }
63
+ ]
64
+ };
65
+
66
+ export { prettier_config as default };
@@ -1,6 +1,5 @@
1
- /** @type {import("prettier").Config} */
2
-
3
- export default {
1
+ // src/prettier.config.mjs
2
+ var prettier_config_default = {
4
3
  // Запятые в конце: "none" - без запятых, "es5" - где допустимо в ES5, "all" - везде
5
4
  trailingComma: "none",
6
5
  // Количество пробелов для отступа
@@ -12,7 +11,7 @@ export default {
12
11
  // Использовать одинарные кавычки вместо двойных
13
12
  singleQuote: true,
14
13
  // Одинарные кавычки в JSX
15
- jsSingleQuote: true,
14
+ jsxSingleQuote: true,
16
15
  // Скобки вокруг единственного параметра стрелочной функции: "avoid" - убирать, "always" - всегда
17
16
  arrowParens: "avoid",
18
17
  // Максимальная длина строки перед переносом
@@ -25,7 +24,6 @@ export default {
25
24
  bracketSameLine: false,
26
25
  // Чувствительность к пробелам в HTML: "css" - как в CSS display свойстве
27
26
  htmlWhitespaceSensitivity: "css",
28
-
29
27
  // --- Настройки плагина сортировки импортов (@trivago/prettier-plugin-sort-imports) ---
30
28
  // Добавлять пустую строку между группами импортов
31
29
  importOrderSeparation: true,
@@ -34,23 +32,39 @@ export default {
34
32
  // Сортировать спецификаторы внутри импорта: import { a, b, c } from 'module'
35
33
  importOrderSortSpecifiers: true,
36
34
  // Сортировка без учёта регистра
37
- importOrderInsensitive: true,
35
+ importOrderCaseInsensitive: true,
38
36
  // Плагины парсера для корректной обработки синтаксиса
39
- importOrderParserPlugins: ["classProperties", "decorators-legacy", "typescript"],
37
+ importOrderParserPlugins: ["classProperties", "decorators-legacy", "typescript", "jsx"],
40
38
  // Порядок группировки импортов (регулярные выражения)
41
39
  importOrder: [
42
- "<THIRD_PARTY_MODULES>", // Сторонние модули (node_modules)
43
- "^react$", // React отдельно
40
+ "<THIRD_PARTY_MODULES>",
41
+ // Сторонние модули (node_modules)
42
+ "^react$",
43
+ // React отдельно
44
44
  // "^@/app/(.*)$",
45
45
  // "^@/pages/(.*)$",
46
46
  // "^@/widgets/(.*)$",
47
47
  // "^@/features/(.*)$",
48
48
  // "^@/entities/(.*)$",
49
49
  // "^@/shared/(.*)$",
50
- "^@/(.*)$", // Алиасы проекта (@/)
51
- "^../(.*)$", // Относительные импорты из родительских директорий
52
- "^./(.*)$", // Относительные импорты из текущей директории
50
+ "^@/(.*)$",
51
+ // Алиасы проекта (@/)
52
+ "^../(.*)$",
53
+ // Относительные импорты из родительских директорий
54
+ "^./(.*)$"
55
+ // Относительные импорты из текущей директории
53
56
  ],
54
57
  // Подключённые плагины Prettier
55
- plugins: ["@trivago/prettier-plugin-sort-imports"],
56
- }
58
+ plugins: ["@trivago/prettier-plugin-sort-imports", "prettier-plugin-astro", "prettier-plugin-tailwindcss"],
59
+ overrides: [
60
+ {
61
+ files: "*.astro",
62
+ options: {
63
+ parser: "astro"
64
+ }
65
+ }
66
+ ]
67
+ };
68
+ export {
69
+ prettier_config_default as default
70
+ };
@@ -0,0 +1,50 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/stylelint.config.mjs
20
+ var stylelint_config_exports = {};
21
+ __export(stylelint_config_exports, {
22
+ default: () => stylelint_config_default
23
+ });
24
+ module.exports = __toCommonJS(stylelint_config_exports);
25
+ var stylelint_config_default = {
26
+ extends: ["stylelint-config-clean-order"],
27
+ plugins: ["stylelint-scss"],
28
+ customSyntax: "postcss-scss",
29
+ rules: {
30
+ "block-no-empty": true,
31
+ "color-hex-length": "long",
32
+ "no-duplicate-selectors": true,
33
+ "selector-max-id": 0,
34
+ "at-rule-empty-line-before": [
35
+ "always",
36
+ {
37
+ except: ["first-nested"],
38
+ ignoreAtRules: ["else if", "else", "use", "import", "include", "tailwind"]
39
+ }
40
+ ],
41
+ "rule-empty-line-before": [
42
+ "always",
43
+ {
44
+ except: ["first-nested"]
45
+ }
46
+ ],
47
+ "order/properties-alphabetical-order": null,
48
+ "order/order": ["custom-properties", "dollar-variables", "at-variables", "declarations", "at-rules", "rules"]
49
+ }
50
+ };
@@ -0,0 +1,29 @@
1
+ /** @type {import('stylelint').Config} */
2
+ var stylelint_config = {
3
+ extends: ['stylelint-config-clean-order'],
4
+ plugins: ['stylelint-scss'],
5
+ customSyntax: 'postcss-scss',
6
+ rules: {
7
+ 'block-no-empty': true,
8
+ 'color-hex-length': 'long',
9
+ 'no-duplicate-selectors': true,
10
+ 'selector-max-id': 0,
11
+ 'at-rule-empty-line-before': [
12
+ 'always',
13
+ {
14
+ except: ['first-nested'],
15
+ ignoreAtRules: ['else if', 'else', 'use', 'import', 'include', 'tailwind']
16
+ }
17
+ ],
18
+ 'rule-empty-line-before': [
19
+ 'always',
20
+ {
21
+ except: ['first-nested']
22
+ }
23
+ ],
24
+ 'order/properties-alphabetical-order': null,
25
+ 'order/order': ['custom-properties', 'dollar-variables', 'at-variables', 'declarations', 'at-rules', 'rules']
26
+ }
27
+ };
28
+
29
+ export { stylelint_config as default };
@@ -0,0 +1,29 @@
1
+ /** @type {import('stylelint').Config} */
2
+ var stylelint_config = {
3
+ extends: ['stylelint-config-clean-order'],
4
+ plugins: ['stylelint-scss'],
5
+ customSyntax: 'postcss-scss',
6
+ rules: {
7
+ 'block-no-empty': true,
8
+ 'color-hex-length': 'long',
9
+ 'no-duplicate-selectors': true,
10
+ 'selector-max-id': 0,
11
+ 'at-rule-empty-line-before': [
12
+ 'always',
13
+ {
14
+ except: ['first-nested'],
15
+ ignoreAtRules: ['else if', 'else', 'use', 'import', 'include', 'tailwind']
16
+ }
17
+ ],
18
+ 'rule-empty-line-before': [
19
+ 'always',
20
+ {
21
+ except: ['first-nested']
22
+ }
23
+ ],
24
+ 'order/properties-alphabetical-order': null,
25
+ 'order/order': ['custom-properties', 'dollar-variables', 'at-variables', 'declarations', 'at-rules', 'rules']
26
+ }
27
+ };
28
+
29
+ export { stylelint_config as default };
@@ -0,0 +1,30 @@
1
+ // src/stylelint.config.mjs
2
+ var stylelint_config_default = {
3
+ extends: ["stylelint-config-clean-order"],
4
+ plugins: ["stylelint-scss"],
5
+ customSyntax: "postcss-scss",
6
+ rules: {
7
+ "block-no-empty": true,
8
+ "color-hex-length": "long",
9
+ "no-duplicate-selectors": true,
10
+ "selector-max-id": 0,
11
+ "at-rule-empty-line-before": [
12
+ "always",
13
+ {
14
+ except: ["first-nested"],
15
+ ignoreAtRules: ["else if", "else", "use", "import", "include", "tailwind"]
16
+ }
17
+ ],
18
+ "rule-empty-line-before": [
19
+ "always",
20
+ {
21
+ except: ["first-nested"]
22
+ }
23
+ ],
24
+ "order/properties-alphabetical-order": null,
25
+ "order/order": ["custom-properties", "dollar-variables", "at-variables", "declarations", "at-rules", "rules"]
26
+ }
27
+ };
28
+ export {
29
+ stylelint_config_default as default
30
+ };
package/package.json CHANGED
@@ -1,17 +1,28 @@
1
1
  {
2
2
  "name": "@front-cmdt/format",
3
- "version": "1.2.2",
3
+ "version": "1.4.0",
4
4
  "keywords": [
5
5
  "prettier",
6
6
  "trivago",
7
7
  "prettier-plugin-sort-imports",
8
+ "tailwindcss",
9
+ "prettier-plugin-tailwindcss",
8
10
  "lint",
9
11
  "linting",
10
12
  "format",
11
13
  "formatting",
12
14
  "code style",
13
15
  "code formatting",
14
- "code styling"
16
+ "code styling",
17
+ "stylelint",
18
+ "stylelint-config",
19
+ "stylelint-scss",
20
+ "scss lint",
21
+ "scss linting",
22
+ "css lint",
23
+ "css linting",
24
+ "astro",
25
+ "astro plugin"
15
26
  ],
16
27
  "type": "module",
17
28
  "publishConfig": {
@@ -19,18 +30,59 @@
19
30
  },
20
31
  "license": "ISC",
21
32
  "peerDependencies": {
22
- "prettier": "^3.0.0"
33
+ "sass": "^1.5.0"
23
34
  },
24
35
  "dependencies": {
25
- "@trivago/prettier-plugin-sort-imports": "^5.2.2"
36
+ "@trivago/prettier-plugin-sort-imports": "^5.2.2",
37
+ "postcss-scss": "^4.0.9",
38
+ "prettier": "^3.0.0",
39
+ "prettier-plugin-astro": "0.14.1",
40
+ "prettier-plugin-tailwindcss": "^0.7.2",
41
+ "stylelint": "^17.1.1",
42
+ "stylelint-config-clean-order": "^8.0.0",
43
+ "stylelint-order": "^7.0.0",
44
+ "stylelint-scss": "^7.0.0"
26
45
  },
46
+ "main": "./dist/prettier.config.cjs",
47
+ "module": "./dist/prettier.config.js",
48
+ "types": "./dist/prettier.config.d.ts",
49
+ "files": [
50
+ "dist",
51
+ "CHANGELOG.md"
52
+ ],
27
53
  "scripts": {
28
- "release:patch": "npm version patch -m \"release: v%s\" && git push --follow-tags",
29
- "release:minor": "npm version minor -m \"release: v%s\" && git push --follow-tags",
30
- "release:major": "npm version major -m \"release: v%s\" && git push --follow-tags",
31
- "release:push": "git push --follow-tags"
54
+ "build": "tsup src/prettier.config.mjs src/stylelint.config.mjs --format esm,cjs --dts --clean",
55
+ "release:patch": "yarn build && npm version patch -m \"release: v%s\" && git push --follow-tags",
56
+ "release:minor": "yarn build && npm version minor -m \"release: v%s\" && git push --follow-tags",
57
+ "release:major": "yarn build && npm version major -m \"release: v%s\" && git push --follow-tags",
58
+ "release:push": "git push --follow-tags",
59
+ "pub:local": "npm run build && yalc push"
32
60
  },
33
61
  "exports": {
34
- "./prettier": "./src/prettier.config.mjs"
62
+ "./prettier": {
63
+ "import": {
64
+ "types": "./dist/prettier.config.d.ts",
65
+ "default": "./dist/prettier.config.js"
66
+ },
67
+ "require": {
68
+ "types": "./dist/prettier.config.d.cts",
69
+ "default": "./dist/prettier.config.cjs"
70
+ }
71
+ },
72
+ "./stylelint": {
73
+ "import": {
74
+ "types": "./dist/stylelint.config.d.ts",
75
+ "default": "./dist/stylelint.config.js"
76
+ },
77
+ "require": {
78
+ "types": "./dist/stylelint.config.d.cts",
79
+ "default": "./dist/stylelint.config.cjs"
80
+ }
81
+ }
82
+ },
83
+ "devDependencies": {
84
+ "tsup": "^8.5.1",
85
+ "typescript": "^5.9.3",
86
+ "yalc": "^1.0.0-pre.53"
35
87
  }
36
88
  }