arui-presets-lint 9.6.1 → 10.0.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 +12 -0
- package/README.md +5 -3
- package/eslint/index.js +1 -1
- package/eslint/rules/typescript.js +1 -1
- package/lefthook/index.yml +6 -3
- package/package.json +8 -8
- package/stylelint/index.d.ts +0 -1
- package/stylelint/index.js +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 10.0.0
|
|
2
|
+
|
|
3
|
+
### Major Changes
|
|
4
|
+
|
|
5
|
+
- [#120](https://github.com/core-ds/arui-presets-lint/pull/120) [`b6cbb1a`](https://github.com/core-ds/arui-presets-lint/commit/b6cbb1a87847682cecd1c7a73809020f17f7fb55) Thanks [@kiskv](https://github.com/kiskv)! - - Обновление stylelint до 17 версии, eslint-plugin-n до 18, eslint-plugin-de-morgan до 2 - минимальная версия node теперь 20.19.0'
|
|
6
|
+
- git add в конфигурации lefthook заменен на stage_fixed
|
|
7
|
+
|
|
8
|
+
### Patch Changes
|
|
9
|
+
|
|
10
|
+
- Updated dependencies [[`b6cbb1a`](https://github.com/core-ds/arui-presets-lint/commit/b6cbb1a87847682cecd1c7a73809020f17f7fb55)]:
|
|
11
|
+
- @alfalab/stylelint-core-vars@3.0.0
|
|
12
|
+
|
|
1
13
|
## 9.6.1
|
|
2
14
|
|
|
3
15
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -86,7 +86,7 @@ export default defineConfig(eslintConfig, [
|
|
|
86
86
|
// Это позволит eslint линтить файлы, даже если они не указаны в tsconfig.json
|
|
87
87
|
// Обратите внимание, что включить '**' тут нельзя, влияет на производительность!
|
|
88
88
|
// https://typescript-eslint.io/packages/parser/#allowdefaultproject
|
|
89
|
-
//
|
|
89
|
+
// Конкретно тут - разрешаем линтить все файлы с расширениями .ts, .mts и .cts в корневой директории проекта
|
|
90
90
|
allowDefaultProject: ['*.ts', '*.mts', '*.cts'],
|
|
91
91
|
},
|
|
92
92
|
},
|
|
@@ -100,7 +100,7 @@ export default defineConfig(eslintConfig, [
|
|
|
100
100
|
|
|
101
101
|
```typescript
|
|
102
102
|
import { eslintConfig } from 'arui-presets-lint/eslint';
|
|
103
|
-
import { defineConfig } from 'arui-presets-lint/eslint/config';
|
|
103
|
+
import { defineConfig, globalIgnores } from 'arui-presets-lint/eslint/config';
|
|
104
104
|
|
|
105
105
|
export default defineConfig(eslintConfig, [
|
|
106
106
|
{
|
|
@@ -149,7 +149,7 @@ import { defineConfig, globalIgnores } from 'arui-presets-lint/eslint/config';
|
|
|
149
149
|
|
|
150
150
|
## Настройка [lefthook](https://github.com/evilmartians/lefthook)
|
|
151
151
|
|
|
152
|
-
|
|
152
|
+
Создайте в корне проекта файл lefthook.yml,
|
|
153
153
|
он должен содержать следующее:
|
|
154
154
|
|
|
155
155
|
```yaml
|
|
@@ -157,6 +157,8 @@ extends:
|
|
|
157
157
|
- ./node_modules/arui-presets-lint/lefthook/index.yml
|
|
158
158
|
```
|
|
159
159
|
|
|
160
|
+
Затем подключите хуки к репозиторию: `npx --no-install lefthook install`
|
|
161
|
+
|
|
160
162
|
Этот конфиг можно расширить специфичными для вашего проекта настройками, см. [документацию](https://lefthook.dev/configuration/) Примеры такого расширения:
|
|
161
163
|
|
|
162
164
|
```yml
|
package/eslint/index.js
CHANGED
package/lefthook/index.yml
CHANGED
|
@@ -6,13 +6,16 @@ pre-commit:
|
|
|
6
6
|
commands:
|
|
7
7
|
check-scripts:
|
|
8
8
|
glob: '*.{js,ts,jsx,tsx,mts,mjs,cjs,cts,ctsx,mtsx,cjsx,mjsx}'
|
|
9
|
-
run: npx --no-install prettier --write {staged_files} --cache && npx --no-install eslint {staged_files} --no-warn-ignored
|
|
9
|
+
run: npx --no-install prettier --write {staged_files} --cache && npx --no-install eslint {staged_files} --no-warn-ignored
|
|
10
|
+
stage_fixed: true
|
|
10
11
|
check-styles:
|
|
11
12
|
glob: '*.{css}'
|
|
12
|
-
run: npx --no-install prettier --write {staged_files} --cache && npx --no-install stylelint {staged_files} --allow-empty-input --cache --cache-location="./node_modules/.cache/stylelint/.stylelintcache"
|
|
13
|
+
run: npx --no-install prettier --write {staged_files} --cache && npx --no-install stylelint {staged_files} --allow-empty-input --cache --cache-location="./node_modules/.cache/stylelint/.stylelintcache"
|
|
14
|
+
stage_fixed: true
|
|
13
15
|
check-json:
|
|
14
16
|
glob: '*.{json}'
|
|
15
|
-
run: npx --no-install prettier --write {staged_files} --cache
|
|
17
|
+
run: npx --no-install prettier --write {staged_files} --cache
|
|
18
|
+
stage_fixed: true
|
|
16
19
|
commit-msg:
|
|
17
20
|
commands:
|
|
18
21
|
commitlint:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arui-presets-lint",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "10.0.0",
|
|
4
4
|
"description": "Config files for arui-apps",
|
|
5
5
|
"author": "core-ds contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -11,20 +11,20 @@
|
|
|
11
11
|
"url": "git+https://github.com/core-ds/arui-presets-lint.git"
|
|
12
12
|
},
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@alfalab/stylelint-core-vars": "
|
|
14
|
+
"@alfalab/stylelint-core-vars": "3.0.0",
|
|
15
15
|
"@commitlint/cli": "20.5.3",
|
|
16
16
|
"@commitlint/config-conventional": "20.5.3",
|
|
17
17
|
"@eslint/js": "9.39.4",
|
|
18
18
|
"@types/eslint-plugin-jsx-a11y": "6.10.1",
|
|
19
|
-
"@typescript-eslint/utils": "8.59.
|
|
19
|
+
"@typescript-eslint/utils": "8.59.2",
|
|
20
20
|
"eslint": "9.39.4",
|
|
21
21
|
"eslint-config-flat-gitignore": "2.3.0",
|
|
22
22
|
"eslint-import-resolver-typescript": "4.4.4",
|
|
23
23
|
"eslint-plugin-check-file": "3.3.1",
|
|
24
|
-
"eslint-plugin-de-morgan": "1.
|
|
24
|
+
"eslint-plugin-de-morgan": "2.1.2",
|
|
25
25
|
"eslint-plugin-import-x": "4.16.2",
|
|
26
26
|
"eslint-plugin-jsx-a11y": "6.10.2",
|
|
27
|
-
"eslint-plugin-n": "
|
|
27
|
+
"eslint-plugin-n": "18.0.1",
|
|
28
28
|
"eslint-plugin-react": "7.37.5",
|
|
29
29
|
"eslint-plugin-react-hooks": "7.1.1",
|
|
30
30
|
"eslint-plugin-simple-import-sort": "13.0.0",
|
|
@@ -34,12 +34,12 @@
|
|
|
34
34
|
"jiti": "^2.6.1",
|
|
35
35
|
"lefthook": "2.1.6",
|
|
36
36
|
"prettier": "3.8.3",
|
|
37
|
-
"stylelint": "
|
|
37
|
+
"stylelint": "17.11.0",
|
|
38
38
|
"stylelint-order": "8.1.1",
|
|
39
|
-
"typescript-eslint": "8.59.
|
|
39
|
+
"typescript-eslint": "8.59.2"
|
|
40
40
|
},
|
|
41
41
|
"engines": {
|
|
42
|
-
"node": ">=
|
|
42
|
+
"node": ">=20.19.0"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {},
|
|
45
45
|
"scripts": {
|
package/stylelint/index.d.ts
CHANGED
package/stylelint/index.js
CHANGED
|
@@ -102,19 +102,19 @@ export default {
|
|
|
102
102
|
},
|
|
103
103
|
],
|
|
104
104
|
// Требует использовать CSS-переменные дизайн-системы вместо хардкода
|
|
105
|
-
// https://github.com/core-ds/stylelint-core-vars
|
|
105
|
+
// https://github.com/core-ds/arui-presets-lint/tree/master/packages/stylelint-core-vars
|
|
106
106
|
'stylelint-core-vars/use-vars': true,
|
|
107
107
|
// Требует использовать миксины дизайн-системы
|
|
108
|
-
// https://github.com/core-ds/stylelint-core-vars
|
|
108
|
+
// https://github.com/core-ds/arui-presets-lint/tree/master/packages/stylelint-core-vars
|
|
109
109
|
'stylelint-core-vars/use-mixins': true,
|
|
110
110
|
// Рекомендует использовать один из доступных vars при выборе значения
|
|
111
|
-
// https://github.com/core-ds/stylelint-core-vars
|
|
111
|
+
// https://github.com/core-ds/arui-presets-lint/tree/master/packages/stylelint-core-vars
|
|
112
112
|
'stylelint-core-vars/use-one-of-vars': [true, { severity: 'warning' }],
|
|
113
113
|
// Рекомендует использовать один из доступных mixins при выборе
|
|
114
|
-
// https://github.com/core-ds/stylelint-core-vars
|
|
114
|
+
// https://github.com/core-ds/arui-presets-lint/tree/master/packages/stylelint-core-vars
|
|
115
115
|
'stylelint-core-vars/use-one-of-mixins': [true, { severity: 'warning' }],
|
|
116
116
|
// Предупреждает об использовании тeмных цветов напрямую
|
|
117
|
-
// https://github.com/core-ds/stylelint-core-vars
|
|
117
|
+
// https://github.com/core-ds/arui-presets-lint/tree/master/packages/stylelint-core-vars
|
|
118
118
|
'stylelint-core-vars/do-not-use-dark-colors': [true, { severity: 'warning' }],
|
|
119
119
|
// Требует пустую строку перед правилами
|
|
120
120
|
// https://stylelint.io/user-guide/rules/rule-empty-line-before
|
|
@@ -167,7 +167,6 @@ export default {
|
|
|
167
167
|
'selector-class-pattern': [
|
|
168
168
|
'^[^-]+$',
|
|
169
169
|
{
|
|
170
|
-
resolveNestedSelectors: true,
|
|
171
170
|
message: 'Expected class selector to be camelCase (or, for corner cases, snake_case)',
|
|
172
171
|
severity: 'warning',
|
|
173
172
|
},
|