arui-presets-lint 7.1.1 → 7.3.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/README.md +43 -19
- package/eslint/index.js +7 -2
- package/package.json +17 -20
package/README.md
CHANGED
|
@@ -14,14 +14,7 @@
|
|
|
14
14
|
|
|
15
15
|
[Как я могу улучшить стандарты?](./.github/CONTRIBUTING.md)
|
|
16
16
|
|
|
17
|
-
##
|
|
18
|
-
|
|
19
|
-
Данный проект использует [semantic-release](https://semantic-release.gitbook.io/semantic-release/).
|
|
20
|
-
|
|
21
|
-
Выпуск новой версии происходит с помощью Github Actions, используйте джобу `Create new library package`. Для beta-версии используется ветка `beta`, для релизной - master.
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
## Установка
|
|
17
|
+
## Установка и обновление
|
|
25
18
|
|
|
26
19
|
Для установки всех зависимостей проекта рекомендуется использовать [install-peerdeps](https://github.com/nathanhleung/install-peerdeps)
|
|
27
20
|
|
|
@@ -29,8 +22,7 @@
|
|
|
29
22
|
npx install-peerdeps --dev arui-presets-lint
|
|
30
23
|
```
|
|
31
24
|
|
|
32
|
-
Так же вы можете поставить все необходимые peerDependencies вручную. Для этого узнайте требуемые версии
|
|
33
|
-
с помощью команды
|
|
25
|
+
Так же вы можете поставить все необходимые peerDependencies вручную. Для этого узнайте требуемые версии с помощью команды
|
|
34
26
|
|
|
35
27
|
```sh
|
|
36
28
|
yarn info arui-presets-lint peerDependencies
|
|
@@ -38,6 +30,8 @@ yarn info arui-presets-lint peerDependencies
|
|
|
38
30
|
|
|
39
31
|
И добавьте их себе в проект как dev зависимости.
|
|
40
32
|
|
|
33
|
+
> ⚠️ Нужно производить процедуру установки peer dependencies при каждом обновлении библиотеки
|
|
34
|
+
|
|
41
35
|
## Конфигурация всех линтеров через `package.json`:
|
|
42
36
|
|
|
43
37
|
```json
|
|
@@ -73,20 +67,12 @@ yarn info arui-presets-lint peerDependencies
|
|
|
73
67
|
|
|
74
68
|
> ⚠️ Внимание, .eslintignore [по умолчанию не подтягиватся в lint-staged](https://github.com/okonet/lint-staged#how-can-i-ignore-files-from-eslintignore)!
|
|
75
69
|
|
|
76
|
-
Так же можно добавить к командам аргумент `--ignore-path` со значением `.gitignore`, в этом случае конфиг из дефолтных файлов (.eslintignore, .stylelintignore, .prettierignore) не будет применятся, но можно добавить специфичные правила в конфиг ([eslintConfig.ignorePatterns](https://eslint.org/docs/latest/use/configure/ignore#ignorepatterns-in-config-files), [stylelintConfig.ignoreFiles](https://stylelint.io/user-guide/configure#ignorefiles)).
|
|
77
|
-
|
|
78
70
|
Для запуска eslint/stylelint рекомендуется использовать флаг [--max-warnings](https://eslint.org/docs/latest/user-guide/command-line-interface#--max-warnings), который позволяет ограничить количество возникающих предупреждений.
|
|
79
71
|
|
|
80
|
-
## Конфигурация
|
|
72
|
+
## Конфигурация [lint-staged](https://github.com/lint-staged/lint-staged):
|
|
81
73
|
|
|
82
74
|
```json
|
|
83
75
|
{
|
|
84
|
-
"husky": {
|
|
85
|
-
"hooks": {
|
|
86
|
-
"pre-commit": "tsc --noEmit && lint-staged",
|
|
87
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
76
|
"lint-staged": {
|
|
91
77
|
"*.{js,jsx,ts,tsx,json}": ["prettier --write", "eslint"],
|
|
92
78
|
"*.css": ["prettier --write", "stylelint"],
|
|
@@ -94,6 +80,38 @@ yarn info arui-presets-lint peerDependencies
|
|
|
94
80
|
}
|
|
95
81
|
```
|
|
96
82
|
|
|
83
|
+
## Конфигурация [git hooks](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks)
|
|
84
|
+
|
|
85
|
+
Для настройки git hooks рекомендуется использовать библиотеки [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks), либо [husky@4](https://github.com/typicode/husky/tree/v4.3.8)
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
### Пример конфигурации для simple-git-hooks:
|
|
89
|
+
|
|
90
|
+
```json
|
|
91
|
+
{
|
|
92
|
+
"simple-git-hooks": {
|
|
93
|
+
"pre-commit": "yarn tsc --noEmit && yarn lint-staged",
|
|
94
|
+
"commit-msg": "yarn commitlint --edit $1"
|
|
95
|
+
},
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
### Пример конфигурации для husky@4:
|
|
102
|
+
|
|
103
|
+
```json
|
|
104
|
+
{
|
|
105
|
+
"husky": {
|
|
106
|
+
"hooks": {
|
|
107
|
+
"pre-commit": "yarn tsc --noEmit && yarn lint-staged",
|
|
108
|
+
"commit-msg": "yarn commitlint -E HUSKY_GIT_PARAMS"
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
```
|
|
114
|
+
|
|
97
115
|
## Настройка IDE:
|
|
98
116
|
|
|
99
117
|
1. Включить ESLint
|
|
@@ -106,6 +124,12 @@ yarn info arui-presets-lint peerDependencies
|
|
|
106
124
|
- [Расширение для VS Code](https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode)
|
|
107
125
|
- [Инструкция для Webstorm](https://prettier.io/docs/en/webstorm.html)
|
|
108
126
|
|
|
127
|
+
## Релизы
|
|
128
|
+
|
|
129
|
+
Данный проект использует [semantic-release](https://semantic-release.gitbook.io/semantic-release/).
|
|
130
|
+
|
|
131
|
+
Выпуск новой версии происходит с помощью Github Actions, используйте джобу `Create new library package`. Для beta-версии используется ветка `beta`, для релизной - `master`.
|
|
132
|
+
|
|
109
133
|
## Лицензия
|
|
110
134
|
|
|
111
135
|
```
|
package/eslint/index.js
CHANGED
|
@@ -9,7 +9,7 @@ module.exports = {
|
|
|
9
9
|
],
|
|
10
10
|
parserOptions: {
|
|
11
11
|
project: './tsconfig.json',
|
|
12
|
-
ecmaVersion:
|
|
12
|
+
ecmaVersion: 2022,
|
|
13
13
|
sourceType: 'module',
|
|
14
14
|
ecmaFeatures: {
|
|
15
15
|
jsx: true,
|
|
@@ -129,7 +129,12 @@ module.exports = {
|
|
|
129
129
|
'error',
|
|
130
130
|
{ devDependencies: ['**/*.{stories,test,tests,spec}.{js,jsx,ts,tsx}'] },
|
|
131
131
|
],
|
|
132
|
-
'import/no-cycle':
|
|
132
|
+
'import/no-cycle': [
|
|
133
|
+
'error',
|
|
134
|
+
{
|
|
135
|
+
ignoreExternal: true,
|
|
136
|
+
},
|
|
137
|
+
],
|
|
133
138
|
'import/prefer-default-export': 'off',
|
|
134
139
|
'import/no-unresolved': 'off',
|
|
135
140
|
'import/extensions': 'off',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arui-presets-lint",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.3.0",
|
|
4
4
|
"description": "Config files for arui-apps",
|
|
5
5
|
"author": "core-ds contributors",
|
|
6
6
|
"license": "MIT",
|
|
@@ -13,25 +13,24 @@
|
|
|
13
13
|
"node": ">=18.12.0"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|
|
16
|
-
"@typescript-eslint/eslint-plugin": "
|
|
17
|
-
"@typescript-eslint/parser": "
|
|
16
|
+
"@typescript-eslint/eslint-plugin": ">=6.21.0",
|
|
17
|
+
"@typescript-eslint/parser": ">=6.21.0",
|
|
18
18
|
"eslint": "^8.57.0",
|
|
19
19
|
"eslint-config-airbnb": "^19.0.4",
|
|
20
|
-
"eslint-config-airbnb-typescript": "
|
|
20
|
+
"eslint-config-airbnb-typescript": ">=17.1.0",
|
|
21
21
|
"eslint-config-prettier": "^9.1.0",
|
|
22
22
|
"eslint-import-resolver-typescript": "^3.6.1",
|
|
23
23
|
"eslint-plugin-cypress": "^2.15.1",
|
|
24
24
|
"eslint-plugin-dirnames": "^1.0.3",
|
|
25
25
|
"eslint-plugin-import": "^2.29.1",
|
|
26
26
|
"eslint-plugin-jsx-a11y": "^6.8.0",
|
|
27
|
-
"eslint-plugin-react": "^7.
|
|
27
|
+
"eslint-plugin-react": "^7.34.1",
|
|
28
28
|
"eslint-plugin-react-hooks": "^4.6.0",
|
|
29
29
|
"eslint-plugin-simple-import-sort": "^12.0.0",
|
|
30
30
|
"eslint-plugin-unicorn": "^51.0.1",
|
|
31
|
-
"husky": "^4.3.8",
|
|
32
31
|
"lint-staged": "^15.2.2",
|
|
33
32
|
"prettier": "^3.2.5",
|
|
34
|
-
"stylelint": "^16.
|
|
33
|
+
"stylelint": "^16.3.1"
|
|
35
34
|
},
|
|
36
35
|
"devDependencies": {
|
|
37
36
|
"@alfalab/core-components": "45.0.0",
|
|
@@ -41,29 +40,29 @@
|
|
|
41
40
|
"@semantic-release/github": "9.2.6",
|
|
42
41
|
"@semantic-release/npm": "11.0.2",
|
|
43
42
|
"@semantic-release/release-notes-generator": "12.1.0",
|
|
44
|
-
"@typescript-eslint/eslint-plugin": "
|
|
45
|
-
"@typescript-eslint/parser": "
|
|
43
|
+
"@typescript-eslint/eslint-plugin": "7.4.0",
|
|
44
|
+
"@typescript-eslint/parser": "7.4.0",
|
|
46
45
|
"eslint": "8.57.0",
|
|
47
46
|
"eslint-config-airbnb": "19.0.4",
|
|
48
|
-
"eslint-config-airbnb-typescript": "
|
|
47
|
+
"eslint-config-airbnb-typescript": "18.0.0",
|
|
49
48
|
"eslint-config-prettier": "9.1.0",
|
|
50
49
|
"eslint-import-resolver-typescript": "3.6.1",
|
|
51
50
|
"eslint-plugin-cypress": "2.15.1",
|
|
52
51
|
"eslint-plugin-dirnames": "1.0.3",
|
|
53
52
|
"eslint-plugin-import": "2.29.1",
|
|
54
53
|
"eslint-plugin-jsx-a11y": "6.8.0",
|
|
55
|
-
"eslint-plugin-react": "7.
|
|
54
|
+
"eslint-plugin-react": "7.34.1",
|
|
56
55
|
"eslint-plugin-react-hooks": "4.6.0",
|
|
57
56
|
"eslint-plugin-simple-import-sort": "12.0.0",
|
|
58
57
|
"eslint-plugin-unicorn": "51.0.1",
|
|
59
|
-
"husky": "4.3.8",
|
|
60
58
|
"kebab-case": "1.0.0",
|
|
61
59
|
"lint-staged": "15.2.2",
|
|
62
60
|
"prettier": "3.2.5",
|
|
63
61
|
"react": "17.0.2",
|
|
64
62
|
"semantic-release": "22.0.12",
|
|
65
|
-
"
|
|
66
|
-
"
|
|
63
|
+
"simple-git-hooks": "2.11.1",
|
|
64
|
+
"stylelint": "16.3.1",
|
|
65
|
+
"typescript": "5.4.4"
|
|
67
66
|
},
|
|
68
67
|
"scripts": {
|
|
69
68
|
"precommit": "lint-staged",
|
|
@@ -82,11 +81,9 @@
|
|
|
82
81
|
"yarn lint:css"
|
|
83
82
|
]
|
|
84
83
|
},
|
|
85
|
-
"
|
|
86
|
-
"
|
|
87
|
-
|
|
88
|
-
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
|
|
89
|
-
}
|
|
84
|
+
"simple-git-hooks": {
|
|
85
|
+
"pre-commit": "yarn test",
|
|
86
|
+
"commit-msg": "yarn commitlint --edit $1"
|
|
90
87
|
},
|
|
91
88
|
"prettier": "./prettier",
|
|
92
89
|
"stylelint": {
|
|
@@ -108,5 +105,5 @@
|
|
|
108
105
|
"commitlint": {
|
|
109
106
|
"extends": "./commitlint"
|
|
110
107
|
},
|
|
111
|
-
"packageManager": "yarn@4.1.
|
|
108
|
+
"packageManager": "yarn@4.1.1"
|
|
112
109
|
}
|