@application-kit/stylelint-config 0.0.0-stage → 0.1.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 +7 -0
- package/LICENSE +21 -0
- package/README.md +44 -2
- package/index.js +71 -0
- package/package.json +52 -3
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# @application-kit/stylelint-config
|
|
2
|
+
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- a1c3322: Новый пакет: пресет stylelint для стилей `.vue`, `.scss` и `.css` — `stylelint-config-standard` и `-standard-scss`, `recommended-vue`, порядок свойств `recess-order`, стилистика `@stylistic/stylelint-plugin`, синтаксис Vue SFC через `postcss-html`. Плагины и конфиги приходят зависимостями пакета, потребитель ставит только `stylelint` и подключает пресет через `extends`. `ignoreFiles` и свои правила остаются у потребителя: stylelint разрешает `ignoreFiles` от каталога объявившего конфига.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 application-kit
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,45 @@
|
|
|
1
|
-
#
|
|
1
|
+
# @application-kit/stylelint-config
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Пресет stylelint приложения на пакетах `@application-kit`: стили `.vue`, `.scss` и `.css`. База —
|
|
4
|
+
`stylelint-config-standard` и `stylelint-config-standard-scss`, Vue SFC — `stylelint-config-recommended-vue` с
|
|
5
|
+
синтаксисом `postcss-html`, порядок свойств — `stylelint-config-recess-order`, стилистика — `@stylistic/stylelint-plugin`.
|
|
6
|
+
|
|
7
|
+
## Установка
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
yarn add --dev @application-kit/stylelint-config stylelint
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Плагины и конфиги приходят зависимостями пакета, peer-зависимость одна — `stylelint`. Пакет — только ESM.
|
|
14
|
+
|
|
15
|
+
## Подключение
|
|
16
|
+
|
|
17
|
+
```js
|
|
18
|
+
// stylelint.config.mjs
|
|
19
|
+
export default {
|
|
20
|
+
extends: ['@application-kit/stylelint-config'],
|
|
21
|
+
ignoreFiles: ['coverage/**', 'dist/**'],
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`ignoreFiles` задаёт потребитель: stylelint разрешает его от каталога конфига, который его объявил, и из пресета шаблоны
|
|
26
|
+
указывали бы внутрь `node_modules`. Свои правила потребитель дописывает в `rules` после `extends`, и они перекрывают
|
|
27
|
+
пресет. Пример — шаблон классов BEM:
|
|
28
|
+
|
|
29
|
+
```js
|
|
30
|
+
export default {
|
|
31
|
+
extends: ['@application-kit/stylelint-config'],
|
|
32
|
+
rules: {
|
|
33
|
+
'selector-class-pattern': [String.raw`^[a-z][a-z0-9]*(-[a-z0-9]+)*(__[a-z0-9]+(-[a-z0-9]+)*)?$`],
|
|
34
|
+
},
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
## Что задаёт пресет
|
|
39
|
+
|
|
40
|
+
| Область | Правила |
|
|
41
|
+
|---------|---------|
|
|
42
|
+
| Стилистика | `@stylistic/*`: отступ 2, нижний регистр hex, свойств и единиц, ведущий ноль, двойные кавычки в `.scss` и `.css` |
|
|
43
|
+
| `.vue` | синтаксис `postcss-html`, одинарные кавычки, `url()` без кавычек |
|
|
44
|
+
| Vue и SCSS | псевдоклассы `:deep`, `:global`, `:slotted`, псевдоэлементы `::v-*`, at-правило `@use` |
|
|
45
|
+
| Отключено | `no-descending-specificity`, `property-no-vendor-prefix`, `media-query-no-invalid` |
|
package/index.js
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import postcssHtml from 'postcss-html'
|
|
2
|
+
|
|
3
|
+
// ignoreFiles пресету не задать: stylelint разрешает его от каталога объявившего конфига, то есть внутри node_modules.
|
|
4
|
+
export default {
|
|
5
|
+
extends: [
|
|
6
|
+
'stylelint-config-html',
|
|
7
|
+
'stylelint-config-recess-order',
|
|
8
|
+
'stylelint-config-recommended-vue',
|
|
9
|
+
'stylelint-config-recommended-vue/scss',
|
|
10
|
+
'stylelint-config-standard',
|
|
11
|
+
'stylelint-config-standard-scss',
|
|
12
|
+
],
|
|
13
|
+
overrides: [
|
|
14
|
+
{
|
|
15
|
+
// Синтаксис — модулем, а не строкой: строку stylelint импортирует из своего каталога, и она находилась бы
|
|
16
|
+
// только при поднятом в корень node_modules postcss-html.
|
|
17
|
+
customSyntax: postcssHtml,
|
|
18
|
+
files: ['**/*.vue'],
|
|
19
|
+
rules: {
|
|
20
|
+
'@stylistic/string-quotes': 'single',
|
|
21
|
+
'function-url-quotes': 'never',
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
],
|
|
25
|
+
plugins: ['@stylistic/stylelint-plugin'],
|
|
26
|
+
rules: {
|
|
27
|
+
'@stylistic/color-hex-case': 'lower',
|
|
28
|
+
'@stylistic/declaration-bang-space-after': 'never',
|
|
29
|
+
'@stylistic/declaration-bang-space-before': 'always',
|
|
30
|
+
'@stylistic/declaration-block-semicolon-newline-after': 'always',
|
|
31
|
+
'@stylistic/declaration-colon-space-before': 'never',
|
|
32
|
+
'@stylistic/function-max-empty-lines': 0,
|
|
33
|
+
'@stylistic/function-parentheses-newline-inside': 'never-multi-line',
|
|
34
|
+
'@stylistic/function-parentheses-space-inside': 'never',
|
|
35
|
+
'@stylistic/function-whitespace-after': 'always',
|
|
36
|
+
'@stylistic/indentation': [2, { baseIndentLevel: 0, indentInsideParens: 'once-at-root-twice-in-block' }],
|
|
37
|
+
'@stylistic/linebreaks': 'unix',
|
|
38
|
+
'@stylistic/max-empty-lines': 1,
|
|
39
|
+
'@stylistic/max-line-length': [120, { ignore: ['comments', 'non-comments'] }],
|
|
40
|
+
'@stylistic/no-empty-first-line': true,
|
|
41
|
+
'@stylistic/no-extra-semicolons': true,
|
|
42
|
+
'@stylistic/number-leading-zero': 'always',
|
|
43
|
+
'@stylistic/number-no-trailing-zeros': true,
|
|
44
|
+
'@stylistic/property-case': 'lower',
|
|
45
|
+
'@stylistic/string-quotes': 'double',
|
|
46
|
+
'@stylistic/unit-case': 'lower',
|
|
47
|
+
'@stylistic/value-list-max-empty-lines': 0,
|
|
48
|
+
'at-rule-empty-line-before': [
|
|
49
|
+
'always',
|
|
50
|
+
{ except: ['blockless-after-same-name-blockless'], ignore: ['after-comment'] },
|
|
51
|
+
],
|
|
52
|
+
'at-rule-no-unknown': [true, { ignoreAtRules: 'use' }],
|
|
53
|
+
'declaration-block-no-duplicate-properties': true,
|
|
54
|
+
'declaration-property-value-no-unknown': true,
|
|
55
|
+
'import-notation': 'string',
|
|
56
|
+
'length-zero-no-unit': true,
|
|
57
|
+
'media-query-no-invalid': null,
|
|
58
|
+
'no-descending-specificity': null,
|
|
59
|
+
'no-irregular-whitespace': true,
|
|
60
|
+
'property-no-vendor-prefix': null,
|
|
61
|
+
'rule-empty-line-before': [
|
|
62
|
+
'always-multi-line',
|
|
63
|
+
{
|
|
64
|
+
ignore: ['first-nested', 'after-comment'],
|
|
65
|
+
},
|
|
66
|
+
],
|
|
67
|
+
'selector-pseudo-class-no-unknown': [true, { ignorePseudoClasses: ['deep', 'global', 'slotted'] }],
|
|
68
|
+
'selector-pseudo-element-no-unknown': [true, { ignorePseudoElements: ['/^v-/'] }],
|
|
69
|
+
'shorthand-property-no-redundant-values': true,
|
|
70
|
+
},
|
|
71
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,55 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@application-kit/stylelint-config",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Пресет stylelint приложения на пакетах @application-kit: стили .vue, .scss и .css — порядок свойств recess, стилистика @stylistic, Vue SFC через postcss-html",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"stylelint",
|
|
7
|
+
"stylelint-config",
|
|
8
|
+
"vue"
|
|
9
|
+
],
|
|
10
|
+
"homepage": "https://gitlab.com/application-kit/application-kit/-/tree/main/packages/stylelint-config",
|
|
11
|
+
"bugs": "https://gitlab.com/application-kit/application-kit/-/issues",
|
|
12
|
+
"repository": {
|
|
13
|
+
"type": "git",
|
|
14
|
+
"url": "https://gitlab.com/application-kit/application-kit.git",
|
|
15
|
+
"directory": "packages/stylelint-config"
|
|
16
|
+
},
|
|
17
|
+
"license": "MIT",
|
|
18
|
+
"author": {
|
|
19
|
+
"name": "application-kit"
|
|
20
|
+
},
|
|
21
|
+
"sideEffects": false,
|
|
22
|
+
"type": "module",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./index.js",
|
|
25
|
+
"./package.json": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
"main": "./index.js",
|
|
28
|
+
"files": [
|
|
29
|
+
"index.js"
|
|
30
|
+
],
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@stylistic/stylelint-plugin": "^5.3.0",
|
|
33
|
+
"postcss-html": "^2.0.0",
|
|
34
|
+
"stylelint-config-html": "^2.0.0",
|
|
35
|
+
"stylelint-config-recess-order": "^7.8.0",
|
|
36
|
+
"stylelint-config-recommended": "^18.0.0",
|
|
37
|
+
"stylelint-config-recommended-scss": "^17.0.0",
|
|
38
|
+
"stylelint-config-recommended-vue": "^2.0.0",
|
|
39
|
+
"stylelint-config-standard": "^40.0.0",
|
|
40
|
+
"stylelint-config-standard-scss": "^17.0.0",
|
|
41
|
+
"stylelint-order": "^8.1.1"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
44
|
+
"stylelint": "^17.14.1"
|
|
45
|
+
},
|
|
46
|
+
"peerDependencies": {
|
|
47
|
+
"stylelint": "^17.6.0"
|
|
48
|
+
},
|
|
49
|
+
"engines": {
|
|
50
|
+
"node": ">=24"
|
|
51
|
+
},
|
|
52
|
+
"publishConfig": {
|
|
53
|
+
"access": "public"
|
|
54
|
+
}
|
|
6
55
|
}
|